rails and clound foundry

adama:code (master) robertjenkins$ vmc push
Would you like to deploy from the current directory? [Yn]: y
Application Name: grid_site
Application Deployed URL [grid_site.cloudfoundry.com]:
Detected a Rails Application, is this correct? [Yn]: y
Memory Reservation (64M, 128M, 256M, 512M, 1G) [256M]:
Creating Application: OK
Would you like to bind any services to 'grid_site'? [yN]: n
Uploading Application:
Checking for available resources: OK
Processing resources: OK
Packing application: OK
Uploading (38K): OK
Push Status: OK
Staging Application: ..Error 310: Staging failed: 'Staging plugin failed staging application:
ERROR: Error installing /var/vcap/data/stager/tmp/d20120319-6886-v05n7b/therubyracer-0.9.9.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
/var/vcap/data/packages/dea_ruby18/6.1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- libv8 (LoadError)
from /var/vcap/data/packages/dea_ruby18/6.1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from extconf.rb:7


Gem files will remain installed in /var/vcap/data/stager/tmp/d20120319-6886-v05n7b/gem_install_dir/gems/therubyracer-0.9.9 for inspection.
Results logged to /var/vcap/data/stager/tmp/d20120319-6886-v05n7b/gem_install_dir/gems/therubyracer-0.9.9/ext/v8/gem_make.out
/var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.44/lib/vcap/staging/plugin/gemfile_task.rb:103:in `block in install_gems': Failed installing therubyracer-0.9.9.gem (RuntimeError)
from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.44/lib/vcap/staging/plugin/gemfile_task.rb:91:in `each'
from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.44/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.44/lib/vcap/staging/plugin/gemfile_task.rb:47:in `install'
from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/ge
 
ms/vcap_staging-0.1.44/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.44/lib/vcap/staging/plugin/rails3/plugin.rb:54:in `block in stage_application'
from /var/vcap/packages/stager/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.44/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.44/lib/vcap/staging/plugin/rails3/plugin.rb:50:in `stage_application'

from /var/vcap/packages/stager/stager/bin/run_plugin:19:in `<main>'



这种错误是因为js,  一般使用了saas 、less 就会出现这样问题,网上说用了v8,需要编译下,但是不知道行不行,如果你不用,你就不引用就绝没问题


然后需要额外加入几个gem

gem 'thin'
gem 'bundler'
gem 'rake'


然后修改文件

Edit config/environments/production.rb and change

config.serve_static_assets = false

to

config.serve_static_assets = true

然后安装gem
  记得把gem 安装到项目中 
gem update
gem install --path vendor/plugins
gem package


然后vmc  push , clound foundry会自动创建数据库,创建表,连接数据库,启动服务



然后如何操作数据库,vmc 会自动配置database.yml    如果需要查看数据库  可以看 http://blog.cloudfoundry.com/post/12928974099/now-you-can-tunnel-into-any-cloud-foundry-data-service


部署借鉴:http://support.cloudfoundry.com/entries/20757913-getting-a-rails-3-1-1-production-environment-working


评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值