Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Ruby Version for rails application

Having some serious issues with Ruby at the moment and I have a feeling it's around versioning.

I have a Gemfile that looks like this

source "https://rubygems.org"

ruby "2.5.2"

gem "rails", "4.2.1"
gem "unicorn", "4.8.3"
gem "mysql2"
gem "sass-rails", "~> 4.0.3"
gem "uglifier", ">= 1.3.0"
gem "coffee-rails", "~> 4.0.0"
gem "turbolinks"
gem "ancestry"
gem "kaminari"
gem "saxerator"
gem "factory_girl_rails"
gem "delayed_job_active_record"
gem "tree_delta", "~> 2.0.0"
gem "daemons"
gem "which-user",      git: "https://ad131a5ab23a69365434b0e7e36d6275b6a1e9fb:[email protected]/whichdigital/which-user.git", ref: '18eb7'
gem "eva_rails",       git: "https://ad131a5ab23a69365434b0e7e36d6275b6a1e9fb:[email protected]/whichdigital/eva_rails.git", tag: "v1.0.6"
gem "dam_client",      git: "https://ad131a5ab23a69365434b0e7e36d6275b6a1e9fb:[email protected]/whichdigital/digital_asset_manager_client.git", tag: "1.0.0"
gem "fragment_client", git: "https://ad131a5ab23a69365434b0e7e36d6275b6a1e9fb:[email protected]/whichdigital/fragment_client.git", ref: '3c197'
gem 'frontend_containers', git: "https://ad131a5ab23a69365434b0e7e36d6275b6a1e9fb:[email protected]/whichdigital/frontend_containers.git"
gem "cucumber-rails", require: false
gem "parallel_tests"
gem "elasticsearch"
gem 'patron'
gem 'typhoeus'
gem 'net-http-persistent'
gem "dalli"
gem "jbuilder"
gem "newrelic_rpm"
gem 'airbrake'
gem 'rest-client'
gem 'redis-rails'
gem 'dotenv-rails', :require => 'dotenv/rails-now'
gem 'mail'
gem 'rack-rewrite', '~> 1.5.0'
gem 'net-sftp'
gem 'httparty'

group :production do
  gem 'rails_12factor'
end

group :test do
  gem "timecop"
  gem "webmock"
  gem "site_prism"
  gem "simplecov", require: false
end

group :development, :test do
  gem "rspec-rails"
  gem "rspec-its"
  gem "shoulda-matchers", require: false
  gem "database_cleaner"
  gem "spring"
  gem "spring-commands-rspec"
  gem "spring-commands-cucumber"
  gem "pry-rails"
  gem "pry-byebug"
  gem "rubocop", require: false
  gem "selenium-webdriver"
  gem "poltergeist"
  gem "capybara-firebug"
  gem "capybara-screenshot"
  gem "yarjuf"
  gem "launchy"
  gem "web-console", "~> 2.0"
  gem "bullet"
  gem "rspec-collection_matchers"
  gem "eyes_selenium"
  gem 'ftpd'
end

I have Bundler version 1.11.2 installed.

Gem version 2.4.6

Rails 4.2.5.1

When I execute ruby -v I get this returned ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]

The read me file that came with this project said to run "bin/setup" which then prompted me to install bundler. Installed as you see above.

As that command is running I get the following error Your Ruby version is 2.0.0, but your Gemfile specified 2.5.2

I cannot for some reason update to this version.

If anyone needs anymore information please let me know.

like image 894
Filth Avatar asked Feb 08 '23 17:02

Filth


1 Answers

Try changing the ruby version in your Gemfile.

source "https://rubygems.org"

ruby "2.5.2"
# ... 

to:

source "https://rubygems.org"

ruby "2.0.0"
# ... 

also, from what I had gathered and as mentioned in part above, latest stable version of ruby is 2.3.0 atm in case that may of interest

like image 197
Drew Avatar answered Feb 24 '23 14:02

Drew