部署 cloudfoundry 上部署 rails3.2 应用报错?需要 python

cdredfox · 2012年04月20日 · 最后由 aabbcc456aa 回复于 2012年05月17日 · 4978 次阅读

cloudfoundry 上部署 rails3.2 应用报错?需要 python. 可是在 cloudfoundry 怎么安装 python 呢?

错误信息如下: Staging Application 'zhekoujie': ........Error 310: Staging failed: 'Staging plugin failed staging application: ERROR: Error installing /var/vcap/data/stager/tmp/d20120420-3834-kaxz1z/libv8-3.3.10.4.gem: ERROR: Failed to build gem native extension.

/var/vcap/data/packages/dea_ruby18/6.1/bin/ruby extconf.rb *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/var/vcap/data/packages/dea_ruby18/6.1/bin/ruby extconf.rb:13: uninitialized constant Gem (NameError) Checking for Python...

Gem files will remain installed in /var/vcap/data/stager/tmp/d20120420-3834-kaxz1z/gem_install_dir/gems/libv8-3.3.10.4 for inspection. Results logged to /var/vcap/data/stager/tmp/d20120420-3834-kaxz1z/gem_install_dir/gems/libv8-3.3.10.4/ext/libv8/gem_make.out /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/gemfile_task.rb:143:in block (2 levels) in install_gems': Failed installing libv8-3.3.10.4.gem (RuntimeError) from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/gemfile_task.rb:137:ineach' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/gemfile_task.rb:137:in block in install_gems' from /var/vcap/data/packages/ruby/5.1/lib/ruby/1.9.1/tmpdir.rb:83:inmktmpdir' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/gemfile_task.rb:131:in install_gems' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/gemfile_task.rb:47:ininstall' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/gemfile_support.rb:35:in compile_gems' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/rails3/plugin.rb:54:inblock in stage_application' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/rails3/plugin.rb:50:in chdir' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/rails3/plugin.rb:50:instage_application' from /var/vcap/packages/stager/stager/bin/run_plugin:19:in `

'

CF 总会出现些古怪的问题,话说不但 gem 部署有问题,部署好了使用也有问题 bundle package 一下 然后重新 vmc push app --runtime ruby19 试下

我尝试了一下,现在换了一个错,

看样子好象不能安装 libv8

Error 310: Staging failed: 'Staging plugin failed staging application: ERROR: Error installing /var/vcap/data/stager/tmp/d20120420-7994-pcajnf/therubyracer-0.10.1.gem: ERROR: Failed to build gem native extension.

/var/vcap/data/packages/dea_ruby19/5.1/bin/ruby extconf.rb *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/var/vcap/data/packages/dea_ruby19/5.1/bin/ruby /var/vcap/data/packages/dea_ruby19/5.1/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': no such file to load -- libv8 (LoadError) from /var/vcap/data/packages/dea_ruby19/5.1/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from extconf.rb:7:in rescue in <main>' from extconf.rb:3:in

'

Gem files will remain installed in /var/vcap/data/stager/tmp/d20120420-7994-pcajnf/gem_install_dir/gems/therubyracer-0.10.1 for inspection. Results logged to /var/vcap/data/stager/tmp/d20120420-7994-pcajnf/gem_install_dir/gems/therubyracer-0.10.1/ext/v8/gem_make.out /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/gemfile_task.rb:103:in block in install_gems': Failed installing therubyracer-0.10.1.gem (RuntimeError) from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/gemfile_task.rb:91:ineach' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/gemfile_task.rb:91:in install_gems' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/gemfile_task.rb:47:ininstall' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/gemfile_support.rb:35:in compile_gems' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/rails3/plugin.rb:54:inblock in stage_application' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/rails3/plugin.rb:50:in chdir' from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.50/lib/vcap/staging/plugin/rails3/plugin.rb:50:instage_application' from /var/vcap/packages/stager/stager/bin/run_plugin:19:in `

' '

这个问题好像碰到过,试下 gem 'cloudfoundry-jquery-rails' gem 'cloudfoundry-devise', :require => 'devise' gem 'json' gem 'thin'

http://support.cloudfoundry.com/entries/21145381-getting-error-310-staging-failed-staging-plugin-failed-staging-application-with-rails-app


router              :    RUNNING
cloud_controller    :    RUNNING
dea                 :    RUNNING
health_manager      :    RUNNING
stager              :    RUNNING
redis_gateway       :    RUNNING
redis_node          :    RUNNING
mysql_gateway       :    RUNNING
mysql_node          :    RUNNING
mongodb_gateway     :    RUNNING
mongodb_node        :    RUNNING
neo4j_gateway       :    RUNNING
neo4j_node          :    RUNNING



cloud_controller 和你的项目是用 thin 跑的

我在 gem 中加了这三个,貌似启动的时候还是报同样的错?看起来是 therubyracer-0.10.1.gem 这个安装的时候依赖 libv8,而 libv8 没有安装? 我没有显示的 gem libv8 的?

可以去掉 therubyrace 试下,你看 vendor/cache 里有没有 libv8,你可以先尝试跑一个空的 rails 应用试试,可以 gtalk 我,[email protected]

cloudfoundry 就不支持 libv8

需要 登录 后方可回复, 如果你还没有账号请 注册新账号