0

所以这是一个令人困惑的问题。我不确定我哪里出错了,但我在某个地方做了,鉴于这个问题,它似乎应该是一个简单的修复。

第一次,我的 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
4

1 回答 1

0

谢谢大家的建议。就我而言,吉姆·斯图尔特完全正确。在我的应用程序的 .env 文件中,我在“RACK_ENV=development”之后直接有一个空格——我一定是最近打开了那个文件并按下了空格键。我只是删除了多余的空间,现在一切正常。

于 2013-05-17T06:41:20.453 回答