Hello all. I''ve run into a strange problem with Unicorn, and Google couldn''t help me out. Basically, I''m going to switch from Passenger to Unicorn for the next release of my Rails app. I installed it on my local machine, and it ran great. But then, as I was building my new server to deploy on, I ran into a snag. When I run ''unicorn_rails'', I got a strange error. Here''s the output of ''unicorn_rails -d'' : $ unicorn_rails -d {:daemonize=>false, :unicorn_options=>{:listeners=>[]}, :app=> #<Proc:0x000000000216dad0@/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/unicorn-0.96.0/bin/unicorn_rails:124>} Exception `Errno::EEXIST'' at /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/cache Exception `Errno::EEXIST'' at /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/pids Exception `Errno::EEXIST'' at /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/sessions Exception `Errno::EEXIST'' at /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/1.8/fileutils.rb:243 - File exists - tmp/sockets I, [2010-01-19T21:25:09.748670 #30184] INFO -- : listening on addr=0.0.0.0:8080 fd=3 Exception `LoadError'' at /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31 - no such file to load -- Win32API Exception `LoadError'' at /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:38 - no such file to load -- Win32API I, [2010-01-19T21:25:09.758670 #30184] INFO -- : worker=0 spawning... I, [2010-01-19T21:25:09.768670 #30184] INFO -- : master process ready I, [2010-01-19T21:25:09.768670 #30185] INFO -- : worker=0 spawned pid=30185 I, [2010-01-19T21:25:09.828670 #30185] INFO -- : Refreshing Gem list Exception `Gem::LoadError'' at /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems.rb:280 - can''t activate rack (~> 1.0.0, runtime) for ["actionpack-2.3.5", "rails-2.3.5"], already activated rack-1.1.0 for ["unicorn-0.96.0"] Missing the Rails 2.3.5 gem. Please `gem install -v=2.3.5 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed. Exception `Errno::EAGAIN'' at /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/unicorn-0.96.0/lib/unicorn.rb:436 - Resource temporarily unavailable I, [2010-01-19T21:25:09.918670 #30184] INFO -- : reaped #<Process::Status: pid=30185,exited(1)> worker=0 Exception `Errno::ECHILD'' at /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/unicorn-0.96.0/lib/unicorn.rb:454 - No child processes And then it just repeats. I''m using ree both locally and on the server (as you can see), but I''m using it through rvm locally. Any idea what this might be? Thanks, Steve
Steve Klabnik <steve at steveklabnik.com> wrote:> Hello all. I''ve run into a strange problem with Unicorn, and Google > couldn''t help me out. Basically, I''m going to switch from Passenger to > Unicorn for the next release of my Rails app. I installed it on my > local machine, and it ran great. But then, as I was building my new > server to deploy on, I ran into a snag. > > When I run ''unicorn_rails'', I got a strange error. Here''s the output > of ''unicorn_rails -d'' : > > $ unicorn_rails -d<snip>> Exception `Gem::LoadError'' at > /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems.rb:280 > - can''t activate rack (~> 1.0.0, runtime) for ["actionpack-2.3.5", > "rails-2.3.5"], already activated rack-1.1.0 for ["unicorn-0.96.0"] > Missing the Rails 2.3.5 gem. Please `gem install -v=2.3.5 rails`, > update your RAILS_GEM_VERSION setting in config/environment.rb for the > Rails version you do have installed, or comment out RAILS_GEM_VERSION > to use the latest version installed. > Exception `Errno::EAGAIN'' at > /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/unicorn-0.96.0/lib/unicorn.rb:436 > - Resource temporarily unavailable > I, [2010-01-19T21:25:09.918670 #30184] INFO -- : reaped > #<Process::Status: pid=30185,exited(1)> worker=0 > Exception `Errno::ECHILD'' at > /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/unicorn-0.96.0/lib/unicorn.rb:454 > - No child processes > > And then it just repeats. > > I''m using ree both locally and on the server (as you can see), but I''m > using it through rvm locally. > > Any idea what this might be?Hi Steve, Rails 2.3.x isn''t compatible with Rack 1.1.0. Unicorn depends on Rack and since Unicorn is always loaded before Rails is, the Unicorn dependency will always load the newest version of Rack on the system. Uninstalling Rack 1.1.0 for now should fix things, just keep Rack 1.0.1 installed). I''ll add this to the FAQ for now, not sure if there''s a sane solution for it... -- Eric Wong
> Missing the Rails 2.3.5 gem. Please `gem install -v=2.3.5 rails`, > update your RAILS_GEM_VERSION setting in config/environment.rb for the > Rails version you do have installed, or comment out RAILS_GEM_VERSION > to use the latest version installed.I think I know what this is. I went nuts on this today. It''s Rack 1.1 that is messing with you and stupid stupid rails that, in boot.rb has this: rescue Gem::LoadError => load_error $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`... ... end Rails assumes the only reason for failure is a missing Rails install, but if you throw in a #{load_error.inspect} in there the Rack issue shows up loud and clear... Always always include the actual error in a log statement when you rescue! :)> Exception `Errno::EAGAIN'' at > /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/unicorn-0.96.0/lib/unicorn.rb:436 > - Resource temporarily unavailable > I, [2010-01-19T21:25:09.918670 #30184] INFO -- : reaped > #<Process::Status: pid=30185,exited(1)> worker=0 > Exception `Errno::ECHILD'' at > /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/unicorn-0.96.0/lib/unicorn.rb:454 > - No child processes > > And then it just repeats. > > I''m using ree both locally and on the server (as you can see), but I''m > using it through rvm locally. > > Any idea what this might be? > > Thanks, > Steve > _______________________________________________ > Unicorn mailing list - mongrel-unicorn at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Do not quote signatures (like this one) or top post when replying