Change version of rails

故事扮演 提交于 2020-01-13 16:24:06

问题


I accidentally changed my rails version to 4.0.0. I've tried gem uninstall rails --version=4.0.0.rc1 and install version 3.2.13 but when rails -v it's still version 4.0.0. I then tried gem uninstall rails, which gives me "Successfully uninstalled rails-3.2.13". Thought this was easy to do, but I can't find a simple solution.


回答1:


Try this:

rvm use <ruby version>

You can also check your installed ruby versions using rvm list and then switch over. Then do:

rvm gemset create rails3.2.13
rvm <ruby version>@rails3.2.13
gem install rails --version=3.2.13



回答2:


Remove your Gemfile.lock and install rails again. Make sure you specify the version of Rails.

source 'http://production.cf.rubygems.org'
ruby '1.9.3'

gem 'rails',           '3.2.13'


来源:https://stackoverflow.com/questions/16315598/change-version-of-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!