2012-07-24 60 views
0

我目前正在開發一種在開發中工作得非常好的Padrino項目,但是在將它推到我的現場環境中後,我遇到了問題。經過日誌,我得到的錯誤是:MongoMapper,Padrino和乘客 - 連接失敗?

[31m ERROR[0m -[33m24/Jul/2012 11:32:53[0mMongo::ConnectionFailure - Operation failed with the following exception: #<Mongo::ConnectionFailure:0xa762528>: 

database.rb文件是一個標準的Padrino產生的,即:

MongoMapper.connection = Mongo::Connection.new('localhost', nil, :logger => logger) 

case Padrino.env 
    when :development then MongoMapper.database = 'licensing_development' 
    when :production then MongoMapper.database = 'licensing_production' 
    when :test  then MongoMapper.database = 'licensing_test' 
end 

一切完美的控制檯,所以我假設問題與Passenger有關。任何想法,我可能會出錯?

回答

0

好吧,不要理我。運行導入我的數據的耙子任務時以及啓動控制檯時,我忘記設置RACK_ENV,因此我的生產數據庫中沒有數據。