rails and clound foundry

原创 2012年03月27日 10:24:11

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


Ruby on Rails 3.1 Released, Brings Assets Pipeline, Streaming, and Javascript Changes

http://www.infoq.com/news/2011/09/rails-31 A few days ago, the Ruby on Rails team released versio...
  • omg2012
  • omg2012
  • 2011年09月05日 11:41
  • 284

rails中的Preload, Eagerload, Includes and Joins

rails提供四种不同的方法来加载关联数据。这篇博客中我们来一一介绍他们。 1,Preload,2,includes,3,eager_load 4,joins...

guides.rubyonrails.org 读书笔记(十): Layouts and Rendering in Rails

 Layouts and Rendering in Rails  1 Overview: How the Pieces Fit Together主要在控制器实现这些功能  2 Creating Res...
  • linhx
  • linhx
  • 2011年06月06日 20:01
  • 822

Rails学习 note and

学习页面的 原地址: http://guides.rubyonrails.org/getting_started.html 中文翻译页面:  http://guides.ruby-china.org...

Allow Users to Authenticate With Username Only Using Devise, ActiveAdmin, Rails 4 and Ruby 2

转自:http://alexvpopov.github.io/blog/2013/10/31/allow-users-to-authenticate-with-username-only-using-...

Rails学习 note and mark.

* 之前的相当一段时间里, 我在看ruby有关的资料.  今天尝试开始阅读rails的东西. 为了防止浅尝辄止, 特在这里先标个mark.  --  以儆效尤 : ) --  * 别当真  有些东...

rails layout and rendering

Using render  You can render the default view for a Rails template, or a specific template, or ...
  • lht1936
  • lht1936
  • 2011年08月04日 13:57
  • 982

rails active record validation and callbacks

Active Record uses the new_record? instance method to determine whether an object is already in the ...
  • lht1936
  • lht1936
  • 2011年08月02日 17:08
  • 1412

Install Ruby 1.9.2 (from source) and Rails 3.0.1 on Ubuntu 10.10 & Debian6

原文:http://www.giantflyingsaucer.com/blog/?p=1883 本人在Debian6上实验安装成功 Install Ruby 1.9.2 (fro...

rails serialize and join table

serialize使用命令: $rails g migration add_tags_to_posts然后在新生成的xxx_add_tags_posts.rb 中添加: def change ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:rails and clound foundry
举报原因:
原因补充:

(最多只允许输入30个字)