Trying to install and use ruby 1.9.2 on my server. Running Ubuntu 11.10.
$ rvm use 1.9.2
Using /usr/share/ruby-rvm/gems/ruby-1.9.2-p180
$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
Wait...what?
Below are the steps for a fresh installation if you need it at any time:
bash -sk stable < <(curl -sk https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
source ~/.bash_profile
source /etc/profile.d/rvm.sh
rvm requirements #Lets you know the system dependencies and if you need to install any other libraries
rvm install 1.9.2-p290
rvm use 1.9.2 --default
rvm gemset create demo
rvm demo#1.9.2
then install rails
gem install rails -v=3.0.4
If at any time u mess up your rvm you can remove it using rvm implode or rm -rf ~/.rvm
You are using buggy version of RVM, use this instructions to install proper version: https://stackoverflow.com/a/9056395/497756
Related
Mohameds-MacBook-Pro-2:~ mmahalwy$ rvm list
rvm rubies
=* ruby-2.1.1 [ missing bin/ruby ]
# => - current
# =* - current && default
# * - default
Mohameds-MacBook-Pro-2:~ mmahalwy$ ruby -v
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
I need to get the system to use the RVM ruby and not the preinstalled ruby that ships with Mavericks.
I do have the [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" at end of .bashrc file
I also get this error when i start a new terminal session:
bash: /etc/profile.d/rvm.sh: No such file or directory
You have not mentioned what you have tried so far. The following commands typically works for me after install RVM.
Assuming you have installed rvm using this
curl -sSL https://get.rvm.io | bash -s stable
Then you just have to install ruby and mark it as default ruby for your system.
rvm install 2.1.1
rvm use 2.1.1 --default
I have a Mac and I have done this many times and yet to face an issue.
I have a problem installing gems for tracks. I performed the following steps:
Installation of rvm:
bash < <(curl -sk https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
source ~/.bashrc
Installation of ruby:
rvm install ruby-1.8.7
rvm use ruby-1.8.7 --default
ruby -v
Last command responds:
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
Git clone of tracks:
git clone https://github.com/TracksApp/tracks.git
cd tracks
nano backup.rails2.3/Gemfile.rails2.3
Changes made in this flie:
- comment out gem "sqlite3"
- change gem "ZenTest", "=4.6.0"
After this i performed bundle install which exits with the following error:
Gem::InstallError: factory_girl requires Ruby version >= 1.9.2.
An error occured while installing factory_girl (3.3.0), and Bundler cannot continue.
Make sure that `gem install factory_girl -v '3.3.0'` succeeds before bundling.
Tracks does not support ruby 1.9.x so version upgrade is not possible. How can I fix above mentioned problem?
You have cloned deveopment version which seams be getting ready for Ruby 1.9:
https://github.com/TracksApp/tracks/blob/master/Gemfile#L51
Either use it with ruby 1.9 or use older version:
https://github.com/TracksApp/tracks/tags
I am on Linux Mint 12.
I installed RVM and ran these commands:
rvm 1.9.2
rvm --default use 1.9.2
but ruby -v still outputs ruby 1.8.7.
sudo apt-get install ruby1.9.2 returns saying 1.9.1 is the latest version.
How do I get Ruby to be running on 1.9.2?
When I run rvm list like suggested at "Ruby 1.9.2 keeps reverting back to 1.8.7 after installing it using RVM", it outputs:
rvm rubies
ruby-1.8.7-p352 [ x86_64 ]
=> ruby-1.9.2-p290 [ x86_64 ]
So I think I must have a configuration issue. My OS seems to be defaulting to the wrong version of Ruby.
I ran:
sudo apt-get remove ruby
But had no change.
You add string [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" into ~/.bashrc? First, show your echo $PATH output. If this looks like (rvm paths before system paths):
/home/ayunin/.rvm/gems/ruby-1.9.3-rc1/bin:/usr/bin:/bin:/usr/bin/X11
Then you ran into the magick. Restart your terminal, and show ruby version. If does not work - you can launch rvm implode and reinstall all, yes.
It looks like Linux Mint 12 has ruby-rvm already installed (at least on my machine) so could this be a problem?
you can stick with that but then I think you will need to add your username to the rvm group with usermod -a -G username rvm.
I removed removed ruby-rvm completely (with apt-get) and then followed the installation instructions from https://rvm.beginrescueend.com/rvm/install/ for 'single user' thus all my rvm files are located in ~/.rvm/bin/rvm
I added the line for rvm in my .bashrc and tested with 1type rvm | head -1`.
After that rvm install 1.9.2 just worked and I installed it into ~/.rvm/rubies/ruby-1.9.2
After that rvm use --default 1.9.2 set all up correctly.
I have recently installed RVM on a fresh install of Ubuntu 11.10 and can not work out how to start using a particular ruby version.
I have installed Ruby 1.8.7 and 1.9.2, and they show up in the list fine:
$ rvm list
rvm rubies
ruby-1.8.7-p352 [ i386 ]
ruby-1.9.2-p290 [ i386 ]
When I try to use the "use" command, everything seems fine:
$ rvm use 1.9.2
Using /usr/share/ruby-rvm/gems/ruby-1.9.2-p290
Running /usr/share/ruby-rvm/hooks/after_use
But then when I test the current ruby version, I get the usual Ubuntu 11.10 message you get when you don't have RVM at all:
$ ruby -v
The program 'ruby' can be found in the following packages:
* ruby1.8
* ruby1.9.1
Try: sudo apt-get install <selected package>
What am I doing wrong? Did I miss out a step in the RVM installation or something?
EDIT*
Answers to some comments:
$ which ruby
#returns nothing at all.
$ which rvm
/usr/bin/rvm
$ rvm -v
rvm 1.6.9 by Wayne E. Seguin (wayneeseguin#gmail.com) [https://rvm.beginrescueend.com/]
$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
RVM 1.6.9 is very old now. Did you install it through some package manager? If so, get rid of it and run the following in your bash shell:
curl -L https://get.rvm.io | bash -s stable
Then, place [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" in ~/.profile OR ~/.bash_profile OR ~/.bashrc
You should then be able to run type rvm | head -n 1 and it should say "rvm is a function".
Then you should be able to install rubies and use one of them. Be sure to use --default for that Ruby to remain the default even after you end your terminal session. E.g. rvm use ruby-1.9.2-p290 --default
Have you added the following line to your .bash_profile,
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
as the installation page for rvm says?
Like tass suggested you obviously have a different rvm directory then $HOME/.rvm so
[[ -s "/usr/share/ruby-rvm/scripts/rvm" ]] && . "/usr/share/ruby-rvm/scripts/rvm"
is probably what you would to use instead
I know this thread is zombie-old, but in your terminal client's preferences, checking 'run command as login shell' solved it for me. RVM generally puts that line in your ~/.bash_profile for you.
I have a Mac Os running Snow Leopard 10.6.5 and I am trying to upgrade my Ruby installation.
Before I did anything, I run the following commands and I had the following results:
$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
$ which ruby
/usr/bin/ruby
So, to upgrade my installation, I installed first macports and then Ruby using Ruby Version Manager (RVM).
1. bash < <(curl http://rvm.beginrescueend.com/releases/rvm-install-head)
2. mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone --depth 1 git://github.com/wayneeseguin/rvm.git && cd rvm && ./install
3. rvm install 1.9.2
4. rvm 1.9.2 --default
After that, I run the following commands and I had the following results:
$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
$ which ruby
/usr/bin/ruby
$ rvm list
=> ruby-1.9.2-p136 [ x86_64 ]
Why Ruby is still at 1.8.7? What is wrong? Or, what I forgot?
SOLVED:
Edit the '.profile' file in home directory:
Add the line at the bottom:
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
and then in the Terminal run
source ~/.profile
to set the changes.
Did you follow the "Post Install" instructions in the RVM installation page and add the following line to one of your ~/.bashrc, ~/.bash_profile or ~/.profile files?
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
That's really important to get RVM working correctly.