1

私は RoR の初心者で、最初のアプリを Heroku にデプロイしようとしています。リポジトリに GitHub を使用していますが、「git push heroku master」でデプロイしようとするとエラーが発生し続けます。

実行時に表示されるメッセージを以下に示します。

$ git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.156' to the list of       known hosts.
Counting objects: 69, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (55/55), done.
Writing objects: 100% (69/69), 26.38 KiB, done.
Total 69 (delta 5), reused 0 (delta 0)
-----> 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/..
   Installing rake (10.0.3)
   Installing i18n (0.6.1)
   Installing multi_json (1.6.0)
   Installing activesupport (3.2.11)
   Installing builder (3.0.4)
   Installing activemodel (3.2.11)
   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.1)
   Installing tilt (1.3.3)
   Installing sprockets (2.2.2)
   Installing actionpack (3.2.11)
   Installing mime-types (1.21)
   Installing polyglot (0.3.3)
   Installing treetop (1.4.12)
   Installing mail (2.4.4)
   Installing actionmailer (3.2.11)
   Installing arel (3.0.2)
   Installing tzinfo (0.3.35)
   Installing activerecord (3.2.11)
   Installing activeresource (3.2.11)
   Installing coffee-script-source (1.4.0)
   Installing execjs (1.4.0)
   Installing coffee-script (2.2.0)
   Installing rack-ssl (1.3.3)
   Installing json (1.7.7)
   Installing rdoc (3.12.1)
   Installing thor (0.17.0)
   Installing railties (3.2.11)
   Installing coffee-rails (3.2.2)
   Installing jquery-rails (2.2.1)
   Using bundler (1.3.0.pre.5)
   Installing rails (3.2.11)
   Installing sass (3.2.5)
   Installing sass-rails (3.2.6)
   Installing sqlite3 (1.3.7)
   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_1um81jm55kdnc/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.7 for inspection.
   Results logged to /tmp/build_1um81jm55kdnc/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 continue.
   Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
   !
   !     Failed to install gems via Bundler.
   !
   !     Heroku push rejected, failed to compile Ruby/rails app

   To git@heroku.com:aqueous-tor-8402.git
   ! [remote rejected] master -> master (pre-receive hook declined)
   error: failed to push some refs to 'git@heroku.com:aqueous-tor-8402.git'

私の宝石ファイルは次のとおりです。

source 'https://rubygems.org'

gem 'rails', '3.2.11'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'

gem 'json'

# 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 'ruby-debug'

"sqlite3 -version を実行すると、次のようになります。

 3.7.12 2012-04-03 19:43:07 86b8481be7e76cccc92d14ce762d21bfb69504af

「bundle show sqlite3」を実行すると、次のようになります。

 /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.7

申し訳ありませんが、これは私の最初のRailsアプリなので、このことについては比較的新しいです。

どんな助けでも大歓迎です。

更新: ここに Heroku ログがあります

$ heroku logs
2013-02-12T22:04:25+00:00 heroku[api]: Enable Logplex by peterbarbosa1@gmail.com
2013-02-12T22:04:25+00:00 heroku[api]: Release v2 created by peterbarbosa1@gmail.com
2013-02-12T22:04:47+00:00 heroku[router]: at=info code= desc="Blank app" method=GET         path=/favicon.ico host=aqueous-tor-8402.herokuapp.com fwd=99.250.119.144 dyno= queue= wait=             connect= service= status=502 bytes=
2013-02-12T22:04:46+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=aqueous-tor-8402.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-12T22:41:52+00:00 heroku[slugc]: Slug compilation started
2013-02-12T22:42:39+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T22:45:56+00:00 heroku[slugc]: Slug compilation started
2013-02-12T22:46:30+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T22:59:31+00:00 heroku[slugc]: Slug compilation started
2013-02-12T22:59:52+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:00:39+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=aqueous-tor-8402.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-12T23:00:39+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=aqueous-tor-8402.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-12T23:08:25+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:08:50+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:13:09+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:13:45+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:18:14+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:18:41+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:20:03+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:20:34+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:22:39+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:23:05+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:25:50+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:26:37+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:28:52+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:29:20+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:31:20+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:32:01+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:42:41+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:43:08+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:48:22+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:48:47+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-12T23:52:52+00:00 heroku[slugc]: Slug compilation started
2013-02-12T23:53:16+00:00 heroku[slugc]: Slug compilation failed: failed to compile     Ruby/rails app
2013-02-13T00:08:04+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=aqueous-tor-8402.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-13T00:08:04+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=aqueous-tor-8402.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-13T00:09:49+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=pbarbosa.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-13T00:09:49+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=pbarbosa.herokuapp.com fwd=99.250.119.144 dyno= queue= wait= connect= service= status=502 bytes=
2013-02-13T00:09:49+00:00 heroku[router]: at=info code=H16 desc="herokuapp redirect" method=GET path=/ host=pbarbosa.heroku.com fwd="99.250.119.144" dyno= queue= wait= connect= service= status=301 bytes=
2013-02-13T00:19:18+00:00 heroku[slugc]: Slug compilation started
2013-02-13T00:19:41+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-13T00:39:17+00:00 heroku[api]: Attach HEROKU_POSTGRESQL_AQUA resource by peterbarbosa1@gmail.com
2013-02-13T00:39:17+00:00 heroku[api]: Release v3 created by peterbarbosa1@gmail.com
2013-02-13T01:27:38+00:00 heroku[slugc]: Slug compilation started
2013-02-13T01:27:59+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-13T01:29:28+00:00 heroku[slugc]: Slug compilation started
2013-02-13T01:29:52+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-13T01:31:32+00:00 heroku[slugc]: Slug compilation started
2013-02-13T01:32:01+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
2013-02-13T01:32:30+00:00 heroku[slugc]: Slug compilation started
2013-02-13T01:32:55+00:00 heroku[slugc]: Slug compilation failed: failed to compile Ruby/rails app
4

2 に答える 2

0

確認すべき点がいくつかあります

  1. database.yml の本番環境をコメントアウトします。heroku はすでにそれを行っています。上記の人が言ったように、herokuはsqlite3を使用しませんが、テストと開発にsqlite3を使用できますが、違いはありません
  2. データベースに変更を加えた場合は、プッシュする前にデータベースを移行してください。heroku run rake db:migrate を実行してから、git push heroku master を試してください。

これで解決することを願っています

今後の参考のために、herokuログを投稿してください。それを見ると解決しやすくなります。

于 2013-02-13T01:13:53.200 に答える