开发者

Upgrading Ruby broke Rails?

So, I upgraded Ruby to 1.8.7 to make a particular gem work. Hooray, it works now! But...now rails doesn't. I tried reinstalling rails through gem, but that hasn't helped, either. Rake is no longer recognized by my windows box as a valid command, and I can't even start the server without a whole string of errors.

My only thought is that maybe I shouldn't have copied my gems file over (a tutorial mentioned it as the only way to save my gems on windows with an upgrade). I'm gonna try reinstalling 1.8.7 without changing anything, and reinstalling everything as needed.

Edit:开发者_JAVA百科 Okay, just plain 1.8.7 does work, but it's frustrating to have to reinstall all my gems by hand... Is there any better solution, in Windows?


You may have to uninstall the old version first or use something like RVM to manage your multiple versions. I've always run into problems trying to upgrade directly on a windows machine (rake and rails not working basically).

Edit: Looks like even with RVM you have to install gems individually for each version (a good thing), but you can also export and import gem sets. That might be your best bet, short of scripting a solution yourself.


That is normal: each ruby environment has their own set of gems. That might not seem intuitive, but i guess it has something to do with the possible differences in ruby versions and the fact that gems are "installed" and compiled if needed.

I have a script that installs all my needed gems on windows. On windows rvm does not work, but there is an alternative called pik. I have written a blogpost about this process, which also contains a small bat-file i use that will install the most commonly used gems automatically.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