Troubling pushing to Heroku [closed] - ruby-on-rails

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
I'm having trouble pushing to Heroku. Have looked around for quite a bit but haven't found a working solution. Seems like there are some missing libraries, the gemfile has sqlite under dev and test and pg under production. Here are the results of the push and the dependencies of sqlite:
Fetching: sqlite3-1.3.7.gem (100%)
Building native extensions. This could take a while...
Fetching: sqlite3-ruby-1.3.3.gem (100%)
#######################################################
Hello! The sqlite3-ruby gem has changed it's name to just sqlite3. Rather than
installing `sqlite3-ruby`, you should install `sqlite3`. Please update your
dependencies accordingly.
Thanks from the Ruby sqlite3 team!
<3 <3 <3 <3
#######################################################
Successfully installed sqlite3-1.3.7
Successfully installed sqlite3-ruby-1.3.3
2 gems installed
user-macbook:sample_app user$ git push heroku master
Counting objects: 146, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (108/108), done.
Writing objects: 100% (117/117), 17.84 KiB, done.
Total 117 (delta 50), reused 0 (delta 0)
-----> Removing .DS_Store files
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.0.pre.5
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.0.3)
Using i18n (0.6.1)
Using multi_json (1.5.0)
Using activesupport (3.2.3)
Using builder (3.0.4)
Using activemodel (3.2.3)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.3)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.3)
Using arel (3.0.2)
Using tzinfo (0.3.35)
Using activerecord (3.2.3)
Using activeresource (3.2.3)
Installing annotate (2.5.0)
Installing bcrypt-ruby (3.0.1)
Installing bootstrap-sass (2.0.0)
Installing coderay (1.0.8)
Using coffee-script-source (1.4.0)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.5)
Using rdoc (3.12)
Using thor (0.14.6)
Using railties (3.2.3)
Using coffee-rails (3.2.2)
Using diff-lcs (1.1.3)
Installing factory_girl (2.3.2)
Installing factory_girl_rails (1.4.0)
Installing listen (0.6.0)
Installing lumberjack (1.0.2)
Installing method_source (0.8.1)
Installing slop (3.3.3)
Installing pry (0.9.10)
Installing guard (1.6.0)
Installing guard-rspec (0.5.5)
Using jquery-rails (2.0.1)
Using pg (0.12.2)
Using bundler (1.3.0.pre.5)
Using rails (3.2.3)
Using rspec-core (2.9.0)
Using rspec-expectations (2.9.1)
Using rspec-mocks (2.9.0)
Using rspec (2.9.0)
Using rspec-rails (2.9.0)
Using sass (3.2.4)
Using sass-rails (3.2.5)
Installing sqlite3 (1.3.6)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
Gem files will remain installed in /tmp/build_3vt0kpt7q53ss/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6 for inspection.
Results logged to /tmp/build_3vt0kpt7q53ss/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.6), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:still-woodland-3538.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:still-woodland-3538.git'
sqlite dependencies:
Gem sqlite3-1.3.5
hoe (~> 2.12, development)
mini_portile (~> 0.2.2, development)
rake-compiler (~> 0.7.0, development)
rdoc (~> 3.10, development)
Gem sqlite3-1.3.6
hoe (~> 3.0, development)
mini_portile (~> 0.2.2, development)
rake-compiler (~> 0.7.0, development)
rdoc (~> 3.10, development)
Gem sqlite3-1.3.7
hoe (~> 3.4, development)
mini_portile (~> 0.2.2, development)
rake-compiler (~> 0.8.2, development)
rdoc (~> 3.10, development)
Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'bootstrap-sass', '2.0.0'
gem 'bcrypt-ruby', '3.0.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :devlopment, :test do
gem 'rspec-rails', '2.9.0'
gem 'guard-rspec', '0.5.5'
gem 'sqlite3'
gem 'annotate'
gem 'factory_girl_rails', '1.4.0'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.4'
gem 'coffee-rails', '~> 3.2.2'
gem 'uglifier', '1.2.3'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
end
gem 'jquery-rails', '2.0.1'
# 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 :test do
gem 'capybara', '1.1.2'
gem 'rspec-rails', '2.9.0'
gem 'rb-fsevent'
gem 'growl', '1.0.3'
gem 'spork', '0.9.0'
end
group :production do
gem 'pg'
end

