まず、XEROUND アドオンを使用して、Heroku で Ruby on Rails アプリケーションを正常に構築した人がいるかどうかを知りたいです。
私の PHP アプリは、XEROUND アドオン (同じデータベース) で正常に動作します。ただし、Ruby アプリケーションの起動時にエラーが発生します。申し訳ございません。不具合が発生しました。
私の開発マシンで、実行すると:
rails server -e production
プログラムは問題なく起動します。
コードを Heroku にプッシュしてアプリを起動すると、Were 残念エラーが発生します。
何か案は?データベース変数が割り当てられた直後に出力する方法はありますか? 私の知る限り、これはアクティブ レコード アダプターを変更することを意味します。これはRuby自体の問題でしょうか?接続プールに入る必要さえありましたか?XEROUND を Heroku 以外で (アドオンとしてではなく) 使用したほうがよいでしょうか?
私のdatabase.ymlには含まれています
production:
adapter: mysql2
encoding: utf8
database: <%= ENV['XEROUND_DATABASE_NAME'] %>
username: <%= ENV['XEROUND_DATABASE_USERNAME'] %>
password: <%= ENV['XEROUND_DATABASE_PASSWORD'] %>
host: <%= ENV['XEROUND_DATABASE_HOST'] %>
port: <%= ENV['XEROUND_DATABASE_PORT'] %>
値をハードコーディングすると、同じメッセージが表示されます。
Heroku のビルド情報:
git push heroku master
Counting objects: 15, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 1.19 KiB, done.
Total 10 (delta 7), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.1
Running: bundle install --without development:test --path vendor/bundle - -binstubs bin/
Fetching gem metadata from ....rubygems.org/.........
Using rake (0.9.2.2)
Using i18n (0.6.1)
Using multi_json (1.3.6)
Using activesupport (3.2.1)
Using builder (3.0.3)
Using activemodel (3.2.1)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.1)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.1)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.1)
Using mysql2 (0.3.11)
Using activerecord-mysql2-adapter (0.0.3)
Using activeresource (3.2.1)
Using bundler (1.2.1)
Using coffee-script-source (1.3.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.5)
Using rdoc (3.12)
Using thor (0.14.6)
Using railties (3.2.1)
Using coffee-rails (3.2.2)
Using jquery-rails (2.1.3)
Using rails (3.2.1)
Using sass (3.2.1)
Using sass-rails (3.2.5)
Using uglifier (1.3.0)
Your bundle is complete! It was installed into ./vendor/bundle
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Detected manifest.yml, assuming assets were compiled locally
-----> Rails plugin injection
Injecting rails_log_stdout
Injecting rails3_serve_static_assets
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size: 8.7MB
-----> Launching... done, v18
....shielded-brushlands-3293.herokuapp.com deployed to Heroku
To git@heroku.com:shielded-brushlands-3293.git
73c5cb6..c391a47 master -> master
Heroku ログには次のように表示されます。
2012-09-30T00:58:10+00:00 app[web.1]: => Booting WEBrick
2012-09-30T00:58:10+00:00 app[web.1]: => Rails 3.2.1 application starting in production on ...0.0.0.0:6832
2012-09-30T00:58:10+00:00 app[web.1]: => Call with -d to detach
2012-09-30T00:58:10+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-09-30T00:58:10+00:00 app[web.1]: Started GET "/" for 76.87.97.210 at 2012-09-30 00:58:10 +0000
2012-09-30T00:58:15+00:00 heroku[router]: GET shielded-brushlands-3293.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=4529ms status=500 bytes=643
2012-09-30T00:58:15+00:00 app[web.1]: ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/rack/logger.rb:26:in `call_app'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/rack/logger.rb:16:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/rack/log_tailer.rb:14:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/request_id.rb:22:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/static.rb:53:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
2012-09-30T00:58:15+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
2012-09-30T00:58:15+00:00 app[web.1]:
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/engine.rb:479:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/query_cache.rb:67:in `rescue in call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/application.rb:220:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: cache: [GET /] miss
2012-09-30T00:58:15+00:00 app[web.1]:
2012-09-30T00:58:15+00:00 app[web.1]:
2012-09-30T00:58:15+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/query_cache.rb:61:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:405:in `_run__2306900267479677068__call__3522025195442796026__callbacks'
2012-09-30T00:58:15+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:405:in `__run_callback'
2012-09-30T00:58:15+00:00 heroku[router]: GET shielded-brushlands-3293.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=17ms status=200 bytes=0
2012-09-30T00:58:15+00:00 app[web.1]: cache: [GET /favicon.ico] miss, store
gemfile.lock
GEM
remote: ....rubygems.org/
specs:
actionmailer (3.2.1)
actionpack (= 3.2.1)
mail (~> 2.4.0)
actionpack (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.1)
rack (~> 1.4.0)
rack-cache (~> 1.1)
rack-test (~> 0.6.1)
sprockets (~> 2.1.2)
activemodel (3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
activerecord (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
arel (~> 3.0.0)
tzinfo (~> 0.3.29)
activerecord-mysql2-adapter (0.0.3)
mysql2
activeresource (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
activesupport (3.2.1)
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
builder (3.0.0)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.3.3)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.4)
jquery-rails (2.1.1)
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
json (1.7.5)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.19)
multi_json (1.3.6)
mysql2 (0.3.11)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.2.1)
actionmailer (= 3.2.1)
actionpack (= 3.2.1)
activerecord (= 3.2.1)
activeresource (= 3.2.1)
activesupport (= 3.2.1)
bundler (~> 1.0)
railties (= 3.2.1)
railties (3.2.1)
actionpack (= 3.2.1)
activesupport (= 3.2.1)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
sass (3.2.1)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.33)
uglifier (1.2.7)
execjs (>= 0.3.0)
multi_json (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
activerecord-mysql2-adapter
coffee-rails (~> 3.2.1)
jquery-rails
mysql2
rails (= 3.2.1)
sass-rails (~> 3.2.3)
uglifier (>= 1.0.3)