Rails应用程序不断尝试连接到“development .rb”文件

时间:2013-05-16 23:52:23

标签: ruby-on-rails ruby-on-rails-3 development-environment

所以这是一个令人困惑的问题。我不知道我哪里出错了,但是我做了某个地方,并且考虑到问题,这似乎应该是一个简单的修复。

每次我在终端上启动时,我的Rails应用程序第一次崩溃。它崩溃是因为它试图连接到“development .rb” - 在单词的结尾和句点之间有一个空格。每次启动时,它都会创建一个名为“development .log”的文件。

我实际上没有“开发.rb”文件,因此我不确定它为什么要尝试连接它。

所以在我的代码中,我必须告诉它只连接到development.rb(没有空格)。有关如何做到这一点的任何想法?

19:44:43 web.1  | started with pid 28696
19:44:44 web.1  | I, [2013-05-16T19:44:44.514474 #28696]  INFO -- : Refreshing Gem list
19:44:47 web.1  | You did not specify how you would like Rails to report deprecation notices for your development  environment, please set config.active_support.deprecation to :log, :notify or :stderr at config/environments/development .rb
19:44:47 web.1  | /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:47:in `resolve_hash_connection': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:in `resolve_string_connection'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in `spec'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in `establish_connection'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/activerecord-3.2.13/lib/active_record/railtie.rb:82:in `block (2 levels) in <class:Railtie>'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in `each'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/activerecord-3.2.13/lib/active_record/railtie.rb:74:in `block in <class:Railtie>'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
19:44:47 web.1  |   from /Users/myname/RailsApps/bptest/config/environment.rb:5:in `<top (required)>'
19:44:47 web.1  |   from config.ru:4:in `require'
19:44:47 web.1  |   from config.ru:4:in `block in <main>'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
19:44:47 web.1  |   from config.ru:1:in `new'
19:44:47 web.1  |   from config.ru:1:in `<main>'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/unicorn-4.6.2/lib/unicorn.rb:44:in `eval'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/unicorn-4.6.2/lib/unicorn.rb:44:in `block in builder'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:722:in `call'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:722:in `build_app!'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:140:in `start'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/gems/unicorn-4.6.2/bin/unicorn:126:in `<top (required)>'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/bin/unicorn:23:in `load'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/bin/unicorn:23:in `<main>'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `eval'
19:44:47 web.1  |   from /Users/myname/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `<main>'
19:44:47 web.1  | exited with code 1
19:44:47 system | sending SIGTERM to all processes
SIGTERM received

1 个答案:

答案 0 :(得分:0)

感谢大家的建议。就我而言,吉姆斯图尔特完全正确。在我的应用程序的.env文件中,我在“RACK_ENV =开发”之后直接有一个空格 - 我必须打开该文件并在最近的某个时刻按空格键。我只是删除了额外的空间,现在一切都很完美。