gmich
gmich

Reputation: 150

Can I "move" my gems while upgrading Ruby 1.8.7->1.9.3 and Rails 3.0->3.2?

I am Ruby/Rails beginner, and I am on Windows.

I just used RailsInstaller to upgrade from Rails 3.0.9 to 3.2.3, from Ruby 1.8.7 to 1.9.3. The gems that I installed previously no longer appear when I type gem list. I assume this is normal.

My question is: Is there a way to get all of those gems "into" Ruby 1.9.3 without individually re-installing them?

When I went into an old rails apps and ran bundle install, it appears that a few of my gems were re-installed (the ones in the Gemfile).

Any help would be appreciated. Sorry if I am missing something obvious.

Upvotes: 1

Views: 714

Answers (1)

jstim
jstim

Reputation: 2432

If you're just upgrading to a new version, as long as everything that was in your Gemfile was installed when you ran bundle install then I wouldn't worry about it. Just re-install gems as you need them instead of bloating your system with gems that you don't currently need.

If you have projects that you are porting over to the newer versions of Rails and Ruby, you can just run bundle install as the first step in upgrading the app to make sure its dependencies are installed.

Maybe someone could give you an yes/no answer for transitioning with RailsInstaller, but I'm trending toward using rvm and gemsets to have a cleaner, more focused environment for each project.

If you want to switch back and forth between multiple ruby versions, maybe check out the gem pik. You can use it to install gems on multiple versions of ruby so that they're available across them all.

Upvotes: 1

Related Questions