Why Doesn't 'User Installation Directory' Match with the Ruby Version

What is USER INSTALLATION DIRECTORY in rubyGems env

The User Installation Directory variable for RubyGems is the directory where gems will be installed when using the --user-install flag, which is a directory immediately within your home directory.

The User Installation Directory has always existed, but it was recently made more visible via pull 1343.

Ruby version from homebrew doesn't match computer version

Because your PATH link to your origin ruby, you should add your homebrew ruby path to your .bash_profile like this export PATH=${PATH}:${HOMEBREW_HOME}/ruby

The better way that I recommend is using the rvm https://rvm.io/rvm/install

Follow the step to install rvm/ruby

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

\curl -sSL https://get.rvm.io | bash

then copy and execute the shell in bash

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc

restart the bash and type which ruby, then it return $HOME/.rvm/rubies/ruby-2.3.3/bin/ruby and your ruby work.

Configure gem installation directory to match user installation directory

I ended up putting this atrocity in my init scripts:

if [ ! -z "`which gem`" ]; then
GEM_HOME=`prefix=" - USER INSTALLATION DIRECTORY: "; line=\`gem env | grep "^$prefix"\`; suffix=${line#$prefix}; echo $suffix`
fi;

Why do I get the error Your Ruby version is 2.0.0, but your Gemfile specified 2.2.2 although I have 2.2.2 installed

I finally solved my problem using this thread Bundler not working with rbenv, could not find [gem],

by using these commands after reinstalling rbenv:

  • gem install --no-ri --no-rdoc bundler
  • rbenv rehash
  • bundle --path=vendor/bundle

Rvm current and ruby-v not matching, $PATH errors?

This is due to rvm not being installed properly. Uninstall it and reinstall using the instructions here.

This question has a similar issue: Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v



Related Topics



Leave a reply



Submit