https://github.com/twilio/hurl
readme ファイルの手順では、Heroku で実行中のサーバーを実現できません。
私がしたステップ:
git clone git://github.com/twilio/hurl
cd hurl
gem install bundler
bundle install
heroku create
git push heroku master
heroku open
を使用するheroku logs
と、接続を取得する際にエラーが表示されますPG
"/app/app/models/db.rb:16:in `initialize': could not connect to server: Connection refused (PG::Error)"
私が間違っていることを助けてください..
アップデート:
file:`db.rb`
15 class PostgresDB < AbstractDB
16 CONN = PG::Connection::new(
17 ENV.fetch("POSTGRES_HOST", "localhost"),
18 ENV.fetch("POSTGRES_PORT", 5432),
19 :dbname => ENV.fetch("POSTGRES_DATABASE", "hurls"),
20 :user => ENV.fetch("POSTGRES_USER", "postgres"),
21 :password => ENV.fetch("POSTGRES_PASSWORD", "postgres")
22 )
postgresql の構成 heroku アドオン サーバーから詳細を変更したところ、次のエラーが発生しました。
Starting process with command `bundle exec rackup config.ru -p 16112`
2013-02-14T07:55:41+00:00 app[web.1]: LINE 1: INSERT INTO hurls VALUES ($1::varchar, $2::bytea)
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1137:in `new'
2013-02-14T07:55:41+00:00 app[web.1]: /app/app/models/db.rb:39:in `exec': ERROR: relation "hurls" does not exist (PG::Error)
2013-02-14T07:55:41+00:00 app[web.1]: from /app/app/app.rb:35:in `initialize'
2013-02-14T07:55:41+00:00 app[web.1]: from config.ru:1:in `new'
2013-02-14T07:55:41+00:00 app[web.1]: ^
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.1.0/lib/sinatra/base.rb:1137:in `new'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/bin/rackup:4:in `<top (required)>'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/app/helpers.rb:69:in `each'
2013-02-14T07:55:41+00:00 app[web.1]: from config.ru:13:in `block in <main>'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/rackup:19:in `load'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/rackup:19:in `<main>'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:100:in `start'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/app/helpers.rb:70:in `block in setup_default_hurls'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/app/helpers.rb:69:in `setup_default_hurls'
2013-02-14T07:55:41+00:00 app[web.1]: from config.ru:1:in `<main>'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/app/app.rb:245:in `save_hurl'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/app/models/db.rb:39:in `save'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'
2013-02-14T07:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
2013-02-14T07:55:42+00:00 heroku[web.1]: Process exited with status 1
2013-02-14T07:55:42+00:00 heroku[web.1]: State changed from starting to crashed
2013-02-14T07:55:43+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=my-hurl-*****.herokuapp.com fwd=95.65.21.178 dyno= queue= wait= connect= service= status=503 bytes=
動作するherokuサーバーを達成した人はいますか?