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

标签 ruby-on-rails ruby macos rubygems

我想做的我想跑

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 可能正在使用不同的 gem 。

关于ruby-on-rails - 尝试安装 petergate gem 时 Bundler 找不到 i18n-0.8.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46122772/

相关文章:

ruby-on-rails - Rails 在初始迁移期间在 schema_migrations 表中查找不存在的 ID 列

java - ImageIcon 不显示在 java 中

css - Mac 浏览器不会像 Windows 那样显示我的菜单

ruby-on-rails - 用于生产的扭矩箱。任何人?

ruby-on-rails - 如何在互联网上的 Rails 服务器上访问 localhost ruby​​?

ruby-on-rails - Rails + Passenger + Apache + Alias

ruby-on-rails - capistrano, rails, PG::ConnectionBad: fe_sendauth: 没有提供密码

ruby - Rails form_tag 需要刷新

ruby-on-rails - 搜索和抓取黑客新闻 - Ruby

ruby-on-rails - 在 Mac OS Mavericks 中安装 ruby​​ 1.9.3