24

Can I install the Ruby Version Manager (RVM) on my Raspberry Pi?

wmarbut
  • 1,113
  • 1
  • 9
  • 16

2 Answers2

23

Yes!

First, you'll need to install curl, git, and build-essential for your operating system. If you don't know how to install software for your system please refer to How do I install new software?.

Next you need to download and run the bash script they provide.

$ curl -L https://get.rvm.io | bash -s stable --ruby

Next you can do one of two things.

  1. Close and reopen your terminal session, or
  2. Source the rvm script like so.

     $ source ~/.rvm/scripts/rvm
    

Now you can check if RVM is installed by running the following command.

$ type rvm | head -n 1
rvm is a function

If you get a response like the above one RVM has been loaded and you can install a specific Ruby version. It is recommended that you install the latest stable release; which is Ruby 1.9.3 as of July 11, 2012.

$ rvm install 1.9.3

Now the final the step is to tell RVM which version to use. In order to use a specific Ruby version for the duration of the current terminal session run the following.

$ rvm use 1.9.3

If you want to use that specific version every time you open a new terminal session though you are going to have to tell RVM to set it as the default Ruby. Like so.

$ rvm use --default 1.9.3

Congratulations, you have successfully installed RVM on your Raspberry Pi!

Note build-essential is Debian's group for gcc, g++, make etc. Arch includes a similar group called base-devel.

wmarbut
  • 1,113
  • 1
  • 9
  • 16
  • Is this any different from installing on any other Linux machine? – Jivings Jul 11 '12 at 21:03
  • @Jivings No, this works on all Linux machines. –  Jul 11 '12 at 22:23
  • 2
    In order to make this answer more Raspberry Pi specific, can you comment on the performance of Ruby on the Pi. Is this worth doing, or is it going to be unusably slow? – Mark Booth Jul 12 '12 at 10:54
  • 3
    The make activity on RVM was quite slow as was compiling a Ruby. Make probably took 15 minutes on initial rvm install. Compiling took about an hour. After RVM and a ruby are installed, it is quite snappy. – wmarbut Jul 12 '12 at 13:10
  • +1 for getting me one step closer to RoR for the RPi. I haven't made a lot of effort towards it, as I don't have too much time to play with my Pi, but this answered my biggest question. – Andrew Larsson Jul 18 '12 at 16:42
  • Rails "just works" on the Pi. It is a little slow (time rails takes 9s), but I've been using it for a little while now. – mlk Aug 09 '12 at 09:46
  • 2
    The correct package name is build-essential and not build-essentials. – gfelisberto Mar 22 '13 at 22:40
  • A bit late to the game, but you can append sudo to the commands – kobaltz Jan 06 '15 at 14:46
  • 3
    I got an errror while executing the first command, also had to run this to add gpg keys: *gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3* – Vini.g.fer Jun 03 '15 at 09:50
  • @Vini.g.fer That error almost definitely also gives you a suggestion on how to fix it. Just do what it says ;) – Alastair Brayne Oct 30 '15 at 16:53
1

if it helps anyone using this i found this command on rasbain lite was needed

curl -L https://get.rvm.io | bash
Jacobm001
  • 11,898
  • 7
  • 46
  • 56
Knapp
  • 11
  • 2