problem with rack 1.3.2. You have already activated rack 1.3.2, but your Gemfile requires rack 1.2.3

北城以北 提交于 2019-12-21 19:40:13

问题


i have passenger 3.0.9 on debian with gem rack 1.3.2 and 1.2.1.

With a rails 3.0 application with passenger e bundler i have this error:

You have already activated rack 1.3.2, but your Gemfile requires rack 1.2.3. Consider using bundle exec.

With rails 3.1 is all ok. I can't make start application with rails 3.0 but only with 3.1.

Passnnger load first rack 1.3.2 and don't load rack 1.2.3 on gems of bundler


回答1:


Short answer:

you need to run

bundle update rack

This will update your rack version in Gemfile.lock

Longer answer:

This error usually happens when your activated rack/rake version is different from your rails app's rack/rake version. When you run 'bundle install', some critical gems won't get update due to dependency.

That's why you need to run 'bundle update' (for all gems), or 'bundle update a_specific_gem' to update a certain gem like rack/rake in you Gemfile.lock.




回答2:


What worked for me is this:

  1. Clear your Gemfile.lock
  2. Run bundle install

Problem fixed.




回答3:


I had this exact issue on Dreamhosters.com with a recent client. I believe what I did was update my Gemfile to specify the version that is already "activated" and then rebuild the Gemfile.lock.

In my case the problem the issue was that rails was finding the system gems before my local gems and couldn't handle the conflict gracefully. It was on 3.0.3 and I didn't have the same issue on my development box where I use rvm and don't have a system ruby/rails installed at all.

I don't know that this will solve your issues but it might at least give you a starting point for further research. I found a lot of links for this by googling the error message.




回答4:


The 5 whys response to your problem is:

Phusion Passenger is not using your application Bundled gems, but another set of gems.

This may be because many different reasons, but all of them related to your particular system (OS, apache/nginx, ruby, environment variables, ...).

  • Make sure your Gemfile is correct (especially the 'source' lines)
  • know which user is running your Phusion Passenger (usually is the same as your web server)
  • Force a bundle path for that user

    BUNDLE_PATH: /home/xxxxxxx/.bundler to RAILS_ROOT/.bundle/config

  • or even better use bundle deployment option to install gems in vendor/bundle

    bundle install --deployment



来源:https://stackoverflow.com/questions/7323357/problem-with-rack-1-3-2-you-have-already-activated-rack-1-3-2-but-your-gemfile

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