我是新来的铁路。我想将一个简单的 Rails 应用程序推送到 cloudfoundry,但出现错误:
====> /logs/stderr.log <====
/var/vcap/data/dea/apps/mytestapp-0
-4a068e3fd2b22422bdd29f3762e9bc9b/app/rubygems/ruby/1.9.1/gems/mongo-
1.6.4/lib/mongo/connection.rb:420:in `connect': Fail:27017 (Mongo::ConnectionFailure)
示例应用程序 gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.5'
gem 'mongo_mapper'
gem 'bson_ext'
mongo.yml:
defaults: &defaults
host: 127.0.0.1
port: 27017
development:
<<: *defaults
database: cloud_foundry_rails_tutorial_development
test:
<<: *defaults
database: cloud_foundry_rails_tutorial_test
# set these environment variables on your prod server
production:
host: <%= JSON.parse( ENV['VCAP_SERVICES'] )['mongodb-2.0'].first['credentials']['hostname']
rescue 'localhost' %>
port: <%= JSON.parse( ENV['VCAP_SERVICES'] )['mongodb-2.0'].first['credentials']['port']
rescue '27017' %>
database: <%= JSON.parse( ENV['VCAP_SERVICES'] )['mongodb-2.0'].first['credentials']['db']
rescue 'cloud_foundry_rails_tutorial' %>
username: <%= JSON.parse( ENV['VCAP_SERVICES'] )['mongodb-2.0'].first['credentials']['username']
rescue '' %>
password: <%= JSON.parse( ENV['VCAP_SERVICES'] )['mongodb-2.0'].first['credentials']['password']
rescue '' %>
上周我可以毫无问题地推送到 CF,但现在它不起作用?CF方面有什么改变吗?谢谢