Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Can't use --version w/ multiple gems.

After following the steps to install RVM on OS X (El Capitan), when I type in "gem install rails --version 5.0.0" I receive an error message:

"ERROR: Can't use --version w/ multiple gems. Use name:ver instead."

Has anyone else seen this? How should I go about resolving it?

3 Answers

Ethan Rivas
Ethan Rivas
9,979 Points

OK, try this steps:

1) Select your Ruby version from your RVM list or Install a new one:

  • rvm list

  • rvm use ruby-2.3.0 // This is the ruby version

Install a Ruby version:

  • rvm install ruby-2.3.0 // Change for the Ruby version you want

2 ) Create a gemset for that Ruby version:

  • rvm gemset create gemset_name // Change gemset_name for the name that you want

3) Select the gemset:

  • rvm gemset use gemset_name

4) Now install your Rails version (in this case Rails 5):

  • For the last Rails 5 gem (Beta):
  • gem install rails -v 5.0.0.beta1 --pre

  • For the Rails 5 gem stable (Not beta)

  • gem install rails -v 5.0.0

That should work, reply to this answer if you need help or if this doesn't works.

After some Googling, it looks like I should not have removed "-n" from my .gemfile .

I replaced the "-n" and ran "gem install rails --version 5.0.0" but now I'm getting errors and warnings all over the place.

"/Users/stephenkoller/.rvm/gems/ruby-2.3.1/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:366:in `block in execute': Failed to complete compile task (RuntimeError)"

Thanks for the swift reply, Ethan Rivas. Before I saw your answer, I tried another method that I found here: [http://tomordonez.com/installing-rails-5-on-mac-osx-el-capitan/].

I'm not entirely sure why, but his process seemed to work:

$ brew uninstall xz

$ gem install nokogiri

$ gem install rails -v 5.0.0

Ethan Rivas
Ethan Rivas
9,979 Points

Uhh, I don't know what the brew uninstall xz does but if that worked for you i'm happy :p, If you need something else or you have a question you can tag me and I'll try to help :), see you around.