0
我試圖運行最早的rails版本'2.3.18'的維護應用程序。和ree-1.8.7-2012.02 [x86_64]。 bundle install
和rake 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'
我認爲一些gem對oauth-0.4.7或更高版本有依賴性。請檢查Gemfile.lock –
在Gemfile.lock中它是'oauth(0.4.7)',所以我在Gemfile中將其更改爲'gem'oauth','0.4.7'並運行bundle install,但沒有運氣。當我添加上面的表並運行rake db時,錯誤即將到來:migrate。 – venkat
卸載「gem uninstall oauth-0.3.6」版本 –