0
votes

when I "git push heroku master" return some information like this:

remote:        Make sure that `gem install sqlite3 -v '1.3.11'` succeeds 

before bundling.
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !     
remote:  !     Detected sqlite3 gem which is not supported on Heroku.
remote:  !     https://devcenter.heroku.com/articles/sqlite3
remote:  !
remote: 
remote:  !     Push rejected, failed to compile Ruby app
remote: 
remote: Verifying deploy...
remote: 
remote: !       Push rejected to serene-fjord-6086.
remote: 
To https://git.heroku.com/serene-fjord-6086.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/serene-fjord-6086.git'

but I have installed sqlite3 -v '1.3.11' successfully

Building native extensions.  This could take a while...
Successfully installed sqlite3-1.3.11
1 gem installed

This is the Gemfile and I have tried adding "gem sqlite3" in "group :development,:test", but it doesn't work:

source 'https://rubygems.org'
gem 'rails', '4.2.4'
gem 'sqlite3'
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

group :development, :test do
  gem 'byebug'
end

group :development do
  gem 'web-console', '~> 2.0'
  gem 'spring'
end

group :production do
  gem 'pg','0.17.1'
  gem 'rails_12factor','0.0.2'
end

why ???????

3
This is the output of a hook on the server. Are you the server admin? - houtanb
Can you please paste content of your Gemfile ? - Dusht
I have pasted my Gemfile. - mayfeel

3 Answers

2
votes

Heroku Use PG as database system, it won't support sqlite db. You should move sqlite gem in your gemfile inside testing, development group like this,

source 'https://rubygems.org'
gem 'rails', '4.2.4'
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

group :development, :test do
  gem 'byebug'
  gem 'sqlite3'
end

group :development do
  gem 'web-console', '~> 2.0'
  gem 'spring'
end

group :production do
  gem 'pg','0.17.1'
  gem 'rails_12factor','0.0.2'
end
0
votes

Heroku doesn't support sqlite. It only allow postgree.

Replace sqlite with Postgree. Please follow this to do that link

0
votes

Heroku didn't have this issue before, I think it used to ignored sqlite gem before. I faced it while pushing a few days back.

Ideal solution is to put all your 'heroku non-supporting gems' inside :development & :test group in your Gemfile

group :development, :test do
    gem 'sqlite'
end

and keep your heroku gems inside :production group

group :production do
    gem 'rails_12factor'
    gem 'pg'
    #anything else
end