【发布时间】:2017-11-29 12:46:55
【问题描述】:
我添加了 gemfile:
gem 'activerecord-reputation-system', require: 'reputation_system'
到我的 Rails 应用程序,以便为模型添加赞成/反对票功能(我正在关注 Railscast #364)。我安装 gem 没有问题。
我输入了“rails g 信誉系统”并 rake db:migrate,但 rake 被中止:
Gem::LoadError: You have already activated rake 12.3.0, but your
Gemfile requires rake 12.0.0. Prepending `bundle exec` to your command
may solve this.
我用 'bundle exec' 尝试过,但 rake 再次中止:
StandardError: An error has occurred, this and all later migrations
canceled:
Directly inheriting from ActiveRecord::Migration is not supported.
Please specify the Rails release the migration was written for:
我更新了我的 gem,看看这是否是问题所在,但这并没有什么不同。
除了找到删除 rake 12.3.0 和安装 12.0.0 的方法之外,我想不出其他任何办法,但这似乎不合逻辑。
任何帮助将不胜感激,谢谢:-)
【问题讨论】:
标签: ruby-on-rails activerecord rubygems rake bundler