使用“budle install”构建 PostgreSQL gem 时出错 [Ubuntu 10.04,Ruby EE]

发布于 2024-10-17 05:43:30 字数 3137 浏览 2 评论 0原文

我在 Ubuntu 10.04 上安装了 Ruby Enterprise Edition 作为默认的 Ruby 解释器:

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

如果我 sudo gem install pg,则 gem 安装成功。

但是在我的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 

I've Ruby Enterprise Edition installed on Ubuntu 10.04 as the default Ruby interpreter:

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

If I sudo gem install pg, the gem is installed successfully.

But withing my Rails app, bundle install hangs up like that:

[...]
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

The contents of /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 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七度光 2024-10-24 05:43:30

这是 OpenVZ VPS 内存不足的问题。

只有 256 MB 的 RAM,并且 OpenVZ 不为您提供交换空间。于是剧本就挂了。

It was a lack-of-memory issue with an OpenVZ VPS.

There was only 256 MB of RAM and OpenVZ doesn't provide you with swap space. So the script hang up.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文