2011-01-14 55 views
0

我正在尋找部署我的第一個rails應用程序,並且遇到了一些問題。首先,開發服務器中的一切正常,所以我覺得我很好走。在將應用程序部署到我的主機失敗後,我嘗試第一次以生產模式啓動服務器,並收到了一些錯誤。Rails 3 - 移動到/啓動生產服務器 - 生產數據庫未配置?

出於好奇,我創建了一個新的應用程序,完全新鮮,沒有我編輯任何代碼。我得到幾乎與我的數據庫相同的錯誤:

/home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection': =production database is not configured (ActiveRecord::AdapterNotSpecified) 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/railtie.rb:59:in `block (2 levels) in <class:Railtie>' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:26:in `on_load' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/railtie.rb:57:in `block in <class:Railtie>' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `block in run_initializers' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing' 
from /home/sweiss/testapp/config/environment.rb:6:in `<top (required)>' 
from /home/sweiss/testapp/config.ru:3:in `require' 
from /home/sweiss/testapp/config.ru:3:in `block in <main>' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize' 
from /home/sweiss/testapp/config.ru:1:in `new' 
from /home/sweiss/testapp/config.ru:1:in `<main>' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/server.rb:162:in `app' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/server.rb:213:in `start' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands/server.rb:65:in `start' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:30:in `block in <top (required)>' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap' 
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:27:in `<top (required)>' 
from script/rails:6:in `require' 
from script/rails:6:in `<main>' 

有沒有人在嘗試啓動生產服務器時遇到此問題?該database.yml的,只是良好的措施,是sqlite3的下列默認:

production: 
    adapter: sqlite3 
    database: db/production.sqlite3 
    pool: 5 
    timeout: 5000 

我覈實.yml沒有標籤(不,它應該自動生成)。

無論如何,我很感激幫助。

回答

0

你安裝了sqlite3的寶石嗎?聽起來像它找不到適配器。

+0

我認爲我應該對sqlite3 gem很好:使用sqlite3-ruby(1.3.2) 並且也在gemfile中:gem'sqlite3-ruby',:require =>'sqlite3'它確實對某些事情有意義儘管如此。我也簡單地運行「軌道服務器」,同時構建應用程序,但即使軌道服務器-e =開發錯誤與相同的信息。 – Kombo 2011-01-14 21:02:33

相關問題