1

基本的な scaffold rails アプリケーションを生成しました (こちらの指示に従って生成)

アプリケーションは、ローカルの 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.8 ではなく 1.9 を使用していることを確認するためにプッシュするときに --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 に答える