Поставил себе PostgreSQL, создал роль для приложения, изменил database.yml
Gemfile приложения:
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.2'
gem 'sass-rails', '4.0.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
gem 'pg', '0.15.1'
database.yml:
development:
adapter: postgresql
encoding: unicode
database: first_development
pool: 5
username: first
password: first
host: localhost
test:
adapter: postgresql
encoding: unicode
database: first_test
pool: 5
username: first
password: first
host: localhost
production:
adapter: postgresql
encoding: unicode
database: dbn3r3qugr8bac
pool: 5
username: mztnrqbzratihw
password: RyWmeSr9gP3tj8THsGYe63G46T
timeout: 5000
Конфиг Heroku:
flashbag@netbook:~/rails/first$ heroku config
=== calm-castle-9869 Config Vars
DATABASE_URL: postgres://mztnrqbzratihw:RyWmeSr9gP3tj8THsGYe63G46T@ec2-54-235-99-46.compute-1.amazonaws.com:5432/dbn3r3qugr8bac
HEROKU_POSTGRESQL_NAVY_URL: postgres://dhxbjccraaarir:yCJTHCZ6gcj-5o8gdD3U5oJDoh@ec2-54-235-99-46.compute-1.amazonaws.com:5432/d19qqi2rfrsmmo
HEROKU_POSTGRESQL_RED_URL: postgres://mztnrqbzratihw:RyWmeSr9gP3tj8THsGYe63G46T@ec2-54-235-99-46.compute-1.amazonaws.com:5432/dbn3r3qugr8bac
rake db:
flashbag@netbook:~/rails/first$ rake db:setup
-- initialize_schema_migrations_table()
(55.9ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)
(62.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
-> 0.2765s
(2.3ms) SELECT version FROM "schema_migrations"
(7.0ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
ActiveRecord::SchemaMigration Load (2.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
flashbag@netbook:~/rails/first$ rake db:migrate
ActiveRecord::SchemaMigration Load (2.9ms) SELECT "schema_migrations".* FROM "schema_migrations"
И в итоге git push heroku master:
flashbag@netbook:~/rails/first$ git push heroku master
Initializing repository, done.
Counting objects: 80, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (67/67), done.
Writing objects: 100% (80/80), 189.40 KiB | 0 bytes/s, done.
Total 80 (delta 11), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.5.2
New app detected loading default bundler cache
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 minitest (4.7.5)
Using atomic (1.1.14)
Using tzinfo (0.3.38)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Installing multi_json (1.8.4)
Using polyglot (0.3.3)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.1)
Using coffee-script-source (1.6.3)
Using execjs (2.0.2)
Using thor (0.18.1)
Using hike (1.2.3)
Using json (1.8.1)
Installing mime-types (1.25.1)
Using bundler (1.5.2)
Using tilt (1.4.1)
Installing i18n (0.6.9)
Using rails_stdout_logging (0.0.3)
Installing rake (10.1.1)
Installing rails_serve_static_assets (0.0.2)
Using thread_safe (0.1.3)
Using rack-test (0.6.2)
Using treetop (1.4.15)
Using coffee-script (2.2.0)
Installing uglifier (2.1.1)
Using rdoc (3.12.2)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/tmp/build_3e5ff6a8-f774-4699-b590-b197eacde04d/vendor/ruby-2.0.0/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=/tmp/build_3e5ff6a8-f774-4699-b590-b197eacde04d/vendor/ruby-2.0.0/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}/
--enable-local
--disable-local
Gem files will remain installed in /tmp/build_3e5ff6a8-f774-4699-b590-b197eacde04d/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8 for inspection.
Results logged to /tmp/build_3e5ff6a8-f774-4699-b590-b197eacde04d/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
Installing sass (3.2.13)
Installing sprockets (2.10.1)
Installing pg (0.15.1)
An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundling.
Bundler Output: Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Using minitest (4.7.5)
Using atomic (1.1.14)
Using tzinfo (0.3.38)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Installing multi_json (1.8.4)
Using polyglot (0.3.3)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.1)
Using coffee-script-source (1.6.3)
Using execjs (2.0.2)
Using thor (0.18.1)
Using hike (1.2.3)
Using json (1.8.1)
Installing mime-types (1.25.1)
Using bundler (1.5.2)
Using tilt (1.4.1)
Installing i18n (0.6.9)
Using rails_stdout_logging (0.0.3)
Installing rake (10.1.1)
Installing rails_serve_static_assets (0.0.2)
Using thread_safe (0.1.3)
Using rack-test (0.6.2)
Using treetop (1.4.15)
Using coffee-script (2.2.0)
Installing uglifier (2.1.1)
Using rdoc (3.12.2)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/tmp/build_3e5ff6a8-f774-4699-b590-b197eacde04d/vendor/ruby-2.0.0/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=/tmp/build_3e5ff6a8-f774-4699-b590-b197eacde04d/vendor/ruby-2.0.0/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}/
--enable-local
--disable-local
Gem files will remain installed in /tmp/build_3e5ff6a8-f774-4699-b590-b197eacde04d/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8 for inspection.
Results logged to /tmp/build_3e5ff6a8-f774-4699-b590-b197eacde04d/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
Installing sass (3.2.13)
Installing sprockets (2.10.1)
Installing pg (0.15.1)
An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.8'` 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:calm-castle-9869.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:calm-castle-9869.git'
В чем здесь ошибка?