Fix ruby gems path issues in debian
I've be banging my head against the wall trying to fix a ruby gems path
without success. Here is my problem. In my production server running
Debian GNU/Linux 6.0.6 (squeeze) I have both ruby1.8.7, ruby1.9.1 and
jruby installed. For some reasons gem install uses jruby gems directory
and not ruby gems directory which means I can not run ruby programs that
depends on installed ruby gems. I've tried to export the ruby gem PATH
using
export PATH=/var/lib/gems/1.8/bin:$PATH
but nothing changed.
Here is my .bashrc file
# ~/.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
Environment
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
I've been struggling to change that but with no luck. How do I change gem
path on Debian?
No comments:
Post a Comment