Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

You have already activated rack 1.6.0, but your Gemfile requires rack 1.6.4

Similar to problem with rack 1.3.2. You have already activated rack 1.3.2, but your Gemfile requires rack 1.2.3 -- I'm experiencing You have already activated rack 1.6.0, but your Gemfile requires rack 1.6.4 when attempting to run Rails (4.2) in production with Puma and Nginx.

bundle update rake nor rm Gemfile.lock && bundle install seem to help, the only solution I have so far is manually changing rack (1.6.4) to rack (1.6.0) in Gemfile.lock.

like image 907
Mark Boulder Avatar asked Aug 02 '15 19:08

Mark Boulder


3 Answers

you need to uninstall one version of rack which is not required.

Do this please

gem uninstall rack -v 1.6.0

Reference: How to force rack to work around the usual "You have already activated rack..." bug?

like image 148
Athar Avatar answered Nov 18 '22 22:11

Athar


One experienced Rails developer highly recommends using binstubs. Have it installed by:

bundle install --binstubs

and run it via relative path:

./bin/rails server

or what is most recommended update PATH and forget about bundler issues:

export PATH="./bin:$PATH"
rails server
like image 34
Anatoly Avatar answered Nov 19 '22 00:11

Anatoly


Run it like this: bundle exec rails s. This will use settings from your Gemfile.lock

like image 1
Zepplock Avatar answered Nov 19 '22 00:11

Zepplock