Skip to main content

Run/Migrate Older Ruby Application (Your Ruby version is 2.5.3 but your Gemfile specified 2.3.1)

Ruby • Asked by Neville Smith

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.


Hey Neville,

Since you're taking on the project fresh, I would suggest installing ruby 2.3.1 on your dev machine instead of trying to upgrade the app to the latest version. This way you can get the app working locally before trying to make any changes to the app.

After you've got the app installed and working and you're ready to upgrade the ruby version, you can open the applications Gemfile and look for a line that says ruby "2.3.1" and change it to ruby "2.5.3".


Thank you Jacob. I will try to do just that and report the results. I appreciate you getting back to me.


I reinstalled everything including the OS and the latest error is listed below. let me know if you have any ideas.

/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- bundler/setup (LoadError)
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in
require'
from /home/nevillesmith/webapp/config/boot.rb:3:in <top (required)>'
from bin/rails:7:in
require_relative'
from bin/rails:7:in `'


Hey Neville,

How are you installing ruby? Are you using a version manager such as rbenv or rvm?

Did you install bundler? gem install bundler

Take a look at the guides Chris has for installing rails on ubuntu: https://gorails.com/setup/ubuntu/16.04 *updated for your version


I think I didnt attempt specific versions when I tried these instructions. Just the latest and it gave me the error I stated in my initial post.


When following those instructions, be sure to change the version of Ruby and Rails to the version of your app... so for instance, if your app is using ruby 2.3.1 and rails 4.2, instead of copy/paste whats in the instructions, you'd change the versions like:

rbenv install 2.3.1

and

gem install rails -v 4.2

Ok that is done. Thank you. Now do I just move the folder with the app to that machine and attempt to start the rails server?


I can confirm the that the rails version is correct and the ruby version is correct. Should I now mve the folder labeled myapp? Should I set up the database on the machine first?


Asssuming you're talking about the app you're taking over... once you have rails and ruby installed, you'll need to copy the application over to your development machine (where you just installed ruby/rails) and then cd into the directory you just copied and run bundle install - once that is complete you'll need to 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) you can load that with rake db:seed - now, if the app isn't in too much disarray you should be able to start the rails server with rails s

What version of rails is the app you're taking over?


Hopefully this is the final error. I ran bundle install and got the following error:

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/'
succeeds before bundling.


There should be more to the error message, can you supply that? Did you install postgres? https://gorails.com/setup/ubuntu/16.04#postgresql


This is actually the entire message.


What's the error when you run gem install pg -v '0.18.3'


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)
ERROR: Could not find a valid gem '0.18.3' (>= 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)


Googling the error message "Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0" returns the following guide:

See if that gets you any further. Are you using a VM or something? I'm not really sure why a vanilla install of Ubuntu would be giving you all these issues.


no it isnt a vm install. I too am uncertain of why I have that error.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.