Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Rails vs Ruby vs RVM


  • Please log in to reply
3 replies to this topic

#1 orrymr

orrymr

    Signalman

  • Members
  • 11 posts
  • LocationJohannesburg, South Africa

Posted 12 January 2014 - 09:17 AM

Hi, first post here, just started reading up on RoR yesterday and I just want to make sure I'm understanding things properly.

 

I tried (unsuccesfully) to install Ruby on Rails on my mac yesterday, so I'm just going back a step to make sure I understand the fundamentals;

 

Am I correct in saying that:

  1. Ruby is the programming language used by the framework, the framework being Rails
  2. Rails is simply a Ruby Gem
  3. A Ruby Gem is a program or a library to be called from another Ruby program (which I, as the application developer, will create)
  4. RVM is the ruby package management system allowing me to install Ruby (the langauge itself... well, I suppose technically it would be installing the interpreter) and that RVM also allows me to install Gems such as Rails?

Having said all that, does that imply that my first step would be to install RVM?

 

Sorry if the answers are obvious, but after trying for an hour unsuccesfully last night, I just want to re-evaluate what I think I know about Ruby, Rails, programming (and life in general).

 

Much obliged,

orrymr



#2 Ohm

Ohm

    Guard

  • Members
  • 179 posts
  • LocationCopenhagen

Posted 12 January 2014 - 01:16 PM   Best Answer

Yes, Ruby is a programming language. Yes, Rails is a gem (a library / framework). Yes, a Ruby gem is just a library. No, RVM is not a Ruby package management system.

 

RVM (http://rvm.io/) is, as its name implies, a Ruby Version Manager. The newest version of Ruby is 2.1.0, however many still uses older versions (for compatibility) like 1.9.3 or 1.8.7. To install these along side 2.1.0 (and all the others) we need a Version Manager. This works by not installing Ruby into /usr/bin (or similar) but rather create a wrapper, which knows which version of Ruby you'd want to use.

 

Another such Version Manager is rbenv (https://github.com/sstephenson/rbenv).

 

You do not need RVM nor rbenv to get started developing with Ruby, RubyGems and Rails, however most developers find it easier to work with.


  • orrymr likes this

Blog: http://ohm.sh | Twitter: madsohm


#3 orrymr

orrymr

    Signalman

  • Members
  • 11 posts
  • LocationJohannesburg, South Africa

Posted 13 January 2014 - 10:39 AM

Great, thanks for the reply.

 

Well, I've managed to install Ruby using RVM on my Linux box and I'm about to try do the same on my Mac. 

 

I'm not too sure what you mean by:

 

This works by not installing Ruby into /usr/bin (or similar) but rather create a wrapper, which knows which version of Ruby you'd want to use.

 

 

So where does Ruby get installed?

 

Also, if I didn't use a version manager to install Ruby, how would I do it? Compile it from source?



#4 stevieing

stevieing

    Dispatcher

  • Members
  • 40 posts

Posted 13 January 2014 - 11:56 AM

Ruby will be installed in ~/.rvm

 

You could compile it from source or you could use homebrew.

 

I would fully agree with Ohm that it is far easier. RVM is easy to install and easy to use.

 

Managing Ruby without RVM can be quite a painful process especially since it is updated quite frequently. RVM also allows you to have different gemsets for each Ruby installation.

 

Once you have installed RVM it is as easy as rvm install 'version' and rvm use 'version'.  If you look at some of the instructions for installing ruby from source and setting it up you will see why it is so much easier.

 

Hope that helps

 

Steve.


  • orrymr likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users