4
You have already activated rack 1.2.1, but your Gemfile requires rack 1.3.4. Consider using bundle exec.

Passenger throws me this in the Dreamhost. How can i solve?

EDIT: I asked them to remove the rack 1.2.1, but i doubt they will. They probably maintain this gem there for compatibily reasons. But the question is.. why does the wrong rack keeps being loaded instead of the right rack version and is there any workaround for it?

pedrozath
  • 2,353
  • 4
  • 20
  • 23

2 Answers2

1

Uhg.... this f*cking error. It has caused me so much grief on Dreamhost. My solution has been just to require the version that Passenger says you've "activated". In your case, 1.2.1:

gem 'rack', '1.2.1'

It's unlikely that this will cause any incompatibility errors. Your other option is to remove all versions of rack except that one your Gemfile.lock has specified (1.3.4 in your case), but I've had trouble with this on Dreamhost.

edit You can also try installing rack 1.3.4 at the "system" level:

gem install rack -v 1.3.4

or

gem update rack

Hopefully Passenger will use the latest installed version by default.

bricker
  • 8,911
  • 2
  • 44
  • 54
  • But what if my rails really requires the 1.3.4 – pedrozath Oct 14 '11 at 15:57
  • Then try to remove other versions of rack yourself with `gem uninstall rack`, or if you can't then contact Dreamhost to remove them for you. If you're on a private server you should be able to remove them yourself no problem. – bricker Oct 14 '11 at 16:01
  • 1
    I can and i will ask that, but i doubt they will. They probably maintain this gem there for compatibily reasons. But the question is.. why does the wrong rack keeps being loaded instead of the right rack version? – pedrozath Oct 14 '11 at 16:08
  • Good question, I don't know because I don't really know a lot about Passenger. I'd be interested in finding this out as well. – bricker Oct 14 '11 at 16:14
  • Just to let it clear, i cant remove any gems i didnt installed, like for example, rack 1.2.1. – pedrozath Oct 14 '11 at 16:44
0

Seems that this problem is not solved in dreamhost. If you need a rack different from 1.2.1 dreamhost suggest to try fastCGI.

More info:

http://www.jacoulter.com/2011/12/14/rails-3-1-rack-1-3-5-passenger-and-dreamhost-shared-servers/

http://wiki.dreamhost.com/Rails_3

http://grigio.org/you_have_already_activated_rack_1_2_1_your_gemfile_requires_rack_1_3_2_rails_3_1_passenger

Lucamug
  • 792
  • 5
  • 19