0

I'm upgrading from the Ruby Enterprise Edition 1.8.6 to the latest 1.8.7 version with Unicorn to facilitate an upgrade to Rails 2.3.10, and am running into some issues. Should I uninstall the older versions of these gems?

Here's the log messages:

I'm upgrading from the Ruby Enterprise Edition 1.8.6 to the latest 1.8.7 version with Unicorn to facilitate an upgrade to Rails 2.3.10, and am running into some issues. Should I uninstall the older versions of these gems?

I, [2011-02-02T22:06:16.328076 #30672]  INFO -- : listening on addr=0.0.0.0:8080 fd=3
I, [2011-02-02T22:06:16.333137 #30672]  INFO -- : Refreshing Gem list
/srv/ree/bin/unicorn_rails must be run inside RAILS_ROOT: #<Gem::LoadError: can't activate rack (~> 1.1.0, runtime) for ["actionpack-2.3.10", "rails-2.3.10"], already activated rack-1.2.1 for ["unicorn-3.3.1"]>
I, [2011-02-02T22:07:12.259436 #30701]  INFO -- : listening on addr=0.0.0.0:8080 fd=3
I, [2011-02-02T22:07:12.259952 #30701]  INFO -- : Refreshing Gem list
/srv/ree/bin/unicorn_rails must be run inside RAILS_ROOT: #<Gem::LoadError: can't activate rack (~> 1.1.0, runtime) for ["actionpack-2.3.10", "rails-2.3.10"], already activated rack-1.2.1 for ["unicorn-3.3.1"]>
I, [2011-02-02T22:09:27.787177 #30772]  INFO -- : listening on addr=0.0.0.0:8080 fd=3
I, [2011-02-02T22:09:27.787691 #30772]  INFO -- : Refreshing Gem list
/srv/ree/bin/unicorn_rails must be run inside RAILS_ROOT: #<Gem::LoadError: can't activate rack (~> 1.1.0, runtime) for ["actionpack-2.3.10", "rails-2.3.10"], already activated rack-1.2.1 for ["unicorn-3.3.1"]>
I, [2011-02-02T22:10:44.175407 #30846]  INFO -- : listening on addr=0.0.0.0:8080 fd=3
I, [2011-02-02T22:10:44.175928 #30846]  INFO -- : Refreshing Gem list
/srv/ree/bin/unicorn_rails must be run inside RAILS_ROOT: #<Gem::LoadError: can't activate rack (~> 1.1.0, runtime) for ["actionpack-2.3.10", "rails-2.3.10"], already activated rack-1.2.1 for ["unicorn-3.3.1"]>
1

I ran across this problem as well. We were using Bundler and it didn't seem to help. A certain gem was wanting to use Rack 1.1.0 but unicorn wasn't having it. I don't think rvm with gemsets would help because two different gems are demanding two different versions of rack.

Ultimately I ended up with a production server running:

Rails 2.3.10
Ruby Enterprise Edition 1.8.7
Bundler 1.0.10
Unicorn 3.1.0
Rack 1.1.0

You must uninstall Rack 1.2.1. I am also using unicorn_rails which wraps my rails app in rack. I'm not sure if this is necessary but I couldn't get my rails routes working correctly with a rack specific app (dragonfly).

Also, you need to run that command from the root of your rails directory (unless you specify a working_directory in the config). I recommend using Brandon Tilley's guide to serving Rails Apps with RVM, Nginx, and Unicorn although I couldn't get upstart to work correctly. I ended up making my own /etc/init.d/unicorn_test_app script which basically just runs:

rvm_path=/usr/local/rvm \
/usr/local/bin/rvm-shell "ree-1.8.7-2011.03@test_app_rails2" -c \
"/usr/local/rvm/gems/ree-1.8.7-2011.03@test_app_rails2/bin/unicorn_rails \
-D -E production -c /var/www/test_app/config/unicorn.rb"

and then kills the process with specific signals. It's pretty nice once you get it all working because you can have zero down time deploys (aside migrations).

Only thing I don't like about my script: it's gemset specific.

0

I see three ways to solve the problem:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.