0

I keep getting an error when i run

git push heroku master

this is the error i'm getting:

remote:        Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
remote:        
remote:        /tmp/build_6084782c356fe559294d11bd3affdd4e/vendor/ruby-2.0.0/bin/ruby extconf.rb
remote:        checking for sqlite3.h... no
remote:        sqlite3.h is missing. Try 'port install sqlite3 +universal',
remote:        'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'

my config/database.yml looks like this:

default: &default
  adapter: postgresql
  encoding: unicode
  pool: 5

development:
  <<: *default
  database: small_time_grocer_development

test:
  <<: *default
  database: small_time_grocer_test

production:
  <<: *default
  database: small_time_grocer_production
  username: small_time_grocer
  password: <%= ENV['SMALL_TIME_GROCER_DATABASE_PASSWORD']

my Gemfile is as follows:

source 'https://rubygems.org'

gem 'rails', '4.2.0'

gem 'rails_12factor', group: :production

gem 'sass-rails', '~> 5.0'

gem 'uglifier', '>= 1.3.0'

gem 'coffee-rails', '~> 4.1.0'

gem 'jquery-rails'

gem 'turbolinks'

gem 'jbuilder', '~> 2.0'

gem 'sdoc', '~> 0.4.0', group: :doc

gem 'pg'


# devise gems
gem 'therubyracer'
gem 'devise'
gem 'omniauth'
gem 'omniauth-facebook'

# gem for error respond_to featurefrom responders gem
gem 'responders', '~> 2.0'

group :development, :test do

  gem 'byebug'

  gem 'web-console', '~> 2.0'

  gem 'spring'
end

ruby "2.1.5"

I don't have sqlite3 anywhere in the gemfile, but i still keep getting this error even after committing my changes and pushing to heroku. Any ideas?

I should also mention on the onset, that I didn't know about the -d flag for the rails new command. So i initially started the rails app with:

rails new <servername>

instead of :

rails new <servername> -d postgresql

Should i just start the app over only this time i initialize with postgresql? I can't figure out what configuration i'm missing in order to deploy.

Andrew Kim
  • 3,145
  • 4
  • 22
  • 42

2 Answers2

0

Try running bundle update (it will update the Gemfile.lock) and then push the changes again if there is any in Gemfile or Gemfile,lock . and then try to deploy again.

prashant
  • 108
  • 7
  • try the solution given here http://stackoverflow.com/questions/7963561/heroku-cannot-run-git-push-heroku-master – prashant Jan 06 '15 at 19:49
  • Yeah, i had tried that solution prior to posting this question. I guess I'll try and debug it some more – Andrew Kim Jan 06 '15 at 19:57
0

I often need to delete the Gemfile.lock file before running bundle install or bundle update, in order to successfully generate a new Gemfile.lock file.

Then save changes to git for the push to Heroku:

git add -A
git commit -m "update gemfile"
git push heroku master
Shaky
  • 11
  • 1