It seems the issue is that you have a typo: group :devlopment, :test should be group :development, :test. You can see that all the gems you're using under the "devlopment" group have been installed on Heroku.
See if correcting the spelling will ensure that there's no attempt to use the sqlite3 gem (or any of the other gems in that group) in production.

Heroku doesn't support sqlite3. Instead, you should use gem pg instead.
group :production do
gem 'pg'
end
Similar to Deploying RoR app to Heroku with Sqlite3 fails

Related

rails server and console not loading

Using rbenv and Rails 4.2.6, when I run bundle exec rails s or bundle exec rails c, I see the following:
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
That's all, nothing else happens. If I then stop spring, and run bundle exec rails c, the following appears:
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
dyld: lazy symbol binding failed: Symbol not found: _rb_data_typed_object_alloc
Referenced from: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/debug_inspector-0.0.2/lib/debug_inspector.bundle
Expected in: flat namespace
dyld: Symbol not found: _rb_data_typed_object_alloc
Referenced from: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/debug_inspector-0.0.2/lib/debug_inspector.bundle
Expected in: flat namespace
Any idea what's wrong here? Thanks!
Update: add content of gemfile and ouput of bundle install
Gemfile:
source 'https://rubygems.org'
ruby "2.3.1"
gem 'rails', '4.2.6'
gem 'pg'
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 'simple_form'
gem "puma"
gem 'dotenv-rails', :groups => [:development, :test]
gem 'quiet_assets', :group => :development
gem "rails_12factor"
gem 'slack-ruby-client'
gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-4-x'
gem 'bootstrap-sass', '~> 3.3.6'
group :development, :test do
gem 'byebug'
gem 'rspec-rails', '~> 3.4'
gem 'factory_girl_rails', '~> 4.0'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'guard'
gem 'guard-rspec', require: false
gem 'terminal-notifier-guard'
gem 'spring'
end
Output of bundle install:
Using rake 11.2.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using execjs 2.7.0
Using debug_inspector 0.0.2
Using sass 3.4.22
Using byebug 9.0.5
Using coderay 1.1.1
Using coffee-script-source 1.10.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using diff-lcs 1.2.5
Using dotenv 2.1.1
Using multipart-post 2.0.0
Using ffi 1.9.10
Using formatador 0.2.5
Using gli 2.14.0
Using rb-fsevent 0.9.7
Using ruby_dep 1.3.1
Using lumberjack 1.0.10
Using nenv 0.3.0
Using shellany 0.0.1
Using method_source 0.8.2
Using slop 3.6.0
Using guard-compat 1.2.1
Using rspec-support 3.4.1
Using hashie 3.4.4
Using multi_json 1.12.1
Using pg 0.18.4
Using puma 3.4.0
Using bundler 1.12.5
Using rails_serve_static_assets 0.0.5
Using rails_stdout_logging 0.0.5
Using tilt 2.0.5
Using websocket-extensions 0.1.2
Using spring 1.7.1
Using terminal-notifier-guard 1.7.0
Using rdoc 4.2.2
Using tzinfo 1.2.2
Using nokogiri 1.6.8
Using rack-test 0.6.3
Using mime-types 3.1
Using autoprefixer-rails 6.3.6.2
Using uglifier 3.0.0
Using binding_of_caller 0.7.2
Using coffee-script 2.4.1
Using sprockets 3.6.1
Using faraday 0.9.2
Using rb-inotify 0.9.7
Using notiffany 0.1.0
Using pry 0.10.3
Using rspec-core 3.4.4
Using rspec-expectations 3.4.0
Using rspec-mocks 3.4.1
Using rails_12factor 0.0.3
Using websocket-driver 0.6.4
Using sdoc 0.4.1
Using activesupport 4.2.6
Using loofah 2.0.3
Using mail 2.6.4
Using bootstrap-sass 3.3.6
Using faraday_middleware 0.10.0
Using listen 3.1.5
Using rspec 3.4.0
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemodel 4.2.6
Using factory_girl 4.7.0
Using jbuilder 2.5.0
Using rails-html-sanitizer 1.0.3
Using slack-ruby-client 0.7.4
Using guard 2.14.0
Using rails-dom-testing 1.0.7
Using activejob 4.2.6
Using activerecord 4.2.6
Using guard-rspec 4.7.2
Using actionview 4.2.6
Using actionpack 4.2.6
Using actionmailer 4.2.6
Using railties 4.2.6
Using sprockets-rails 3.0.4
Using simple_form 3.2.1
Using coffee-rails 4.1.1
Using dotenv-rails 2.1.1
Using factory_girl_rails 4.7.0
Using jquery-rails 4.1.1
Using quiet_assets 1.1.0
Using rails-i18n 4.0.8 from git://github.com/svenfuchs/rails-i18n.git (at rails-4-x#129b9fb)
Using rspec-rails 3.4.2
Using rails 4.2.6
Using sass-rails 5.0.4
Using web-console 2.3.0
Using turbolinks 2.5.3
Bundle complete! 25 Gemfile dependencies, 102 gems now installed.
Bundled gems are installed into ./vendor/bundle.
Update 2 - added bundle exec gem pristine --all
bundle exec gem pristine --all
Restoring gems to pristine condition...
Restored rake-11.2.2
Restored i18n-0.7.0
Skipped json-1.8.3, it is a default gem
Restored minitest-5.9.0
Restored thread_safe-0.3.5
Restored tzinfo-1.2.2
Restored activesupport-4.2.6
Restored builder-3.2.2
Restored erubis-2.7.0
Restored mini_portile2-2.1.0
Restored pkg-config-1.1.7
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Ext::BuildError)
ERROR: Failed to build gem native extension.
current directory: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/nokogiri-1.6.8/ext/nokogiri
/Users/nandersen/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20160620-6035-1m3373p.rb extconf.rb
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
/Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:95:in `block in materialize': Could not find nokogiri-1.6.8 in any of the sources (Bundler::GemNotFound)
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `map!'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `materialize'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/definition.rb:140:in `specs'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/definition.rb:185:in `specs_for'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/definition.rb:174:in `requested_specs'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/environment.rb:19:in `requested_specs'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:14:in `setup'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler.rb:95:in `setup'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/setup.rb:19:in `<top (required)>'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
extconf failed, exit code 1
Gem files will remain installed in /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/nokogiri-1.6.8 for inspection.
Results logged to /Users/nandersen/Projects/the-lunch/vendor/bundle/extensions/x86_64-darwin-15/2.3.0-static/nokogiri-1.6.8/gem_make.out
The problem is debug_inspector gem, you could try to remove web-console gem in your Gemfile, bundle install, and run the server again.
UPDATE:
Or if you would like to keep the web-console gem, you could try to remove all the gems you have installed, and re-bundle install them again. According to this issue on rails/web-console.

Trying to install gems needed to run the twitter Bootstrap gem - getting error while running bundle

I have a regular Rails 4 app for which Im trying to incorporate the twitter bootstrap framework.
The relevant parts of my gemfile looks like this:
#Gems used only for assets and not required in production environments by default
group :assets do
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem "therubyracer", :require => 'v8'
gem "less-rails", "~> 2.4.2"
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
gem "twitter-bootstrap-rails", "~> 2.2.8"
end
When I run the bundle command on terminal I get this error:
> bundle
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0)
Using i18n (0.6.5)
Using minitest (4.7.5)
Using multi_json (1.8.0)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.37)
Using activesupport (4.0.0)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.0)
Using mime-types (1.25)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.0)
Using activemodel (4.0.0)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.0)
Using activerecord (4.0.0)
Using annotate (2.5.0)
Using bundler (1.3.5)
Using coffee-script-source (1.6.3)
Using execjs (2.0.2)
Using coffee-script (2.2.0)
Using thor (0.18.1)
Using railties (4.0.0)
Using coffee-rails (4.0.0)
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server
certificate B: certificate verify failed
(https://s3.amazonaws.com/production.s3.rubygems.org/gems/commonjs-0.2.7.gem)
An error occurred while installing commonjs (0.2.7), and Bundler cannot continue.
Make sure that `gem install commonjs -v '0.2.7'` succeeds before bundling.
What am I doing wrong? Thanks
It's common issue on Mac (for me exactly). Try to update openssl:
brew update
brew install openssl
Sometimes it can also be useful to update symlinks and certificates:
brew link openssl --force
brew install curl-ca-bundle
If this doesn't help and you are using RVM try to update rvm's certificates:
rvm osx-ssl-certs update all
Hope this helps!

Errors of pushing rails app to Heroku error occurred while installing sqlite3, and Bundler cannot continue [duplicate]

This question already has answers here:
Deploying RoR app to Heroku with SQLite 3 fails
(7 answers)
Closed 7 years ago.
I was trying to push my rails app to heroku and received errors as below:
-
Counting objects: 177, done. Delta compression using up to 2 threads.
Compressing objects: 100% (161/161), done. Writing objects: 100%
(177/177), 44.73 KiB, done. Total 177 (delta 39), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.1
Running: bundle install --without development:test --path vendor/bundle -
-binstubs bin/
Fetching gem metadata from
Fetching gem metadata from
Installing rake (10.0.2)
Installing i18n (0.6.1)
Installing multi_json (1.3.7)
Installing activesupport (3.2.8)
Installing builder (3.0.4)
Installing activemodel (3.2.8)
Installing erubis (2.7.0)
Installing journey (1.0.4)
Installing rack (1.4.1)
Installing rack-cache (1.2)
Installing rack-test (0.6.2)
Installing hike (1.2.1)
Installing tilt (1.3.3)
Installing sprockets (2.1.3)
Installing actionpack (3.2.8)
Installing mime-types (1.19)
Installing polyglot (0.3.3)
Installing treetop (1.4.12)
Installing mail (2.4.4)
Installing actionmailer (3.2.8)
Installing arel (3.0.2)
Installing tzinfo (0.3.35)
Installing activerecord (3.2.8)
Installing activeresource (3.2.8)
Using bundler (1.2.1)
Installing coffee-script-source (1.4.0)
Installing execjs (1.4.0)
Installing coffee-script (2.2.0)
Installing rack-ssl (1.3.2)
Installing json (1.7.5) with native extensions
Installing rdoc (3.12)
Installing thor (0.16.0)
Installing railties (3.2.8)
Installing coffee-rails (3.2.2)
Installing jquery-rails (2.1.3)
Installing rails (3.2.8)
Installing sass (3.2.3)
Installing sass-rails (3.2.5)
Installing sqlite3 (1.3.6) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native ex tension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path ( the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
Gem files will remain installed in /tmp/build_2pense1pvyqut/vendor/bundle /ruby/1.9.1/gems/sqlite3-1.3.6
for inspection.
Results logged to /tmp/build_2pense1pvyqut/vendor/bundle/ruby/1.9.1/gems/
sqlite3-1.3.6/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.6), and Bundler cannot co ntinue.
Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
! ! Failed to install gems via Bundler. ! ! Heroku push
rejected, failed to compile Ruby/rails app
=========================================
My GemFile as below:
=======================================
gem 'rails', '3.2.8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :production do gem 'pg' end
group :development, :test do gem 'taps' gem 'rvm'
gem 'rspec-rails','2.0.1' gem 'annotate' gem 'faker','0.3.1' gem 'rspec','2.0.1' gem 'webrat','0.7.1' gem 'spork','0.8.4'
gem 'factory_girl_rails','1.0' end
gem 'rake', '~> 10.0.1'
#gem 'yaml_db'
# Gems used only for assets and not required
# in production environments by default. group :assets do 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', :platforms => :ruby
gem 'uglifier', '>= 1.0.3' end
gem 'jquery-rails'
# 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 'debugger'
=======================================
I tried almost all the solutions provided online, but still no luck.
Any help will be greatly appreciated.
I don't see it in your code above, but guessing you probably have your gem 'sqlite3' at the top of your gemfile, so it is being used in all environments. Sqlite is not supported on Heroku so it has be kept out of the production group. Try the following so that you can use sqlite for development and testing and then pg on Heroku.
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
Had the same issue. Realized that I hadn't committed my changes to Git. Once I committed it and re-pushed it to Heroku, it worked without issue.
The following worked for me on my Mac:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
And then
bundle install
but that threw up this error:
can't find the 'libpq-fe.h header *** extconf.rb failed ***
Solved this error using Homebrew as explained here - https://stackoverflow.com/a/20482221/2665896
i.e.
brew install postgresql
gem install pg
Then commit the Gemfile and Gemfile.lock to the local master.
Then git push heroku master worked like a charm.

Regarding my app update on Heroku

Results logged to /tmp/build_207lfem2op1z3/vendor/bundle/ruby/1.9.1/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:intense-garden-9145.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:intense-garden-9145.git'
So please help me in solving this Iam new to Heroku and Ruby on rails
I have followed the following steps to update my app
git init
git add.
git commit -m '.'
git push heroku master
And I have got the following run error
saasbook#saasbook:~/hw2_rottenpotatoes$ git push heroku master
Counting objects: 462, done.
Compressing objects: 100% (240/240), done.
Writing objects: 100% (462/462), 76.71 KiB, done.
Total 462 (delta 185), reused 427 (delta 172)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.1
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
Installing rake (0.9.2.2)
Installing multi_json (1.0.4)
Installing activesupport (3.1.0)
Installing bcrypt-ruby (3.0.1) with native extensions
Installing builder (3.0.0)
Installing i18n (0.6.0)
Installing activemodel (3.1.0)
Installing erubis (2.7.0)
Installing rack (1.3.6)
Installing rack-cache (1.0.3)
Installing rack-mount (0.8.3)
Installing rack-test (0.6.1)
Installing hike (1.2.1)
Installing tilt (1.3.3)
Installing sprockets (2.0.3)
Installing actionpack (3.1.0)
Installing mime-types (1.17.2)
Installing polyglot (0.3.3)
Installing treetop (1.4.10)
Installing mail (2.3.0)
Installing actionmailer (3.1.0)
Installing arel (2.2.1)
Installing tzinfo (0.3.31)
Installing activerecord (3.1.0)
Installing activeresource (3.1.0)
Installing archive-tar-minitar (0.5.2)
Installing coffee-script-source (1.2.0)
Installing execjs (1.2.13)
Installing coffee-script (2.2.0)
Installing rack-ssl (1.3.2)
Installing json (1.6.5) with native extensions
Installing rdoc (3.12)
Installing thor (0.14.6)
Installing railties (3.1.0)
Installing coffee-rails (3.1.1)
Installing columnize (0.3.6)
Installing haml (3.1.4)
Installing jquery-rails (1.0.19)
Installing libv8 (3.3.10.4)
Installing ruby_core_source (0.1.5)
Installing linecache19 (0.5.12) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
/usr/local/lib/ruby/1.9.1/fileutils.rb:243:in `mkdir': Read-only file system - /usr/local/include/ruby-1.9.1/ruby-1.9.2-p290 (Errno::EROFS)
from /usr/local/lib/ruby/1.9.1/fileutils.rb:243:in `fu_mkdir'
from /usr/local/lib/ruby/1.9.1/fileutils.rb:217:in `block (2 levels) in mkdir_p'
from /usr/local/lib/ruby/1.9.1/fileutils.rb:215:in `reverse_each'
from /usr/local/lib/ruby/1.9.1/fileutils.rb:215:in `block in mkdir_p'
from /usr/local/lib/ruby/1.9.1/fileutils.rb:201:in `each'
from /usr/local/lib/ruby/1.9.1/fileutils.rb:201:in `mkdir_p'
from /tmp/build_lt34ecl4ewpm/vendor/bundle/ruby/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:59:in `block in create_makefile_with_core'
from /usr/local/lib/ruby/1.9.1/tempfile.rb:320:in `open'
from /tmp/build_lt34ecl4ewpm/vendor/bundle/ruby/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:51:in `create_makefile_with_core'
from extconf.rb:19:in `<main>'
Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
Gem files will remain installed in /tmp/build_lt34ecl4ewpm/vendor/bundle/ruby/1.9.1/gems/linecache19-0.5.12 for inspection.
Results logged to /tmp/build_lt34ecl4ewpm/vendor/bundle/ruby/1.9.1/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:intense-garden-9145.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:intense-garden-9145.git'
Below Iam posting my Gem file
source 'http://rubygems.org'
gem 'rails', '3.1.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'therubyracer'
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
gem 'jquery-rails'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'haml'
An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
Typically you will only have ruby-debug gem in use in development, not in production. Make sure ruby-debug is in the :development or :test group in your Gemfile.
group :development, :test do
gem 'ruby-debug19', :require => 'ruby-debug'
end
Then try the following
Run bundle again
Commit your Gemfile and Gemfile.lock
Push to Heroku again
linecache19 is installed as a dependency of ruby-debug19, which you don't want to have in production anyway.
In your Gemfile, replace the line that says
gem 'ruby-debug19', :require => 'ruby-debug'
with this
group :development, :test do
gem 'ruby-debug19', require: 'ruby-debug'
end
which will mean that the debugger is only loaded in the development and test environments.
You're also going to run into trouble with sqlite3 which is not supported on Heroku either... see this question

