2015-04-15 47 views
0

我試圖運行最早的rails版本'2.3.18'的維護應用程序。和ree-1.8.7-2012.02 [x86_64]。 bundle installrake db:create工作正常,當我運行rake db:migrate我得到以下錯誤:使用rails運行遷移時出現`raise_if_conflicts'2.3.18

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' 
+0

我認爲一些gem對oauth-0.4.7或更高版本有依賴性。請檢查Gemfile.lock –

+0

在Gemfile.lock中它是'oauth(0.4.7)',所以我在Gemfile中將其更改爲'gem'oauth','0.4.7'並運行bundle install,但沒有運氣。當我添加上面的表並運行rake db時,錯誤即將到來:migrate。 – venkat

+0

卸載「gem uninstall oauth-0.3.6」版本 –

回答

0

能否請你像下面運行rake命令:

bundle exec rake db:migrate 

讓我知道如果它有效或沒有。謝謝

+0

我已經試過了。但沒有幫助我 – venkat

相關問題