# Installing Ruby 2.0 and the corresponding ruby-gems



## outofcoffee (Nov 7, 2013)

Hello,

I have been spending the past few days getting ruby-gems to work with ruby20. I noticed there is no port for ruby-gems 2.0 or newer. Any other version I install on my machine is linked to ruby19. What would be the best way to get ruby-gems installed with ruby 2.0 on FreeBSD? Preferably no RVM.

Thanks.


----------



## SirDice (Nov 7, 2013)

Try setting 
	
	



```
RUBY_DEFAULT=2.0
```
 in /etc/make.conf and then build devel/ruby-gems. The port should respect that.


----------



## zeissoctopus (Nov 7, 2013)

According to the file /usr/ports/UPDATING, you may follow the modern way to override the default Ruby version in ports.

```
20130920:
  AFFECTS: Users of ports
  AUTHOR: bapt@FreeBSD.org

  New way to override the default version of a language in the ports
  tree.

  The make variable, DEFAULT_VERSIONS, allows users to override the
  default version defined by the ports tree.

  For example, to declare specific versions for Perl, Ruby and Tcl/Tk,
  it would be defined as:
  DEFAULT_VERSIONS=     perl5=5.18 ruby=2.0 tcltk=8.6

  Today, this only is supported by Perl, Ruby and Tcl/Tk.
```


----------



## SirDice (Nov 7, 2013)

Those simply set DEFAULT_RUBY and DEFAULT_PERL. Either way should work.


----------



## outofcoffee (Nov 7, 2013)

It worked! Thanks so much  I couldn't find this solution after many hours of research


----------

