Skip to content

Commit

Permalink
Use the RUBY_ENGINE constant instead of the name of the ruby.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Aug 17, 2012
1 parent 0cb7104 commit 262a9f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions etc/profile.d/chruby.sh
Expand Up @@ -22,15 +22,15 @@ function chruby_use()
export PATH="$1/bin:$PATH"
export RUBYOPT="$2"
local versions=( `ruby -e "require 'rbconfig'; puts RUBY_VERSION; puts RbConfig::CONFIG['ruby_version']"` )
local ruby_version=( `ruby -e "require 'rbconfig'; puts defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'; puts RUBY_VERSION; puts RbConfig::CONFIG['ruby_version']"` )
export RUBY_PATH="$1"
export RUBY_ENGINE=`echo $name | cut -f1 -d-`
export RUBY_VERSION=${versions[0]}
export RUBY_ENGINE=${ruby_version[0]}
export RUBY_VERSION=${ruby_version[1]}
if [[ ! $UID -eq 0 ]]; then
export GEM_HOME="$HOME/.gem/$RUBY_ENGINE/$RUBY_VERSION"
export GEM_PATH="$RUBY_PATH/lib/ruby/gems/${versions[1]}"
export GEM_PATH="$RUBY_PATH/lib/ruby/gems/${ruby_version[2]}"
export PATH="$GEM_HOME/bin:$GEM_PATH/bin:$PATH"
export GEM_PATH="$GEM_HOME:$GEM_PATH"
Expand Down

0 comments on commit 262a9f1

Please sign in to comment.