-2

I have both Ruby 1.9 and 2.1 installed in my computer. Now I am wanting to use several of the gems installed for Ruby 2.1 in Ruby 1.9. However, Ruby 1.9 can't find them.

I tried to solve this problem by setting the environmental variable RUBYLIB but since there were so many gems that needed to be used I can't do it one by one. Is there an easier way?

For example, one of the packages I would like to use in Ruby 1.9 is pango.

Its path is ~/ruby/lib/ruby/gems/2.1.0/gems/pango-2.2.0/

All of the packages installed for Ruby 2.1 can be found at ~/ruby/lib/ruby/gems/2.1.0/gems

Thanks you.

user3476791
  • 1,072
  • 1
  • 9
  • 14

1 Answers1

1

I'd suggest you use a manager like rvm (https://rvm.io/) or rbenv (https://github.com/sstephenson/rbenv) to avoid manually configuring your environment. I use rvm even when I have only one Ruby version installed.

mrodrigues
  • 1,052
  • 10
  • 14
  • 1
    In addition to bundler, which can help manage installing gems for a specific version of ruby. http://bundler.io/v1.10/gemfile.html – onebree Jul 13 '15 at 18:09