2011-02-15 40 views
0

我在Ubuntu 10.04安装Ruby企业版作为默认的Ruby解释:错误建筑PostgreSQL的宝石与`budle install` [Ubuntu的10.04,红宝石EE]

ruby 1.8.7 (2010-12-23 patchlevel 330) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2011.01 

如果我sudo gem install pg,创业板安装成功。

但withing我的Rails应用程序,bundle install挂断这样的:

[...] 
Using net-sftp (2.0.5) 
Using net-ssh-gateway (1.0.1) 
Using capistrano (2.5.19) 
Installing pg (0.10.1) with native extensions /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/site_ruby/1.8/rubygems/installer.rb:529:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) 

     /opt/ruby-enterprise-1.8.7-2011.01/bin/ruby extconf.rb 

Gem files will remain installed in /home/selhozka/rails/vendor/gems/ruby/1.8/gems/pg-0.10.1 for inspection. 
Results logged to /home/selhozka/rails/vendor/gems/ruby/1.8/gems/pg-0.10.1/ext/gem_make.out 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/site_ruby/1.8/rubygems/installer.rb:482:in `each' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/site_ruby/1.8/rubygems/installer.rb:482:in `build_extensions' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/site_ruby/1.8/rubygems/installer.rb:156:in `install' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/source.rb:96:in `install' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:55:in `run' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:44:in `run' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/cli.rb:226:in `install' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `send' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `run' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in `dispatch' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in `start' 
    from /opt/ruby-enterprise-1.8.7-2011.01/lib/ruby/gems/1.8/gems/bundler-1.0.10/bin/bundle:13 
    from /opt/ruby-enterprise-1.8.7-2011.01/bin/bundle:19:in `load' 
    from /opt/ruby-enterprise-1.8.7-2011.01/bin/bundle:19 

/home/selhozka/rails/vendor/gems/ruby/1.8/gems/pg-0.10.1/ext/gem_make.out内容:

/opt/ruby-enterprise-1.8.7-2011.01/bin/ruby extconf.rb 

回答

1

这是内存缺乏对的一问题与OpenVZ的VPS。

只有256 MB的RAM,OpenVZ不提供交换空间。所以剧本挂断了。

+0

感谢您的发现,我永远不会在这个方向上搜索... Bundler真的是贪婪的内存:( – severin 2011-03-17 16:38:19