Stuff-Classifier Gem with heroku

im trying to deploy my ruby code to heroku
this is my Gemfile ,
source 'https://rubygems.org'
gem 'rails', '3.2.6'
gem 'googlecharts'
gem 'stuff-classifier'
gem 'devise'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :production do
gem "pg"
end
group :development, :test do
gem "sqlite3"
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
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', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
and im getting this on push
HengHongs-MacBook-Pro:collab Kinnovate$ git push heroku master
Counting objects: 19, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (16/16), 1.44 KiB, done.
Total 16 (delta 11), reused 0 (delta 0)
-----> Heroku receiving push
-----> Removing .DS_Store files
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.0
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from https://rubygems.org/.......
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.3.6)
Using activesupport (3.2.6)
Using builder (3.0.0)
Using activemodel (3.2.6)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.6)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.6)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.6)
Using activeresource (3.2.6)
Using bcrypt-ruby (3.0.1)
Using coffee-script-source (1.3.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.5)
Using rdoc (3.12)
Using thor (0.16.0)
Using railties (3.2.6)
Using coffee-rails (3.2.2)
Using orm_adapter (0.4.0)
Using warden (1.2.1)
Using devise (2.1.2)
Using fast-stemmer (1.0.1)
Using googlecharts (1.6.8)
Using jquery-rails (2.1.1)
Installing msgpack (0.4.7) with native extensions
Using pg (0.14.0)
Using bundler (1.2.0)
Using rails (3.2.6)
Using sass (3.2.1)
Using sass-rails (3.2.5)
Installing sequel (3.20.0)
Installing sqlite3 (1.3.6) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
Gem files will remain installed in /tmp/build_2wrfyq245cb6w/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6 for inspection.
Results logged to /tmp/build_2wrfyq245cb6w/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.6), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Detected sqlite3 gem which is not supported on Heroku.
! http://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development
!
! Heroku push rejected, failed to compile Ruby/rails app
it works fine when i remove stuff-classifier gem from the Gemfile
how do i fix this?
forked the repo and removed sqlite dependancy from gemspec file
added this to gemfile
gem 'stuff-classifier' , :git =>'https://github.com/henghonglee/stuff-classifier'

Resources