尝试安装 petergate 时 Bundler 找不到 i18n-0.8.6 gem

Bundler cannot find i18n-0.8.6 when attempting to install petergate gem

我尝试过的我尝试过运行

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 -vrails -vbundle -v 输出预期的版本,因为 Rails 可能使用不同的 gemset。