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

Rails 4

Can Ruby 2.0 and Ruby 1.9.x coexist on my computer. I want to have both and be able to switch back and forth between Rails 3 & 4 projects also.

I know I can specify which version of Ruby and Rails in my gem file of 3 right now but Im not sure that is the solution because I think Rails generates slightly different files in 3 & 4.

Would there be a way to specify version before I generate a project?

  • I havent downloaded Ruby 2.0 or Rails 4 yet but I will once I hear about someone else that safely has both.

1 Answer

rbenv to the rescue!

rbenv

This will allow you to set local and global versions of ruby. It also allows for a .ruby-version file per application which will switch the version or prompt you to install the correct version of ruby per the applications requirement.

Some will recommend: rvm

But I have run into various issues over time with rvm and rbenv has been a breeze.

Cool thanks