I am taking over an app that has not been developed for a few years. Currently the app is on Github and I have a local Ruby on Rails install on my Ubuntu 16.04 box which I have a copy of the master on where I keep running into the following error:Your Ruby version is 2.5.3 but your Gemfile specified 2.3.1 . I have run bundle update and bundle install to no avail please advise.
You need to install and use Ruby 2.3.1 to run the app as intended. I use rvm for managing ruby versions. Alternatively you could change the requirement in Gemfile and try it with 2.5.3. It will probably run ok, but will not be running identically to the original would have run.
Colin
Have a peak in your Gemfile to change the ‘bundled’ version of Ruby. Having made such an edit, you can run bundle install
to install the dependencies.
You probably want to change to the latest supported 2.3, which is 2.3.8 ASAP. Path versions are supposed not to include any breaking changes, but still, a good test suite can help you feel confident about the change.
THEN, consider that Ruby 2.3 (including 2.3.8) “is now under the state of the security maintenance phase, until the end of March of 2019. After that date, maintenance of Ruby 2.3 will be ended. We recommend you start planning the migration to newer versions of Ruby, such as 2.5 or 2.4.” See: Ruby 2.3.8 Released
Thank you Colin. I am more inclined to try your second suggestion as I have run into several pg 0.18.3 issues when attempting to run it using 2.3.1
I think to way to go is to try to update the gemfile and run the app as a 2.5 app with the EOL of 2.3 coming.
So I have the machine configured and it is running the latest Ruby and the latest Rails. I think the next step is to move the app over to the development machine and then cd into the directory and run bundle install - once that is complete I setup the database - rake db:create then load the schema - rake db:schema:load. If there is any seed data (check the db/seeds.rb) I load that with rake db:seed - now, if the app isn’t in too much disarray I should be able to start the rails server with rails s. Please advise.
If you are updating the rails version then first get it going on the development machine with the version of rails that the app currently expects. Then make sure that the app has full test coverage. Then see the rails guides on upgrading for how to go about upgrading.
Colin
The issue is running the app under that version has generated errors which is why in this thread we opted to install the latest versions and modify the gemfile accordingly. Attempting with the version it was developed under provided the following errors:
An error occurred while installing pg (0.18.3), and Bundler cannot
continue.
Make sure that gem install pg -v '0.18.3' --source '[https://rubygems.org/](https://rubygems.org/)'
succeeds before bundling.
ERROR: Could not find a valid gem ‘pg’ (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)