0

我想在Heroku的Rails應用程序中運行脫軌的gem,因爲我得到了r14內存問題。錯誤已經初始化爲常量Activerecord :: base :: OrmAdapter

我有一個使用彪馬作爲我的服務器運行只有1測功機的愛好帳戶。

我遇到的問題是,當我嘗試運行任何脫軌的寶石脫軌perf執行方法。我得到這個問題

Booting: production 
/Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/orm_adapter-0.5.0/lib/orm_adapter/adapters/active_record.rb:81: warning: already initialized constant ActiveRecord::Base::OrmAdapter 
/Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/orm_adapter-0.5.0/lib/orm_adapter/adapters/active_record.rb:81: warning: previous definition of OrmAdapter was here 
/Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/orm_adapter-0.5.0/lib/orm_adapter/adapters/active_record.rb:81: warning: already initialized constant ActiveRecord::Base::OrmAdapter 
/Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/orm_adapter-0.5.0/lib/orm_adapter/adapters/active_record.rb:81: warning: previous definition of OrmAdapter was here 
/Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/connection_specification.rb:171:in `spec': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified) 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_handling.rb:50:in `establish_connection' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/railtie.rb:120:in `block (2 levels) in <class:Railtie>' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:44:in `each' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/base.rb:316:in `<module:ActiveRecord>' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/base.rb:26:in `<top (required)>' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.5.2/lib/devise/orm/active_record.rb:3:in `<top (required)>' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require' 
    from /Users/yihuazhang/Projects/learnabli/formula/config/initializers/devise.rb:24:in `block in <top (required)>' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/devise-3.5.2/lib/devise.rb:278:in `setup' 
    from /Users/yihuazhang/Projects/learnabli/formula/config/initializers/devise.rb:3:in `<top (required)>' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:420:in `block (2 levels) in each_strongly_connected_component_from' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:419:in `block in each_strongly_connected_component_from' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:413:in `call' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:413:in `each_strongly_connected_component_from' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/derailed_benchmarks-1.3.0/lib/derailed_benchmarks/tasks.rb:26:in `block (2 levels) in <top (required)>' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in `call' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in `each' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in `execute' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:165:in `invoke' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/derailed_benchmarks-1.3.0/lib/derailed_benchmarks/tasks.rb:60:in `block (2 levels) in <top (required)>' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in `call' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in `each' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in `execute' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:201:in `block in invoke_prerequisites' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:199:in `each' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:199:in `invoke_prerequisites' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:178:in `block in invoke_with_call_chain' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task.rb:165:in `invoke' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/derailed_benchmarks-1.3.0/bin/derailed:41:in `exec' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/derailed_benchmarks-1.3.0/bin/derailed:92:in `<top (required)>' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/bin/derailed:23:in `load' 
    from /Users/yihuazhang/.rbenv/versions/2.2.2/bin/derailed:23:in `<main>' 

但我真的不知道該怎麼做的問題。

+0

歡迎來到Stack Overflow。請閱讀「[問]」,包括底部的鏈接。我們需要您爲可讀性設置問題的格式,因爲您的工作可以幫助我們幫助您。 –

回答

1

在您的rails根目錄下運行rake rails:update並重新啓動您的服務器。

0

未在連接上指定適配器(或配置文件config/database.yml未命中適配器字段)時引發。

相關問題