我想做的我想跑
rails g petergate:install
我希望它添加迁移并将 petergate 插入到我的用户模型中。
实际发生的是我在终端中收到一条错误消息:
Could not find i18n-0.8.6 in any of the sources
Run `bundle install` to install missing gems.
我运行了 bundle install
并重试了 rails g petergate:install
,但同样的错误不断出现。
当我查看我的 gem 时,我确实有 i18n-0.8.6
。
$ rails g petergate:install
Could not find i18n-0.8.6 in any of the sources
Run `bundle install` to install missing gems.
$ bundle install
Using rake 12.0.0
Using concurrent-ruby 1.0.5
Using i18n 0.8.6
我不确定如何调试它。
petergate gem 在我的 Gemfile
中:
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'friendly_id', '~> 5.2', '>= 5.2.1'
gem 'devise', '~> 4.3'
gem 'bootstrap', '~> 4.0.0.beta'
gem 'microurb_view_tool', '~> 0.1.0'
gem 'petergate', '~> 1.7', '>= 1.7.5'
出于调试目的,已运行以下命令:
$ cat Gemfile.lock | grep i18n
i18n (~> 0.7)
i18n (0.8.6)
$ bundle exec rails g petergate:install
Could not find i18n-0.8.6 in any of the sources
Run `bundle install` to install missing gems.
$ bundle exec rake rails:update:bin
rake aborted!
Don't know how to build task 'rails:update:bin' (see --tasks)
/Users/danale/.rvm/gems/ruby-2.4.0@global/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/Users/danale/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
/Users/danale/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
最佳答案
一定要确认 ruby -v
、rails -v
和 bundle -v
输出预期的版本,因为 Rails 可能正在使用不同的 gem 。
关于ruby-on-rails - 尝试安装 petergate gem 时 Bundler 找不到 i18n-0.8.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46122772/