Justus Eapen
Justus Eapen

Reputation: 1159

All Heroku Commands Are Broken due to Ruby Version

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

Upvotes: 0

Views: 148

Answers (2)

Nitin
Nitin

Reputation: 7366

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!

Upvotes: 4

Kirk Powell
Kirk Powell

Reputation: 910

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.

Upvotes: 0

Related Questions