railsの設定
1. Ensure you have defined default url options in your environments files. Here
is an example of default_url_options appropriate for a development environment
in config/environments/development.rb:config.action_mailer.default_url_options = { :host => 'localhost:3000' }
In production, :host should be set to the actual host of your application.
とのことなので
$ vim config/environments/development.rb# 適当に追加
config.action_mailer.default_url_options = { :host => 'localhost:3000' }$ vim config/environments/production.rb
# yourappを自分のアプリに変更
config.action_mailer.default_url_options = { :host => 'yourapp.heroku.com' }
2. Ensure you have defined root_url to *something* in your config/routes.rb.
For example:root :to => "home#index"
# ちゃんとconfig/routes.rbでroot設定しとけよな!
3. Ensure you have flash messages in app/views/layouts/application.html.erb.
For example:
<%= notice %>
<%= alert %>
# メッセージ出したいらしいので、layoutの適当な場所に置きましょう。僕の場合置いたら表示崩れてうざくなった。
4. If you are deploying Rails 3.1 on Heroku, you may want to set:
config.assets.initialize_on_precompile = false
On config/application.rb forcing your application to not access the DB
or load models when precompiling your assets.# やっとかないとrake asset時に
- > Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
Tasks: TOP => environment
(See full trace by running task with --trace)
Precompiling assets failed, enabling runtime asset compilation
Injecting rails31_enable_runtime_asset_compilation
Please see this article for troubleshooting help:
http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting# つって怒られるのでやっときましょう。