This is my gem gem file as you can see I use outdated version of rails and may be ruby and may be something else. This happened because I Followed Michel's Hart tutorial and took this gems from there.
source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.2'
gem 'bootstrap-sass', '2.3.2.0'
gem 'sprockets', '2.11.0'
gem 'bcrypt-ruby', '3.1.2'
gem 'faker', '1.1.2'
gem 'will_paginate', '3.0.4'
gem 'bootstrap-will_paginate', '0.0.9'
gem 'ffaker'
gem 'carrierwave', '~> 0.9'
gem "font-awesome-rails"
gem 'sprockets-rails'
gem 'rest-client'
gem 'blogo'
group :development, :test do
gem 'sqlite3', '1.3.8'
gem 'rspec-rails', '2.13.1'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
gem 'factory_girl_rails', '4.2.1'
end
gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
gem 'heroku-deflater'
end
Hello,
On Feb 24, 2016, Ruby 2.0.0 security maintenance will reach its
end-of-life. When this happens, Ruby 2.0.0 will no longer receive
security updates. We recommend that you upgrade your app to a
supported Ruby version, e.g. 2.2.4, to ensure that your application is
running in a secure environment.
So which version of the ruby and rails do you suggest to put into my gemfile?
I would put the most current stable rails and ruby versions.
at this point that would be ruby '2.3' and rails '4.2'
At the time of writing most current ruby supported on heroku is 2.3.0.
To run rails on 2.3 without warnings about some cyclic dependencies you need rails 4.2+, but note that some things changed from 4.0 to 4.2 and you may have to do a migration, see guide on that
Related
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]
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:
bundle update
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.
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.
Error when pushing to Heroku Could not find activerecord-postgis-adapter-5.0.0 in any of the sources.
Using PostGIS in development and production.
Gemfile:
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
ruby '2.4.0'
gem 'bundler'
gem 'rails', '~> 5.1.2'
gem 'pg'
gem 'puma', '3.4'
gem 'uglifier', '>= 3.2.0'
gem 'bootstrap', '~> 4.0.0.beta'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bcrypt', '~> 3.1.11'
gem 'carrierwave', '1.1.0'
gem 'leaflet-rails'
gem 'activerecord-postgis-adapter'
gem 'rgeo-geojson'
gem 'leaflet-draw-rails'
gem 'jquery-rails'
gem 'tether-rails'
gem 'jquery-ui-rails'
gem 'will_paginate', '3.1.5'
gem 'bootstrap-will_paginate', '1.0.0'
gem 'gon'
gem 'aws-sdk', '~> 2.3'
group :development do
gem 'web-console', '>= 3.5.1'
gem 'listen', '>= 3.0.8', '< 3.2'
gem 'database_cleaner'
gem 'rubocop', require: false
gem 'dotenv-rails'
gem 'awesome_print'
gem 'super_awesome_print'
gem 'heroku_db_restore'
end
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'pry-byebug'
gem "better_errors"
gem 'binding_of_caller'
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
end
group :test do
gem 'minitest-reporters', '1.1.9'
gem 'guard', '2.14.1'
gem 'guard-minitest', '2.4.6'
gem 'rails-controller-testing', '1.0.2'
gem 'simplecov', :require => false
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
database.yml (edited):
default: &default
adapter: postgis
encoding: unicode
pool: 5
Thank you for any suggestions. Is the activerecord-postgis-adapter asking for something not needed. https://github.com/rgeo/activerecord-postgis-adapter.
Problem with stackoverflow. Usually get asked to put in more code. Now can't post because not enough details. Not sure what I should add, so I'll keep typing until the error goes away. I have been able to push this to Heroku in the past, but have have other issues with the postgis-adaptor and maybe it's a recent update that's causing the problem. I don't know where the version number is coming from. The sources part of the Gemfile is a bit of a mystery to me.
Among other things I tried:
gem uninstall activerecord-postgis-adapter
Select gem to uninstall:
1. activerecord-postgis-adapter-3.1.2
2. activerecord-postgis-adapter-4.0.2
3. activerecord-postgis-adapter-5.0.0
4. activerecord-postgis-adapter-5.0.1
5. All versions
I selected option 5 and reran bundle install. Gemfile.lock now activerecord-postgis-adapter (4.0.4) but on Heroku push still get Could not find activerecord-postgis-adapter-5.0.0 in any of the sources.
Check your Gemfile.lock for that Gem, I am guessing you installed it previously (possibly on another system if its checked it) and locked to 5.0.0?
RubyGems does not have a 5.0.0 version of this Gem, so it would seem the author deleted it. https://rubygems.org/gems/activerecord-postgis-adapter
Bundler however will never update your gems automatically (it tracks the version in Gemfile.lock), but you can use bundle update or bundle update activerecord-postgis-adapter to tell it to do so.
See http://bundler.io/man/bundle-update.1.html
I made two changes and am not sure which was the key. I changed gem 'pg', '~>0.18.4' by removing the version constraint which then lead to v 0.21.0 being installed. I also moved gem 'rgeo-geojson' to above gem 'activerecord-postgis-adapter' in the Gemfile. Ended up with activerecord-postgis-adapter 4.0.4 after bundle update, which isn't the latest version so still curious how all this works. I suspect the former change is the one that's important. I based these changes on a newer related app that I am working on that did upload to Heroku.
I already tried to update gem bundle and also try to pick gem 2.1.2 but ruby is not supporting them. Here is the error message:
error message
Gemfile:
source 'https://rubygems.org'
ruby '2.1.2'
gem 'rails', '4.2.4'
gem 'pry-rails'
gem 'pg'
gem 'bcrypt', require: 'bcrypt'
gem 'friendly_id'
gem 'sass-rails', '~> 5.0'
gem 'bootstrap-sass'
gem 'uglifier', '>= 1.3.0'
gem 'jquery-rails'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'puma'
gem 'rails_12factor', group: :production
gem 'newrelic_rpm'
gem 'rack-timeout'
gem 'rmagick'
gem 'aws-sdk'
gem 'paperclip'
group :development, :test do
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'binding_of_caller'
gem 'better_errors'
gem 'annotate'
gem 'dotenv-rails'
gem 'spring'
end
It seems that you have defined the ruby version for your project in the Gemfile. If you comment it out then, your app could use the system version of Ruby. If you need further help please publish the code in Gemfile.
In updating dependencies, I have come across updating sprockets. However there doe not appear to be a proper dependency for my set of gems. After returning to: 2.11.3, the erorr apepars:
/Users/..../rvm/gems/ruby-2.3.0/gems/bootstrap-sass-3.3.6/lib/bootstrap-sass/engine.rb:11:in `block in <class:Engine>': uninitialized constant Sprockets::Rails::VERSION (NameError)
Gemfile:
source 'http://rubygems.org'
ruby '2.3.0' # '1.9.3'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.2.6'
#gem 'pg', '0.15.1'
gem 'mysql2', '0.4.4'
gem 'bootstrap-sass', '3.3.6'
gem 'bcrypt', '3.1.11'
gem 'faker', '1.1.2'
gem 'will_paginate', '3.1.0'
gem 'bootstrap-will_paginate', '0.0.10'
gem 'geocoder', '1.3.7'
gem 'nested_form', '0.3.2'
gem 'utf8-cleaner', '0.2.4'
gem 'sprockets', '3.6.0' #2.11.3
gem 'json', '1.8.3'
gem 'ffi'
gem 'iconv', '1.0.4'
gem 'chosen-rails', '1.5.2'
gem 'compass-rails', github: 'Compass/compass-rails'
# For image uploads
gem 'carrierwave', '0.11.2'
# For uploading CSV
gem 'roo', '2.4.0'
# DataTables
gem 'jquery-datatables-rails', '3.4.0' # git: 'git://github.com/rweng/jquery-datatables-rails.git'
gem 'jquery-ui-rails', '5.0.5'
# Editing in line:
gem 'best_in_place', '3.1.0'
# Passing data from controller to coffeescript
gem 'gon', '6.0.1'
#gem 'jquery-turbolinks' '2.1.0'
# For searching and webservice queries-NO LONGER USED
#gem 'sunspot_rails', '2.1.0'
#gem 'sunspot_solr', '2.1.0'
gem 'progress_bar', '1.0.5'
gem 'responders', '2.2.0'
# Calendar Date and Validation
gem 'bootstrap-datepicker-rails'
# For Google Maps overlays
gem 'gmaps4rails', '~> 2.1.2'
gem 'underscore-rails', '~> 1.8.3'
group :development, :test do
gem 'rspec-rails', '3.4.2'
gem 'guard-rspec', '4.7.2'
gem 'spork-rails', '4.0.0'
gem 'childprocess', '0.5.9'
gem 'guard-spork', '2.1.0'
end
group :test do
gem 'selenium-webdriver', '2.53.3'
gem 'capybara', '2.7.1'
gem 'factory_girl_rails', '4.7.0'
end
gem 'sass-rails', '4.0.1'
gem 'uglifier', '3.0.0'
gem 'coffee-rails', '4.1.1'
gem 'jquery-rails', '4.1.1'
gem 'turbolinks', '2.5.3'
gem 'jbuilder', '2.5.0'
group :doc do
gem 'sdoc', '0.4.1', require: false
end
gem 'rails_12factor', '0.0.3'
How can I make this work?
You can fix this problem following steps:
First, you run gem update to update your gems.
And sprockets-rails should be at version 3.0.4
Second, open your Gemfile.lock in your rails project, modify the following line to update sprocket version
sprockets-rails (3.0.4)
Finally, you run bundle install
Above one is the answer,
You can fix this problem following steps:
First, you run gem update to update your gems.
And sprockets-rails should be at version 3.0.4
Second, open your Gemfile.lock in your rails project, modify the following line to update sprocket version
sprockets-rails (3.0.4)
Finally, you run bundle install
Everytime I run a heroku command I receive this error:
Your Ruby version is 1.9.3, but your Gemfile specified 2.1.2
This has been happening since I pushed several changes (adding sidekiq and making changes to my clock.rb file, also: a new model I need to migrate the db for)
Does anyone know why this might be happening? It only started after I added ruby '2.1.2' to the gemfile. But before that I was getting this funky segmentation fault error.
Here's my gemfile:
source 'https://rubygems.org'
ruby '2.1.2'
gem 'rails', '4.1.1'
gem 'pg'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'clockwork'
gem 'httparty'
gem 'omniauth-facebook'
gem 'parse-ruby-client'
gem 'parse_resource', '~> 1.8.0'
gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby'
gem 'sidekiq'
gem 'foundation-rails'
group :development, :test do
gem 'pry-rails'
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'shoulda-matchers'
gem 'valid_attribute'
gem 'capybara'
gem 'dotenv-rails'
gem 'better_errors'
gem 'binding_of_caller'
end
group :production do
gem 'rails_12factor'
gem 'thin'
end
It's seems to related bundler issue. Go through here https://github.com/sstephenson/rbenv/issues/400 same sort of issue also here get fixed with :
# Rakefile
task :freedom do
Bundler.with_clean_env { sh "heroku" }
end
Hope this help you!
I had two applications using Ruby. In your terminal, change to the directory of the application, then check the Ruby version you are using. Update it appropriately.