Reputation: 166
Rake 12.3.1 is in the Gemfile, and installed:
/app # bundle install | grep rake
Using rake 12.3.1
/app # grep rake Gemfile.lock
rake (>= 0.8.7)
rake (12.3.1)
/app # bundle exec gem list | grep rake
rake (12.3.1)
Bundler thinks all is well:
/app # bundle check
The Gemfile's dependencies are satisfied
A plain bundle exec ruby
loads it ok:
/app # bundle exec ruby -e'require "rake"; p Rake::VERSION'
"12.3.1"
But, a Rails console can't find it:
/app # bin/rails c
Could not find rake-12.3.1 in any of the sources
Run `bundle install` to install missing gems.
/app # bundle exec bin/rails c
Could not find rake-12.3.1 in any of the sources
Run `bundle install` to install missing gems.
What am I missing?
Upvotes: 7
Views: 1510
Reputation: 386
Is Spring initialized in your version of rails? If so, try disabling the Spring rails application preloader:
DISABLE_SPRING=true rails c
Upvotes: 14
Reputation: 166
This was inside a Docker container with BUNDLE_PATH
set to /gems
. I opened a shell and deleted all the content under /gems
, bundled again, and now it works.
I'd love to understand what was happening, but now I get to move on.
Upvotes: 1