Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku with ruby 1.9.3 causing many different crashes

I go to redeploy my heroku apps with a new gem in Gemfile and it crashes on startup

/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require': libruby.so.1.9: cannot open shared object file: No such file or directory - /app/vendor/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.so (LoadError)

This is happening no matter what branch I deploy (old stable ones...) and only fixes by doing a heroku rollback.

I believe this is caused by heroku recently updating their ruby 1.9.3 because I was having this issue Heroku app crashes with 'libruby.so.1.9: cannot open shared object file' . Removing the nokogiri gem stopped the exception I was getting but then there's still this. More similar errors occur when I add new gems.

The whole problem was solved by deploying to a new heroku app but that's not something I can just do on my production server.

Any ideas on fixing the issue or somehow "refreshing" my app?

my gemfile:

source "https://rubygems.org"

ruby "1.9.3"
gem "rails", "3.2.3"
gem "thin"

# Bundle edge Rails instead:
# gem "rails", :git => "git://github.com/rails/rails.git"

gem "mongoid"
gem "devise"
gem "haml"
gem "sass"
gem "exceptional"
gem "kaminari"
gem "mongoid_search"
#gem "nokogiri"
gem "bson_ext"
gem "heroku-mongo-backup"
gem "aws-s3"
# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem "haml-rails",   "~> 0.3.4"
  gem "sass-rails",   "~> 3.2.3"
  gem "coffee-rails", "~> 3.2.1"

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem "therubyracer", :platform => :ruby

  gem "uglifier", ">= 1.0.3"
end

gem "jquery-rails"

group :test do
  gem "mongoid-rspec"
end

# To use ActiveModel has_secure_password
# gem "bcrypt-ruby", "~> 3.0.0"

# To use Jbuilder templates for JSON
# gem "jbuilder"

# Use unicorn as the app server
# gem "unicorn"

# Deploy with Capistrano
# gem "capistrano"

# To use debugger
# gem "ruby-debug19", :require => "ruby-debug"

#
group :development do
  gem "letter_opener"
end
like image 662
Riley Guerin Avatar asked Oct 14 '12 21:10

Riley Guerin


2 Answers

Just FYI,

After contacting the Heroku support about this issue, you should follow these 3 simple steps:

  1. Install this heroku-repo plugin: heroku plugins:install https://github.com/lstoll/heroku-repo.git

  2. Run the following command: heroku repo:purge_cache

  3. Deploy your app again.

Hope that helps!

like image 134
rymai Avatar answered Oct 27 '22 18:10

rymai


This happened to me yesterday as well, was definitely something to do with Heroku.

I found fix and discussion on Twitter: https://twitter.com/bcardarella/status/256822171979100161

Just force-clear the gem file cache(clear gemfile, deploy, restore and deploy) and the app would start smoothly again.

like image 34
Mu-An Chiou Avatar answered Oct 27 '22 17:10

Mu-An Chiou