将基本rails应用程序部署到cloudfoundry时出错

时间:2012-08-22 03:44:54

标签: ruby-on-rails cloudfoundry

我生成了一个基本的脚手架rails应用程序(生成为instructed here

在本地webrick服务器上运行时,应用程序运行正常。但是,当它部署到(公共)cloudfoundry时,我收到如下错误。

我正在使用ruby 1.9.3p194(2012-04-20修订版35410)[x86_64-linux]和Rails 3.2.8。想法?

...

No RabbitMQ service bound to app.  Skipping auto-reconfiguration.
rake aborted!
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end
...sion_store :cookie_store, key: '_blog_session'
                              ^
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/engine.rb:588
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/engine.rb:587:in `each'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/engine.rb:587
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `run_initializers'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `send'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/config/environment.rb:5
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/application.rb:103:in `require'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/application.rb:103:in `require_environment!'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/railties-3.2.8/lib/rails/application.rb:295:in `initialize_tasks'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/var/vcap/data/packages/dea_ruby18/7.1/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `invoke_prerequisites'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/var/vcap/data/packages/dea_ruby18/7.1/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/var/vcap/data/dea/apps/myblog-0-0f9f91b4af44340115aeb6e5df89e4a9/app/rubygems/ruby/1.8/gems/rake-0.9.2.2/bin/rake:33
./rubygems/ruby/1.8/bin/rake:23:in `load'
./rubygems/ruby/1.8/bin/rake:23

2 个答案:

答案 0 :(得分:1)

当您推送以确保Cloud Foundry使用1.9而不是1.8时,您是否包含了--runtime = ruby​​19标志?

vmc push my_project --runtime=ruby19

答案 1 :(得分:0)

将Windows上捆绑的ruby应用程序部署到CloudFoundry.com(基于Linux)存在问题。解决方法是修改Gemfile.lock并删除字符串-x86-mingw32的出现位置。然后将应用程序重新推送到Cloud Foundry。

$ bundle package

$ bundle install

$ bundle exec rake assets:precompile

$ vmc push my_project --runtime=ruby19  or $ vmc update my_project --runtime=ruby19

希望这会有所帮助:)