I'm creating a website but have accidentally installed Ruby on Rails version 4 instead of version 5 and would like to upgrade to the latest version in order to use a few of the features that are currently missing from the version I have on my system.
I have tried following this guide:
http://railsapps.github.io/updating-rails.html
I installed rvm
and ran all the preliminaries in order, up until this section:
rvm use [email protected] --create
gem install rails
rails -v
Where I ran into problems. rvm use [email protected] --create
outputs:
ruby-2.3.1 - #gemset created /home/dev/.rvm/gems/[email protected]
ruby-2.3.1 - #generating rails5.0 wrappers..........
Using /home/dev/.rvm/gems/ruby-2.3.1 with gemset rails5.0
Fine. Gem install rails
also proceeds without error, installing all 36 gems including, crucially:
Fetching: rails-5.0.1.gem (100%)
Successfully installed rails-5.0.1
and
Fetching: railties-5.0.1.gem (100%)
Successfully installed railties-5.0.1
However, when I run rails -v
directly afterwards, I get:
Could not find proper version of railties (4.2.7.1) in any of the sources
Run `bundle install` to install missing gems.
When I run bundle install
, however, the system reverts to rails 4.2.7.1.
Do I need to do something extra to install/link/whatever railties 4.2.7.1, and to stop the system reverting to the original version of rails? I don't use rails very much so I'm not particularly familiar with the configuration. Perhaps I need to change a config file within my app?
The problem was in the Gemfile, which contained old version numbers. I updated to the following:
Then ran
bundle update
followed bybundle install
and now have Rails 5.0.1. Thanks to Iceman for suggesting looking in the Gemfile!