`raise_if_conflicts'使用rails 2.3.18运行迁移时

时间:2015-04-15 07:37:02

标签: ruby-on-rails ruby

我正在尝试使用最旧的rails版本' 2.3.18'来运行维护应用程序。和ree-1.8.7-2012.02 [x86_64]。 bundle installrake db:create工作正常,当我运行rake db:migrate时出现以下错误:

rake aborted!
Could not find table 'comments'

使用评论我有3个依赖表,所以我做了:

ruby script/generate migration CreateComments commentable_type:string commentable_id:integer body:text member_id:integer created_at:datettime 

当我运行rake db:migrate时。我收到这个错误:

/usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems/specification.rb:1613:in `raise_if_conflicts': can't activate oauth-0.4.7, already activated oauth-0.3.6 (Gem::LoadError)
    from /usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems/specification.rb:740:in `activate'
    from /usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems.rb:1209:in `gem'
    from /root/Desktop/Projects/community/vendor/plugins/oauth-plugin/rails/init.rb:1:in `evaluate_init_rb'
    from ./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:158:in `evaluate_init_rb'
    from /root/Desktop/Projects/community/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    from ./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:154:in `evaluate_init_rb'
    from ./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:48:in `load'
    from ./script/../config/../vendor/rails/railties/lib/rails/plugin/loader.rb:38:in `load_plugins'
    from ./script/../config/../vendor/rails/railties/lib/rails/plugin/loader.rb:37:in `each'
    from ./script/../config/../vendor/rails/railties/lib/rails/plugin/loader.rb:37:in `load_plugins'
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:369:in `load_plugins'
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:165:in `process'
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
    from ./script/../config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
    from /root/Desktop/Projects/community/config/environment.rb:15
    from /usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /root/Desktop/Projects/community/vendor/rails/railties/lib/commands/generate.rb:1
    from /usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /usr/local/rvm/rubies/ree-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from script/generate:3

在我的Gemfile中,我有以下一行:

gem 'oauth', '0.3.6'

1 个答案:

答案 0 :(得分:0)

你能不能像下面那样运行你的rake命令:

bundle exec rake db:migrate

让我知道它是否有效。感谢