我一直在用头撞墙,试图修复红宝石路径但没有成功。这是我的问题。在我运行的生产服务器中,Debian GNU/Linux 6.0.6 (squeeze)
我安装了 ruby1.8.7、ruby1.9.1 和 jruby。由于某些原因 gem install 使用 jruby gems 目录而不是 ruby gems 目录,这意味着我无法运行依赖于已安装 ruby gems 的 ruby 程序。我尝试使用导出 ruby gem PATH
export PATH=/var/lib/gems/1.8/bin:$PATH
但没有任何改变。
这是我的.bashrc
文件
# ~/.bashrc: executed by bash(1) for non-login shells.
export PS1='\h:\w\$ '
umask 022
# You may uncomment the following lines if you want `ls' to be colorized:
# export LS_OPTIONS='--color=auto'
# eval "`dircolors`"
# alias ls='ls $LS_OPTIONS'
# alias ll='ls $LS_OPTIONS -l'
# alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'
JAVA_HOME=/usr/bin/jdk1.6.0_21/
PATH="/usr/bin/jdk1.6.0_21/bin:$PATH"
PATH="$PATH:/opt/jruby/bin/"
export PATH
export GEM_PATH=/usr/lib/ruby/gems/1.8
环境
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.6 (squeeze)
Release: 6.0.6
Codename: squeeze
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.16
- RUBY VERSION: 1.8.7 (2011-12-27 patchlevel 330) [java]
- INSTALLATION DIRECTORY: /opt/jruby/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /opt/jruby/bin/jruby
- EXECUTABLE DIRECTORY: /opt/jruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.6
- GEM PATHS:
- /opt/jruby/lib/ruby/gems/1.8
- /usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri --env-shebang"
- "update" => "--no-rdoc --no-ri --env-shebang"
- REMOTE SOURCES:
- http://rubygems.org/
which ruby
/usr/bin/ruby
which gem
/opt/jruby/bin//gem
这是我在运行 ruby 文件时遇到的错误
usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- net/https (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
我一直在努力改变这一点,但没有运气。如何更改 Debian 上的 gem 路径?