Trying to squeeze in a fairly new gem, and its causing me to stumble around updating quite a few others including Rails as a whole from 2.3.5 to 2.3.6.
Bundler installs fine.
But when I boot up script/console, I get this :
Loading development environment (Rails 2.3.3)
/Users/macuser/Sites/hq_channel/config/../vendor/rails/railties/lib/initializer.rb:271:in `require_frameworks':RuntimeError: can't activate rack (~> 1.0.0, runtime), already activated rack-1.1.0. Make sure all dependencies are added to Gemfile.
/Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:117:in `gem': can't activate rack (~> 1.0.0, runtime), already activated rack-1.1.0. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
from /Users/macuser/Sites/hq_channel/vendor/rails/actionpack/lib/action_controller.rb:34
-
It’s strange that it says
Rails 2.3.3.. not sure why.. -
I can’t figure out where/how it’s loading or trying to load Rack 1.0.0 now that I’ve updated it to Rack 1.1.0.
Any ideas?
If you’re using Bundler and running into dependency issues using a local binary, try prefixing that script with
bundle exec:Under the hood, this does the following:
bundler execin the context of your Bundler dependenciesThis tends to solve most problems. If you’re still having issues after that, your best bet is to verify your shell’s environment variables are correct and debug from there.
PS: If your issue is what I think it is, the problem here is that
script/consoleis pulling your system gems instead of the ones provided by bundler, which is why you’re seeing the incorrect version of Rack and getting load errors for your other gems.