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

早过忘川 提交于 2019-12-04 09:08:18

问题


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.


回答1:


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?




回答2:


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



回答3:


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




回答4:


These issues might arise if you are using local or global gemset for more than one project. Why not create seprate gemset for each project.

You can do this using rvm

Create new gemset

rvm gemset create new_test

rvm gemset use new_test

bundle install



回答5:


You can simply run below cmd to get the latest rack installed in server to fix the issue:

gem install rack


来源:https://stackoverflow.com/questions/31775991/you-have-already-activated-rack-1-6-0-but-your-gemfile-requires-rack-1-6-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!