https://github.com/twilio/hurl
我无法通过自述文件中的步骤在 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服务器吗?