Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Gem::InstallError: devise requires Ruby version >= 2.1.0." when running Ruby 2.3.1

In my continuous integration machine I'm running Ruby 2.3.1p112:

$ ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]

but when I try to install gems I get an error that makes no sense:

$ bundle install --deployment
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Using rake 10.5.0
Using i18n 0.7.0
Using json 1.8.3
...
Installing devise 4.0.1

Gem::InstallError: devise requires Ruby version >= 2.1.0.
An error occurred while installing devise (4.0.1), and Bundler cannot continue.
Make sure that `gem install devise -v '4.0.1'` succeeds before bundling.

installing the gem globally works:

$ sudo gem install devise -v '4.0.1'
Successfully installed devise-4.0.1
Parsing documentation for devise-4.0.1
Done installing documentation for devise after 1 seconds
1 gem installed

but it makes no difference. The complaint about Rubygems is also odd, as I'm running 2.6.4:

$ update_rubygems
RubyGems 2.6.4 installed

Any ideas what might be going on?

My Gemfile looks like this:

source "https://rubygems.org"

gem "activerecord-session_store", "~> 0.1.2"
gem "bootstrap-sass", "~> 3.3.6"
gem "breadcrumbs_on_rails", "~> 2.3.1"
gem "coffee-rails", "~> 4.1.0"
gem "delayed_job_active_record", "~> 4.1.0"
gem "devise", "~> 4.0.0"
gem "devise_invitable", git: "https://github.com/scambra/devise_invitable.git" # Using master because the current release version seems not to work with Devise 4.0.
gem "font-awesome-rails", "~> 4.6.1.0"
gem "gibbon", "~> 2.2.3"
gem "haml-rails", "~> 0.9"
gem "html5shiv-rails", "~> 0.0.2"
gem "jbuilder", "~> 2.0"
gem "jquery-rails"
gem "paper_trail", "~> 4.1.0"
gem "paranoia", "~> 2.1.5"
gem "pg", "~> 0.15"
gem "pundit", "~> 1.1.0"
gem "rack-timeout", "~> 0.4.2"
gem "rails", "~> 4.2.6"
gem "redcarpet", "~> 3.3.4"
gem "respond-rails", "~> 1.0"
gem "rest-client", "~> 1.8.0"
gem "rollbar", "~> 2.11.2"
gem "sass-rails", "~> 5.0"
gem "sdoc", "~> 0.4.0", group: :doc
gem "simple_form", "~> 3.2.1"
gem "stripe", "~> 1.41.0"
gem "validation_auditor", "~> 1.0.0"
gem "uglifier", ">= 1.3.0"

group :development do
  gem "quiet_assets"
  gem "spring"
  gem "web-console", "~> 2.0"
end

group :development, :test do
  gem "annotate", "~> 2.6.5"
  gem "byebug" # Call "byebug" anywhere in the code to stop execution and get a debugger console
  gem "database_cleaner", "~> 1.5.3"
  gem "factory_girl_rails", "~> 4.7.0"
end

group :development, :staging do
  gem "mail_safe", "~> 0.3.4"
end

group :test do
  gem "assert_difference", "~> 1.0.0"
  gem "bundler-audit", "~> 0.5.0"
  gem "capybara", "~> 2.7.0"
  gem "capybara-email", "~> 2.5.0"
  gem "capybara_minitest_spec", "~> 1.0.5"
  gem "simplecov", "~> 0.11.2", require: false
  gem "shoulda-context", "~> 1.2.1"
  gem "poltergeist", "~> 1.9.0"
end

group :production, :staging do
  gem "unicorn-rails", "~> 2.2.0"
end

I'm not using RVM nor any other Ruby/Gem manager.

like image 848
pupeno Avatar asked May 13 '16 13:05

pupeno


1 Answers

Re-installing bundler by running:

sudo gem install bundler

fixed the issue.

like image 195
pupeno Avatar answered Nov 15 '22 07:11

pupeno