I'm finished up with the railsapps.org tutorial on Rails and Bootstrap. I am not able to deploy it to Heroku though. My code is exactly as the tutorial, and I followed the directions exactly in the "Deploy" chapter, but when I run git push heroku master I get the errors below. Any ideas what is wrong?
Regards,
Jeff
$ git push heroku master
Initializing repository, done.
Counting objects: 136, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (113/113), done.
Writing objects: 100% (136/136), 27.95 KiB | 0 bytes/s, done.
Total 136 (delta 35), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.1.1
-----> Installing dependencies using 1.5.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rubygems.org/.......
Fetching additional metadata from https://rubygems.org/..
Using json (1.8.1)
Installing minitest (5.3.3)
Installing rake (10.3.1)
Installing i18n (0.6.9)
Installing thread_safe (0.3.3)
Installing builder (3.2.2)
Installing mime-types (1.25.1)
Installing rack (1.5.2)
Installing erubis (2.7.0)
Installing polyglot (0.3.4)
Installing coffee-script-source (1.7.0)
Installing arel (5.0.1.20140414130214)
Installing execjs (2.0.2)
Installing sass (3.2.19)
Installing multipart-post (2.0.0)
Installing mini_portile (0.5.3)
Installing thor (0.19.1)
Installing oauth (0.4.7)
Installing multi_xml (0.5.5)
Using bundler (1.5.2)
Installing multi_json (1.10.0)
Installing hike (1.2.3)
Installing high_voltage (2.1.0)
Installing tilt (1.4.1)
Installing tzinfo (1.1.0)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/tmp/build_a6d6f6f3-1b58-4344-8c47-ff3f4229b149/vendor/ruby-2.1.1/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal',
'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
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=/tmp/build_a6d6f6f3-1b58-4344-8c47-ff3f4229b149/vendor/ruby-2.1.1/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
extconf failed, exit code 1
Gem files will remain installed in /tmp/build_a6d6f6f3-1b58-4344-8c47-ff3f4229b149/vendor/bundle/ruby/2.1.0/gems/sqlite3-1.3.9 for inspection.
Results logged to /tmp/build_a6d6f6f3-1b58-4344-8c47-ff3f4229b149/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/sqlite3-1.3.9/gem_make.out
Installing rack-test (0.6.2)
Installing rdoc (4.1.1)
Installing treetop (1.4.15)
An error occurred while installing sqlite3 (1.3.9), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.9'` succeeds before bundling.
Bundler Output: Fetching gem metadata from https://rubygems.org/.......
Fetching additional metadata from https://rubygems.org/..
Using json (1.8.1)
Installing minitest (5.3.3)
Installing rake (10.3.1)
Installing i18n (0.6.9)
Installing thread_safe (0.3.3)
Installing builder (3.2.2)
Installing mime-types (1.25.1)
Installing rack (1.5.2)
Installing erubis (2.7.0)
Installing polyglot (0.3.4)
Installing coffee-script-source (1.7.0)
Installing arel (5.0.1.20140414130214)
Installing execjs (2.0.2)
Installing sass (3.2.19)
Installing multipart-post (2.0.0)
Installing mini_portile (0.5.3)
Installing thor (0.19.1)
Installing oauth (0.4.7)
Installing multi_xml (0.5.5)
Using bundler (1.5.2)
Installing multi_json (1.10.0)
Installing hike (1.2.3)
Installing high_voltage (2.1.0)
Installing tilt (1.4.1)
Installing tzinfo (1.1.0)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/tmp/build_a6d6f6f3-1b58-4344-8c47-ff3f4229b149/vendor/ruby-2.1.1/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal',
'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
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=/tmp/build_a6d6f6f3-1b58-4344-8c47-ff3f4229b149/vendor/ruby-2.1.1/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
extconf failed, exit code 1
Gem files will remain installed in /tmp/build_a6d6f6f3-1b58-4344-8c47-ff3f4229b149/vendor/bundle/ruby/2.1.0/gems/sqlite3-1.3.9 for inspection.
Results logged to /tmp/build_a6d6f6f3-1b58-4344-8c47-ff3f4229b149/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/sqlite3-1.3.9/gem_make.out
Installing rack-test (0.6.2)
Installing rdoc (4.1.1)
Installing treetop (1.4.15)
An error occurred while installing sqlite3 (1.3.9), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.9'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Detected sqlite3 gem which is not supported on Heroku.
! https://devcenter.heroku.com/articles/sqlite3
!
! Push rejected, failed to compile Ruby app
To git#heroku.com:rails-bootstrap-test.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:rails-bootstrap-test.git'
According to the book, your Gemfile should look like this:
source 'https://rubygems.org'
ruby '2.1.1'
gem 'rails', '4.1.1'
gem 'sass-rails', '~> 4.0.1'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
gem 'activerecord-tableless'
gem 'bootstrap-sass'
gem 'google_drive'
gem 'high_voltage'
gem 'simple_form'
group :development do
gem 'sqlite3'
gem 'better_errors'
gem 'binding_of_caller', :platforms=>[:mri_21]
gem 'quiet_assets'
gem 'rails_layout'
end
group :production do
gem 'pg'
gem 'thin'
gem 'rails_12factor'
end
Make sure gem 'sqlite3' is in the development group. SQLite is not supported on Heroku so you don't want Heroku trying to install it.
This has been a problem for others as well...including myself. I solved it by making sure sqlite3 was only in the development group and pushing to github again to update any changes.
Here are some links where it seems others have commented on this problem:
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue
Errors of pushing rails app to Heroku error occurred while installing sqlite3, and Bundler cannot continue
Ok, so weird... I ended up destroying the Heroku app and recreating it. That solved the problem it seems.
Related
I'm new to bundle and ruby and I've just installed bundle 2.2.17 and ruby 3.0.1. When I ran the command bundle install, I got the following error. After tracing back the error, I was still not able to understand the error and identify the reason for having this error. If someone could instruct me about how I can get started with solving this, that would be very helpful. Below is the output message I got after running the command:
Resolving dependencies....
Using concurrent-ruby 1.1.8
Using minitest 5.14.4
Using thread_safe 0.3.6
Using zeitwerk 2.4.2
Using public_suffix 4.0.6
Using bundler 2.2.17
Using colorator 1.1.0
Using coffee-script-source 1.11.1
Using execjs 2.8.1
Following files may not be writable, so sudo is needed:
/Library/Ruby/Gems/2.6.0
/Library/Ruby/Gems/2.6.0/build_info
/Library/Ruby/Gems/2.6.0/cache
/Library/Ruby/Gems/2.6.0/doc
/Library/Ruby/Gems/2.6.0/extensions
/Library/Ruby/Gems/2.6.0/gems
/Library/Ruby/Gems/2.6.0/specifications
Using faraday-excon 1.1.0
Using faraday-net_http 1.0.1
Using multipart-post 2.1.1
Using forwardable-extended 2.6.0
Using gemoji 3.0.1
Using rb-fsevent 0.11.0
Using rexml 3.2.5
Using mercenary 0.3.6
Using rouge 3.26.0
Using safe_yaml 1.0.5
Fetching http_parser.rb 0.6.0
Fetching eventmachine 1.2.7
Using liquid 4.0.3
Using jekyll-paginate 1.1.0
Using rubyzip 2.3.0
Using jekyll-swiss 1.0.0
Using unicode-display_width 1.7.0
Using tzinfo 1.2.9
Using i18n 0.9.5
Using addressable 2.7.0
Using pathutil 0.16.2
Using coffee-script 2.4.1
Using kramdown 2.3.1
Using terminal-table 1.8.0
Using activesupport 6.0.3.7
Using ruby-enum 0.9.0
Using jekyll-coffeescript 1.1.1
Using kramdown-parser-gfm 1.1.0
Fetching ffi 1.15.0
Fetching unf_ext 0.0.7.7
Fetching racc 1.5.2
Using faraday-net_http_persistent 1.1.0
Using ruby2_keywords 0.0.4
Fetching commonmarker 0.17.13
Using faraday 1.4.1
Using sawyer 0.8.2
Using octokit 4.21.0
Using jekyll-gist 1.5.0
Your user account isn't allowed to install to the system RubyGems.
You can cancel this installation and run:
bundle config set --local path 'vendor/bundle'
bundle install
to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to RubyGems using sudo.
Password:
Installing http_parser.rb 0.6.0 with native extensions
Installing eventmachine 1.2.7 with native extensions
Installing commonmarker 0.17.13 with native extensions
Installing racc 1.5.2 with native extensions
Installing unf_ext 0.0.7.7 with native extensions
Installing ffi 1.15.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/private/var/folders/v5/f0xx2vq95039ds03fshsy_980000gn/T/bundler20210520-20868-8wnof7commonmarker-0.17.13/gems/commonmarker-0.17.13/ext/commonmarker
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r
./siteconf20210520-20868-8zcp2h.rb extconf.rb
creating Makefile
current directory:
/private/var/folders/v5/f0xx2vq95039ds03fshsy_980000gn/T/bundler20210520-20868-8wnof7commonmarker-0.17.13/gems/commonmarker-0.17.13/ext/commonmarker
make "DESTDIR=" clean
current directory:
/private/var/folders/v5/f0xx2vq95039ds03fshsy_980000gn/T/bundler20210520-20868-8wnof7commonmarker-0.17.13/gems/commonmarker-0.17.13/ext/commonmarker
make "DESTDIR="
make: *** No rule to make target
`/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19/ruby/config.h',
needed by `arena.o'. Stop.
make failed, exit code 2
Gem files will remain installed in
/var/folders/v5/f0xx2vq95039ds03fshsy_980000gn/T/bundler20210520-20868-8wnof7commonmarker-0.17.13/gems/commonmarker-0.17.13
for inspection.
Results logged to
/var/folders/v5/f0xx2vq95039ds03fshsy_980000gn/T/bundler20210520-20868-8wnof7commonmarker-0.17.13/extensions/universal-darwin-19/2.6.0/commonmarker-0.17.13/gem_make.out
An error occurred while installing commonmarker (0.17.13), and Bundler cannot
continue.
Make sure that `gem install commonmarker -v '0.17.13' --source 'https://rubygems.org/'`
succeeds before bundling.
In Gemfile:
github-pages was resolved to 214, which depends on
jekyll-commonmark-ghpages was resolved to 0.1.6, which depends on
jekyll-commonmark was resolved to 1.3.1, which depends on
commonmarker
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/private/var/folders/v5/f0xx2vq95039ds03fshsy_980000gn/T/bundler20210520-20868-vi8pkcunf_ext-0.0.7.7/gems/unf_ext-0.0.7.7/ext/unf_ext
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r
./siteconf20210520-20868-i4vcac.rb extconf.rb
checking for -lstdc++... *** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
--with-static-libstdc++
--without-static-libstdc++
--with-stdc++lib
--without-stdc++lib
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in
`try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:546:in
`block in try_link0'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in
`mktmpdir'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:543:in
`try_link0'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:570:in
`try_link'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:789:in
`try_func'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1016:in
`block in have_library'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in
`block in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in
`block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in
`open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in
`block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in
`open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in
`postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in
`checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1011:in
`have_library'
from extconf.rb:6:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/folders/v5/f0xx2vq95039ds03fshsy_980000gn/T/bundler20210520-20868-vi8pkcunf_ext-0.0.7.7/extensions/universal-darwin-19/2.6.0/unf_ext-0.0.7.7/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/var/folders/v5/f0xx2vq95039ds03fshsy_980000gn/T/bundler20210520-20868-vi8pkcunf_ext-0.0.7.7/gems/unf_ext-0.0.7.7
for inspection.
Results logged to
/var/folders/v5/f0xx2vq95039ds03fshsy_980000gn/T/bundler20210520-20868-vi8pkcunf_ext-0.0.7.7/extensions/universal-darwin-19/2.6.0/unf_ext-0.0.7.7/gem_make.out
An error occurred while installing unf_ext (0.0.7.7), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.7.7' --source 'https://rubygems.org/'` succeeds
before bundling.
In Gemfile:
github-pages was resolved to 214, which depends on
github-pages-health-check was resolved to 1.17.0, which depends on
dnsruby was resolved to 1.61.5, which depends on
simpleidn was resolved to 0.2.1, which depends on
unf was resolved to 0.1.4, which depends on
unf_ext
This error might be related to:
Rails: Your user account isn't allowed to install to the system RubyGems
after that try to execute
gem install commonmarker -v '0.17.13' --source 'https://rubygems.org/'`
succeeds before bundling.
to check if this gem will be installed.
This is likely a duplicate of: Problem with bundler using rails (mac user)
You need to install updated xcode. Go to your terminal and run: xcode-select --install
I have an application named "Aadvisor", when i try to run this application on local, i do foreman start like below:
pallav#pallav-System-Product-Name:~/Workspace/Aadvisor$ foreman start
14:21:28 web.1 | started with pid 14635
14:21:28 web.1 | bundler: command not found: rackup
14:21:28 web.1 | Install missing gem executables with `bundle install`
14:21:29 web.1 | exited with code 127
14:21:29 system | sending SIGTERM to all processes
SIGTERM received
Then i do 'bundle install' :
pallav#pallav-System-Product-Name:~/Workspace/Aadvisor$ bundle install
Fetching gem metadata from http://rubygems.org/.........
Fetching additional metadata from http://rubygems.org/..
Resolving dependencies...
Using addressable (2.3.5)
Using backports (3.4.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:13:in `<main>'
Gem files will remain installed in /home/pallav/Workspace/Aadvisor/vendor/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.1.2 for inspection.
Results logged to /home/pallav/Workspace/Aadvisor/vendor/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.1.2/ext/mri/gem_make.out
An error occurred while installing bcrypt-ruby (3.1.2), and Bundler cannot continue.
Make sure that `gem install bcrypt-ruby -v '3.1.2'` succeeds before bundling.
Then i simply do gem install bcrypt-ruby -v '3.1.2', as below:
pallav#pallav-System-Product-Name:~/Workspace/Aadvisor$ gem install bcrypt-ruby -v '3.1.2'
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /var/lib/gems/1.9.1 directory.
Then using 'sudo' sudo gem install bcrypt-ruby -v '3.1.2', as below:
pallav#pallav-System-Product-Name:~/Workspace/Aadvisor$ sudo gem install bcrypt-ruby -v '3.1.2'
[sudo] password for pallav:
Building native extensions. This could take a while...
ERROR: Error installing bcrypt-ruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:13:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.1.2 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.1.2/ext/mri/gem_make.out
I checked the error log here:
pallav#pallav-System-Product-Name:~/Workspace/Aadvisor$ /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.1.2/ext/mri/gem_make.out
bash: /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.1.2/ext/mri/gem_make.out: Permission denied
My ruby version is :
pallav#pallav-System-Product-Name:~/Workspace/Aadvisor$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
My Gem file is:
source "http://rubygems.org"
gem "rack"
gem "sinatra"
gem "sinatra-contrib"
gem "json"
gem "will_paginate"
gem 'will_paginate-bootstrap'
gem "thin"
#gem "shotgun"
gem 'pg'
gem "data_mapper"
gem "dm-postgres-adapter"
gem "dm-validations"
I did installed rvm \curl -sSL https://get.rvm.io | bash and also did sudo apt-get install ruby1.9.1-dev after that i tried again doing bundle install and i get this:
pallav#pallav-System-Product-Name:~/Workspace/Aadvisor$ bundle install
Fetching source index from http://rubygems.org/
Resolving dependencies................................
Using addressable (2.3.5)
Using backports (3.4.0)
Installing bcrypt-ruby (3.1.2)
Installing daemons (1.1.9)
Installing dm-core (1.2.1)
Installing dm-aggregates (1.2.0)
Installing dm-constraints (1.2.0)
Installing dm-migrations (1.2.0)
Installing fastercsv (1.5.5)
Installing json (1.8.1)
Installing json_pure (1.8.1)
Installing multi_json (1.8.4)
Installing dm-serializer (1.2.2)
Installing dm-timestamps (1.2.0)
Installing dm-transactions (1.2.0)
Installing stringex (1.5.1)
Installing uuidtools (2.1.4)
Installing dm-types (1.2.2)
Installing dm-validations (1.2.0)
Installing data_mapper (1.2.0)
Installing data_objects (0.10.13)
Installing dm-do-adapter (1.2.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
checking for main() in -lpq... no
checking for main() in -llibpq... 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/bin/ruby1.9.1
--with-pgsql-server-dir
--without-pgsql-server-dir
--with-pgsql-server-include
--without-pgsql-server-include=${pgsql-server-dir}/include
--with-pgsql-server-lib
--without-pgsql-server-lib=${pgsql-server-dir}/lib
--with-pgsql-client-dir
--without-pgsql-client-dir
--with-pgsql-client-include
--without-pgsql-client-include=${pgsql-client-dir}/include
--with-pgsql-client-lib
--without-pgsql-client-lib=${pgsql-client-dir}/lib
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created
Gem files will remain installed in /home/pallav/Workspace/Aadvisor/vendor/bundle/ruby/1.9.1/gems/do_postgres-0.10.13 for inspection.
Results logged to /home/pallav/Workspace/Aadvisor/vendor/bundle/ruby/1.9.1/gems/do_postgres-0.10.13/ext/do_postgres/gem_make.out
An error occurred while installing do_postgres (0.10.13), and Bundler cannot continue.
Make sure that `gem install do_postgres -v '0.10.13'` succeeds before bundling.
I also tried installing gem install do_postgres -v '0.10.13' like this :
pallav#pallav-System-Product-Name:~/Workspace/Aadvisor$ sudo gem install do_postgres -v '0.10.13'
Fetching: data_objects-0.10.13.gem (100%)
Fetching: do_postgres-0.10.13.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing do_postgres:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
checking for main() in -lpq... no
checking for main() in -llibpq... 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/bin/ruby1.9.1
--with-pgsql-server-dir
--without-pgsql-server-dir
--with-pgsql-server-include
--without-pgsql-server-include=${pgsql-server-dir}/include
--with-pgsql-server-lib
--without-pgsql-server-lib=${pgsql-server-dir}/lib
--with-pgsql-client-dir
--without-pgsql-client-dir
--with-pgsql-client-include
--without-pgsql-client-include=${pgsql-client-dir}/include
--with-pgsql-client-lib
--without-pgsql-client-lib=${pgsql-client-dir}/lib
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created
Gem files will remain installed in /var/lib/gems/1.9.1/gems/do_postgres-0.10.13 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/do_postgres-0.10.13/ext/do_postgres/gem_make.out
Finally i checked the result as :
pallav#pallav-System-Product-Name:~/Workspace/Aadvisor$ /var/lib/gems/1.9.1/gems/do_postgres-0.10.13/ext/do_postgres/gem_make.out
bash: /var/lib/gems/1.9.1/gems/do_postgres-0.10.13/ext/do_postgres/gem_make.out: Permission denied
What probably could be the error.
In order to deploy my rails app to heroku, I made change to my Gemfile by adding
gem 'pg'
Once I did
bundle install
I am getting following error -
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.8.2)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.38)
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.1)
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.1)
Using activerecord (4.0.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.1)
Using hike (1.2.3)
Using jbuilder (1.5.3)
Using jquery-rails (3.0.4)
Using json (1.8.1)
Installing pg (0.17.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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
--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=/Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
--with-pg
--without-pg
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/
Gem files will remain installed in /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.17.1 for inspection.
Results logged to /Users/aniruddhabarapatre1/.rvm/gems/ruby-2.0.0-p247/gems/pg-0.17.1/ext/gem_make.out
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.
I assumed I didn't had PostgreSQL installed on my computer and hence downloaded it to no use.
I tried couple of other options and ran following command with similar errors again.
gem install pg
Got this thing figured out.
Since I had PostgreSQL.app already installed. Gave following command -
gem install pg -- --with-pg-config=/Applications/Postgres93.app/Contents/MacOS/bin/pg_config
This works => env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config
Do you have postgres development libraries?
I uninstalled then reinstalled postgresql. Then I installed pg -v '0.17.1'. After that I ran bundle. It worked.
I have OSX 10.6.8 and am trying to install PostgreSQL 9.2 on my device. I used the graphical installer available on their website, and set up the software, without using stack builder at the end to additionally configure other functions.
When I load my Rails file and bundle install I encounter the following error:
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.4)
Using minitest (4.7.5)
Using multi_json (1.7.7)
Using atomic (1.1.10)
Using thread_safe (0.1.0)
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 formatador (0.2.4)
Using rb-fsevent (0.9.3)
Using rb-inotify (0.9.0)
Using rb-kqueue (0.2.0)
Using listen (1.2.2)
Using lumberjack (1.0.4)
Using method_source (0.8.1)
Using slop (3.4.5)
Using pry (0.9.12.2)
Using guard (1.8.1)
Using rspec-core (2.13.1)
Using rspec-expectations (2.13.0)
Using turbolinks (1.2.0)
Using jquery-turbolinks (1.0.0)
Using jquery-ui-rails (4.0.3)
Using json (1.8.0)
Using kaminari (0.14.1)
Using nested_form (0.3.2)
Installing pg (0.15.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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/rvm/rubies/ruby-1.9.3-p448/bin/ruby
--with-pg
--without-pg
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p448/gems/pg-0.15.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p448/gems/pg-0.15.1/ext/gem_make.out
An error occurred while installing pg (0.15.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.15.1'` succeeds before bundling.
I have tried gem install pg -- --with-pg-config=/Library/PostgreSQL/9.1/bin/pg_config , all of the error message suggestions I've gotten and the solutions here. I have also tried re-installing Postgres, locating the appropriate config path, and locating the mfmk.log file the error message mentions (but the file doesn't exist on my computer). Furthermore, under my apps/PostgreSQL, there is a "Reload Configuration" application that, when I run, says Server signaled.
Anyone know what I should do? I was going to try Homebrew, but I found it quite strange that the installer itself wouldn't be able to produce functioning software.
If you are on a Mac try:
ARCHFLAGS="-arch x86_64" gem install pg
This worked for me (The brew installer told me this... gotta love brew)
i got a really big problem. Just started learning ruby - everything is fine. But no searching for hours to find a solution to push on heroku. but no luck. please help me, (unfortunately on a Win7)
thanks a lot:
C:\Sites\code\omrails>git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.154' to the
list of known hosts.
Enter passphrase for key '/c/Users/mdz/.ssh/id_rsa':
Counting objects: 69, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (55/55), done.
Writing objects: 100% (69/69), 26.54 KiB | 0 bytes/s, done.
Total 69 (delta 5), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> WARNING: Removing `Gemfile.lock` because it was generated on Windows.
Bundler will do a full resolve so native gems are handled properly.
This may result in unexpected gem versions being used in your app.
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle -
-binstubs vendor/bundle/bin
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake (10.0.4)
Installing i18n (0.6.1)
Installing multi_json (1.7.6)
Installing activesupport (3.2.13)
Installing builder (3.0.4)
Installing activemodel (3.2.13)
Installing erubis (2.7.0)
Installing journey (1.0.4)
Installing rack (1.4.5)
Installing rack-cache (1.2)
Installing rack-test (0.6.2)
Installing hike (1.2.3)
Installing tilt (1.4.1)
Installing sprockets (2.2.2)
Installing actionpack (3.2.13)
Installing mime-types (1.23)
Installing polyglot (0.3.3)
Installing treetop (1.4.14)
Installing mail (2.5.4)
Installing actionmailer (3.2.13)
Installing arel (3.0.2)
Installing tzinfo (0.3.37)
Installing activerecord (3.2.13)
Installing activeresource (3.2.13)
Using bundler (1.3.2)
Installing coffee-script-source (1.6.2)
Installing execjs (1.4.0)
Installing coffee-script (2.2.0)
Installing rack-ssl (1.3.3)
Installing json (1.8.0)
Installing rdoc (3.12.2)
Installing thor (0.18.1)
Installing railties (3.2.13)
Installing coffee-rails (3.2.2)
Installing jquery-rails (3.0.1)
Installing rails (3.2.13)
Installing sass (3.2.9)
Installing sass-rails (3.2.6)
Installing sqlite3 (1.3.7)
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_2bxzg0nyav6hg/vendor/bundle
/ruby/1.9.1/gems/sqlite3-1.3.7 for inspection.
Results logged to /tmp/build_2bxzg0nyav6hg/vendor/bundle/ruby/1.9.1/gems/
sqlite3-1.3.7/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot co
ntinue.
Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby/Rails app
You can't use SQLite on Heroku, you'll have to use PostgreSQL. You can set it up to use PostgreSQL on Heroku but SQLite in development by putting the pg gem in a production group in your Gemfile, and sqlite in a development group, but Heroku recommends you use the same database in both your development and production environments.