UPDATED: Per Michael’s suggestion/comment, I am reformatting below display code. I also made the minor fixes on code like rails
which was commented out and also not latest. The history of the Gemfile dates back to Michael Hartl’s RoR tutorial – I had made an app using it but not touched in last 2 years.
Now I have run bundle update
which resulted in a lot of things getting updated which was nice. However at the end it gave me the same error as before – see below pls. Any further advice would be great pls. Thank you.
Installing puma 3.12.6 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
....
An error occurred while installing puma (3.12.6), and Bundler cannot continue.
Make sure that `gem install puma -v '3.12.6' --source 'https://rubygems.org/'` succeeds before bundling.
Pls see below my Gemfile.
source 'https://rubygems.org'
ruby "2.6.3"
gem 'rails', '5.0.7.2'
gem 'will_paginate', '3.1.0'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'faker', '1.6.3'
gem 'carrierwave', '0.11.2'
gem 'mini_magick', '4.5.1'
gem 'fog', '1.38.0'
gem 'bcrypt', '3.1.11'
gem 'bootstrap-sass', '3.3.6'
gem 'puma', '~> 3.4'
gem 'sass-rails', '5.0.5'
gem 'uglifier', '3.0.0'
gem 'coffee-rails', '4.2.1'
gem 'jquery-rails', '>= 4.3.3'
gem 'turbolinks', '5.0.0'
gem 'jbuilder', '2.4.1'
gem 'figaro', '1.1.1'
gem 'haml'
gem 'country_select'
gem 'city-state'
gem 'redis'
gem 'devise', '>= 4.2.0'
gem 'friendly_id', '~> 5.1.0'
gem 'geoip'
gem 'bootstrap-datepicker-rails'
gem 'social-share-button'
gem 'trix'
gem 'activeadmin', '~> 1.1.0.pre3'
gem 'arctic_admin'
gem 'stripe'
gem 'money'
gem 'eu_central_bank'
gem 'newrelic_rpm'
gem 'cloudinary'
group :development, :test do
gem 'pg', '0.20.0'
gem 'byebug', '9.0.0', platform: :mri
end
group :development do
gem 'web-console', '3.1.1'
gem 'listen', '3.0.8'
gem 'spring', '1.7.2'
gem 'spring-watcher-listen', '2.0.0'
end
group :test do
gem 'rails-controller-testing', '0.1.1'
gem 'minitest-reporters', '1.1.9'
gem 'guard', '2.13.0'
gem 'guard-minitest', '2.4.4'
end
group :production do
gem 'pg', '0.20.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
2
Answers
Solved with the help of Michael Hartl on twitter.
Had to remove Gemfile.lock and hardcode puma version to gem
'puma', '~> 4.1'
and then run bundle install.If my website ever gets its 15mins of fame, I will be talking about
Michael
for the first 5 mins at least.Based on the Gemfile (note correct spelling—not GemFile), it appears that the version of Puma is wrong. If you’re using a Gemfile.lock with a different version, that could account for the error. Also, your
rails
gem appears to be commented out, which is unlikely to be right.One step you’re likely to need is this:
That being said, the version mismatch indicates that there may be deeper issues. Where did this Gemfile come from? Why is
rails
commented out? Etc. These are the sort of things that would help people answer your question.