我刚买了一台新笔记本电脑,所以我试图将一个项目转移到它上面,但无法启动并运行数据库。我之前在运行linux,但现在正在Mac上运行Yosemite。
我在Rails 3.0.3(它是一个升级项目),Ruby 1.9.3
当我运行bundle exec rake db:schema:load --trace
它说它在这一行打破了:
default_scope order("created_at ASC")
你可以在堆栈跟踪中看到。
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Could not find table 'comments'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activerecord-3.0.3/lib/active_record/connection_adapters/sqlite_adapter.rb:295:in `table_structure'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activerecord-3.0.3/lib/active_record/connection_adapters/sqlite_adapter.rb:186:in `columns'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activerecord-3.0.3/lib/active_record/base.rb:679:in `columns'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activerecord-3.0.3/lib/active_record/base.rb:692:in `column_names'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activerecord-3.0.3/lib/active_record/relation.rb:367:in `block in method_missing'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activerecord-3.0.3/lib/active_record/relation.rb:122:in `scoping'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activerecord-3.0.3/lib/active_record/relation.rb:367:in `method_missing'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rd_searchlogic-3.0.1/lib/searchlogic/named_scopes/conditions.rb:92:in `condition_details'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rd_searchlogic-3.0.1/lib/searchlogic/named_scopes/conditions.rb:68:in `local_condition?'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rd_searchlogic-3.0.1/lib/searchlogic/named_scopes/conditions.rb:61:in `condition?'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rd_searchlogic-3.0.1/lib/searchlogic/named_scopes/association_conditions.rb:6:in `condition?'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rd_searchlogic-3.0.1/lib/searchlogic/named_scopes/association_ordering.rb:14:in `condition?'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rd_searchlogic-3.0.1/lib/searchlogic/named_scopes/ordering.rb:11:in `condition?'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rd_searchlogic-3.0.1/lib/searchlogic/named_scopes/ordering.rb:31:in `order'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activerecord-3.0.3/lib/active_record/base.rb:441:in `order'
/Users/camillavk/Documents/Work/Saild/saild/app/models/comment.rb:13:in `<class:Comment>'
/Users/camillavk/Documents/Work/Saild/saild/app/models/comment.rb:1:in `<top (required)>'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:454:in `load'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:454:in `block in load_file'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:453:in `load_file'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:340:in `require_or_load'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:491:in `load_missing_constant'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:183:in `block in const_missing'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:181:in `each'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:181:in `const_missing'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:212:in `const_missing_from_s3_library'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:124:in `block in constantize'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:123:in `each'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:123:in `constantize'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/core_ext/string/inflections.rb:43:in `constantize'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activemodel-3.0.3/lib/active_model/observing.rb:182:in `observed_class'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activemodel-3.0.3/lib/active_model/observing.rb:175:in `observed_classes'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activemodel-3.0.3/lib/active_model/observing.rb:195:in `observed_classes'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activemodel-3.0.3/lib/active_model/observing.rb:191:in `initialize'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activerecord-3.0.3/lib/active_record/observer.rb:96:in `initialize'
/Users/camillavk/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/singleton.rb:141:in `new'
/Users/camillavk/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/singleton.rb:141:in `block in instance'
<internal:prelude>:10:in `synchronize'
/Users/camillavk/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/singleton.rb:139:in `instance'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activemodel-3.0.3/lib/active_model/observing.rb:66:in `instantiate_observer'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activemodel-3.0.3/lib/active_model/observing.rb:39:in `block in instantiate_observers'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activemodel-3.0.3/lib/active_model/observing.rb:39:in `each'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activemodel-3.0.3/lib/active_model/observing.rb:39:in `instantiate_observers'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activerecord-3.0.3/lib/active_record/railtie.rb:83:in `block (2 levels) in <class:Railtie>'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:26:in `on_load'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activerecord-3.0.3/lib/active_record/railtie.rb:82:in `block in <class:Railtie>'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:34:in `call'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:42:in `each'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/railties-3.0.3/lib/rails/application/finisher.rb:46:in `block in <module:Finisher>'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `block in run_initializers'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
/Users/camillavk/Documents/Work/Saild/saild/config/environment.rb:7:in `<top (required)>'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `block in require'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/railties-3.0.3/lib/rails/application.rb:103:in `require_environment!'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/railties-3.0.3/lib/rails/application.rb:216:in `block in initialize_tasks'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/Users/camillavk/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:607:in `block in invoke_prerequisites'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:596:in `block in invoke_with_call_chain'
/Users/camillavk/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/airbrake-4.1.0/lib/airbrake/rake_handler.rb:43:in `standard_exception_handling'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/bin/rake:23:in `load'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/bin/rake:23:in `<main>'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/bin/ruby_executable_hooks:15:in `eval'
/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/bin/ruby_executable_hooks:15:in `<main>'
如果我从评论模型中完全删除该行,则运行bundle exec rake db:schema:load
时的错误只是:
rake aborted!
Stack level too deep
有什么想法吗?
第二次修改
当我运行bundle exec db:create
时,它运行正常,并说数据库已经存在。
当我尝试创建表格时,它正在崩溃......
答案 0 :(得分:0)
如果在尝试升级到Rails 3时遇到其他任何人遇到此问题,我设法通过删除名为“bj”的gem来修复它。即使你没有这个特定的宝石,我也会建议你浏览每一颗宝石,确保它们仍然支持Rails 3 ......