【发布时间】:2018-04-06 02:55:05
【问题描述】:
Rake 12.3.1 在 Gemfile 中,并已安装:
/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 认为一切都很好:
/app # bundle check
The Gemfile's dependencies are satisfied
一个普通的bundle exec ruby 加载它就可以了:
/app # bundle exec ruby -e'require "rake"; p Rake::VERSION'
"12.3.1"
但是,Rails 控制台找不到它:
/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.
我错过了什么?
【问题讨论】:
-
你能显示
bundle list的结果吗? -
我不确定发生了什么,但
bundle exec rails c应该可以工作。 -
终端中显示的默认 ruby 版本是什么,确保在执行 $rails c 时显示相同的 ruby 版本。你在使用任何 gemset 吗?
-
可以添加
bin/rails文件的内容吗?
标签: ruby-on-rails ruby bundler