Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts

Tuesday, October 5, 2010

Installing RVM System Wide

Today I got introduced to one very nice solution developed by Wayne E. Seguin. It is called RVM and it is recommended for ruby developers working on Debian machines.

What is RVM ?

Simply RVM allows users to install multiple ruby versions and switch between them easily. It also allows having multiple sets of gems for different projects easily.

Installation Steps

Before getting into details, I would like to say that any steps mentioned here are grabbed from these two links. I only collected parts from them and added them in an easy way

http://rvm.beginrescueend.com/rvm/install/
http://rvm.beginrescueend.com/deployment/system-wide/
http://rvm.beginrescueend.com/rubies/installing/

  1. from your linux console run
  2. bash < <( curl -L http://bit.ly/rvm-install-system-wide )
  3. you now have rvm command installed here at /usr/local/lib/rvm
  4. After installation you should add this line below to your profile
  5. [[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm"
  6. To do so, i added the line above at the end of the /etc/profile file. But, you can add it in other places according to your needs. Read more about profiles here
  7. then run this one
  8. source /usr/local/lib/rvm

Now you are ready to install any versions of Ruby and Ruby Enterprise versions available

For me, I installed Ruby 1.8.7 and its enterprise version this way

  1. rvm install 1.8.7
  2. rvm install ree-1.8.7

That’s it
Hope you enjoy RVM as I hope I enjoy it as well

Monday, September 8, 2008

Ruby Make Problem

Still in my early days using Linux and trying to compile ruby 1.9 on my machine in order to move my working environment to Linux

I downloaded ruby 1.9 source from ftp.ruby-lang.org and as stated in readMe file, i ran

./configure --prefix={{any-desired-path}}

successfully then ran

make

it took some time then i was faced with that error

executable host ruby is required. use --with-baseruby option.

What is that error? and what ruby?? i am compiling ruby how come i need it.


Anyway, i began searching for an explanation. i reached to a comment in one of the forums stating that this error can occur in these two cases

1. ruby isn't in the default path
2. ruby isn't installed

More investigation showed that i should have any previous version of ruby installed in order to use it with that make file as follows

./configure --prefix={{any-desired-path}} --with_baseruby={{full-path-to-ruby-executable}}

then run make command once again. And it worked finally

What a nice recursive world, "ruby is needed to compile ruby"