捆绑安装莫名其妙地挂起

时间:2015-07-09 20:23:46

标签: ruby linux rubygems bundler rhel6

我在RHEL 6上,从源代码构建了Ruby并安装到/usr/local

我所在的服务器没有外部互联网访问权限,除了访问Rubygems.org。这是唯一允许进行的外部连接。这是一个企业安全限制,我无能为力,所以请不要说'使用rvm'。如果可以的话我会...

我需要以特定用户ciwasadm运行捆绑安装。但是当我这样做时,终端就会挂起。当我以bundle installgem install whatever作为我的用户名wannia1时,我可以连接到Rubygems.org并获得我需要的wahtever。

出于某种原因,悬挂只发生在我进入ciwasadm时。两个用户的Ruby安装都在工作,我可以在命令行中运行ruby文件。我只是不明白为什么捆绑包有任何不同。

gem env运行ciwasadm会返回:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.8
  - RUBY VERSION: 2.0.0 (2015-04-13 patchlevel 645) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.0.0
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /home/ciwasadm/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/2.0.0
     - /home/ciwasadm/.gem/ruby/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/bin
     - /sbin
     - /bin
     - /usr/sbin
     - /usr/bin
     - /opt/groovy-1.8.3/bin

gem env运行wannia会返回:

 RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.8
  - RUBY VERSION: 2.0.0 (2015-04-13 patchlevel 645) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.0.0
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /home/wannia1/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/2.0.0
     - /home/wannia1/.gem/ruby/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/bin
     - /usr/lib64/qt-3.3/bin
     - /usr/local/bin
     - /bin
     - /usr/bin
     - /usr/local/sbin
     - /usr/sbin
     - /sbin
     - /opt/groovy-1.8.3/bin
     - /home/wannia1/bin

1 个答案:

答案 0 :(得分:2)

我会在这里发布我的解决方案,希望将来可以帮助其他人。

Bundler因为无法访问rubygems.org服务器而挂起。这是因为需要代理,但尚未设置。

我能够在我的bash shell中运行export http_proxy=<insert proxy info here>,然后就可以拨出了。