1

我是 Ruby/Rails 初学者,我在 Windows 上。

我刚刚使用 RailsInstaller 从 Rails 3.0.9 升级到 3.2.3,从 Ruby 1.8.7 升级到 1.9.3。我以前安装的 gem 在我键入时不再出现gem list。我认为这是正常的。

我的问题是:有没有办法让所有这些宝石“进入”Ruby 1.9.3 而无需单独重新安装它们?

当我进入一个旧的 Rails 应用程序并运行bundle install时,似乎我的一些 gem 被重新安装(Gemfile 中的那些)。

任何帮助,将不胜感激。抱歉,如果我遗漏了一些明显的东西。

4

1 回答 1

1

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.

于 2012-05-02T20:51:21.347 回答