2012-06-16 111 views
1

我试图在我的终端执行rake db:migrate命令,但它给出了错误。几分钟前它正在工作。这里的错误,我得到:rake db:迁移失败(活动记录)

rake aborted! 
no such file to load -- activerecord 

错误的完整的跟踪:

/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:inrequire' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in block in require' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:inload_dependency' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in require' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/has_one_autocreate-1.0.0/lib/has_one_autocreate.rb:2:in' 
/Users/amritayalur/.rvm/gems/[email protected]/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in require' 
/Users/amritayalur/.rvm/gems/[email protected]/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:inblock (2 levels) in require' 
/Users/amritayalur/.rvm/gems/[email protected]/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in each' 
/Users/amritayalur/.rvm/gems/[email protected]/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:inblock in require' 
/Users/amritayalur/.rvm/gems/[email protected]/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in each' 
/Users/amritayalur/.rvm/gems/[email protected]/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:inrequire' 
/Users/amritayalur/.rvm/gems/[email protected]/gems/bundler-1.1.4/lib/bundler.rb:119:in require' 
/Users/amritayalur/rails_projects/mobilecapdb/config/application.rb:7:in' 
/Users/amritayalur/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' 
/Users/amritayalur/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' 
/Users/amritayalur/rails_projects/mobilecapdb/Rakefile:5:in <top (required)>' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:inload' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in load_rakefile' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:501:inraw_load_rakefile' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:82:in block in load_rakefile' 
/Users/amritayalur/.rvm/gems/ruby1.9.2p318/gems/rake0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:81:in load_rakefile' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:65:inblock in run' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:63:inrun' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/bin/rake:33:in <top (required)>' 
/Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/bin/rake:23:inload' /Users/amritayalur/.rvm/gems/ruby-1.9.2-p318/bin/rake:23:in <main>' 

我该如何解决这个问题?

+1

你正在使用哪个版本的导轨? – CodeMaster123

+0

请运行此命令'rake db:migrate -t​​race'并粘贴完整的错误跟踪 – abhas

+0

我在rails 3.2.6 – Slicekick

回答

0

您可能没有正确安装指定的Gems。试试这个:

bundle install 
rake db:migrate