私は自分自身にレールを教えています。私はプログラマーですが、Webプログラマーではありません。ここでマイケル・ハートルの本を読んでいます
アプリのデプロイを最初から開始することをお勧めします。同意します。そこで、Herokuのアカウントを取得し、セットアップなどを行いました。次に、最初のアプリであるgitと作品を作成しました。次に、Herokuのサイトのすべての指示に従いました。最後に、次のコマンドを使用してアプリをHerokuにプッシュするようになりました。
git push heroku master
この本は、Herokuがpostgresqlを望んでいるのに、私のマシンのアプリがsqlite3を使用しているため、この段階で問題が発生する可能性があると述べています。この本は、私のアプリのgemファイルの行をから変更することを提案しています
gem 'sqlite3'
に
gem 'sqlite3-ruby', :group => :development
それを試し、バンドルインストールを実行してから、アプリをプッシュしようとしました。運が悪いので、コンソールに次のメッセージが表示されます。
An error occured while installing sqlite3 (1.3.6), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
!!Bundler経由でgemをインストールできませんでした。!!Herokuプッシュが拒否され、Ruby/railsアプリのコンパイルに失敗しました
そこで、HerokuのWebサイトが提案していることをここで試しました
gemfileを変更するには
これから:
gem 'sqlite3'
これに:
gem 'pg'
そこで、このアプローチを試し、「バンドルインストール」を実行しました。しかし、それもうまくいきませんでした。コンソールに次のメッセージが表示されます。
Installing pg (0.13.2) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/AM/.rvm/rubies/ruby-1.9.2-p290/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/AM/.rvm/rubies/ruby-1.9.2-p290/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 /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.13.2 for inspection.
Results logged to /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.13.2/ext/gem_make.out
An error occured while installing pg (0.13.2), and Bundler cannot continue.
Make sure that `gem install pg -v '0.13.2'` succeeds before bundling.
このコマンドを実行しようとしました:
gem install pg
次のエラーメッセージで失敗しました:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/AM/.rvm/rubies/ruby-1.9.2-p290/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/AM/.rvm/rubies/ruby-1.9.2-p290/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 /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.13.2 for inspection.
Results logged to /Users/AM/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.13.2/ext/gem_make.out
誰かがこれを手伝ってくれませんか。iveは障害にぶつかった。次に何をすべきかわからない。ありがとう