Last summer, as the early releases of Rails 3.0 began rolling out, I shared how to use RVM to create sandboxes for experimenting with new versions of gems. Fast forward to now—Rails 3.1 is coming our way soon, with some major changes under the hood. These changes are well documented and debated elsewhere, so I won’t get into them here. Once again, there’s no need to wait until 3.1 goes final to see what’s different. Here’s a quick rundown of how to install your own Rails 3.1 sandbox.
First, if you haven’t updated RVM in awhile, it doesn’t hurt to do so now.
At this writing, RVM is at version 1.6.5. Don’t forget, you’ll need to open a new terminal window to begin using the new version.
Create a gemset for the beta software:
Switch to the newly-minted gemset with
Now install Rails 3.1 beta:
and create a test application:
We’re almost done. Next create a
.rvmrc file to tell RVM which gemset to use in the new application. Note that I’m using Ruby 1.9.2, which I believe is now a requirement in Rails 3.1.
Open the application’s directory, run
bundle to install the default gems, and you’re off to the races.
As you look around the application structure, take a look at your
Gemfile and the new
assets directory inside
app/. This is where most of the new features that will affect Rails developers at all levels are located.
I stand with the Black community against systemic racism, police violence and brutality, intolerance, and hate in the United States and worldwide. We must all demand better from our leaders, and ourselves. Stop tolerating intolerance.
While you're here, please consider making a donation to Black Girls CODE, who do great, important work to provide opportunity to underprivileged girls interested in tech, or any organization working toward equity and safety for all, not just the privileged. Thank you.
If you liked my series on practical advice for adding reliable tests to your Rails apps, check out the expanded ebook version. Lots of additional, exclusive content and a complete sample Rails application.
Ruby on Rails news and tips, and other ideas and surprises from Aaron at Everyday Rails. Delivered to your inbox on no particular set schedule.