1

我生成了一个基本的脚手架导轨应用程序(按照此处的说明生成)

该应用程序在本地 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
4

2 回答 2

1

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

vmc push my_project --runtime=ruby19
于 2012-08-22T07:13:32.607 回答
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

希望这可以帮助 :)

于 2012-09-08T17:09:28.080 回答