2012-01-14 19 views
4

私はHerokuにいくつかの基本的なアプリを問題なくインストールしました。この1つ(Rails 3.1.3)はうまく見えましたその中で、それはRailsのページRails 3.1.3 on Heroku:(ルートが[GET] "/assets/rails.png"と一致しません)

public/index.html.erb 

を歓迎示したが、私は、そのページを削除したときに、私は問題を抱えて

root :to => 'users#index' 

を設定します。ヒロクのログにはルーティングエラーがあると言われました

ActionController::RoutingError (No route matches [GET] "/assets/rails.png"): 

これは何について知っていますか?

2012-01-14T21:48:29+00:00 heroku[web.1]: Process exited 
2012-01-14T21:48:33+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious) 
2012-01-14T21:48:33+00:00 app[web.1]: >> Maximum connections set to 1024 
2012-01-14T21:48:33+00:00 app[web.1]: >> Listening on 0.0.0.0:32570, CTRL+C to stop 
2012-01-14T21:48:34+00:00 heroku[web.1]: State changed from starting to up 
2012-01-14T21:48:35+00:00 app[web.1]: cache: [GET /] miss 
2012-01-14T21:48:36+00:00 app[web.1]: 
2012-01-14T21:48:36+00:00 app[web.1]: 
2012-01-14T21:48:36+00:00 app[web.1]: Started GET "/assets/rails.png" for 216.251.147.10 at 2012-01-14 13:48:36 -0800 
2012-01-14T21:48:36+00:00 app[web.1]: 
2012-01-14T21:48:36+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/assets/rails.png"): 
2012-01-14T21:48:36+00:00 app[web.1]: 
2012-01-14T21:48:36+00:00 app[web.1]: 
2012-01-14T21:48:36+00:00 app[web.1]: 
2012-01-14T21:48:36+00:00 app[web.1]: cache: [GET /assets/rails.png] miss 
2012-01-14T21:48:35+00:00 heroku[router]: GET mmcarrier.heroku.com/ dyno=web.1 queue=0 wait=0ms service=19ms status=200 bytes=5907 
2012-01-14T21:48:36+00:00 heroku[router]: GET mmcarrier.heroku.com/assets/rails.png dyno=web.1 queue=0 wait=0ms service=30ms status=404 bytes=728 
2012-01-14T21:48:46+00:00 app[web.1]: cache: [GET /] miss 
2012-01-14T21:48:46+00:00 app[web.1]: 
2012-01-14T21:48:46+00:00 app[web.1]: 
2012-01-14T21:48:46+00:00 app[web.1]: Started GET "/assets/rails.png" for 216.251.147.10 at 2012-01-14 13:48:46 -0800 
2012-01-14T21:48:46+00:00 app[web.1]: 
2012-01-14T21:48:46+00:00 app[web.1]: ActionC 

2012-01-14T21:48:46+00:00 app[web.1]: 
2012-01-14T21:48:46+00:00 app[web.1]: 
2012-01-14T21:48:46+00:00 app[web.1]: 
2012-01-14T21:48:46+00:00 app[web.1]: cache: [GET /assets/rails.png] miss 
2012-01-14T21:48:46+00:00 app[web.1]: cache: [GET /favicon.ico] miss 
2012-01-14T21:48:46+00:00 heroku[router]: GET mmcarrier.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=3ms status=200 bytes=0 
2012-01-14T21:48:46+00:00 heroku[router]: GET mmcarrier.heroku.com/ dyno=web.1 queue=0 wait=0ms service=6ms status=200 bytes=5907 
2012-01-14T21:48:46+00:00 heroku[router]: GET mmcarrier.heroku.com/assets/rails.png dyno=web.1 queue=0 wait=0ms service=4ms status=404 bytes=728 
2012-01-14T21:48:59+00:00 app[web.1]: cache: [GET /] miss 
2012-01-14T21:48:59+00:00 heroku[router]: GET mmcarrier.heroku.com/ dyno=web.1 queue=0 wait=0ms service=5ms status=200 bytes=5907 
2012-01-14T21:48:59+00:00 app[web.1]: 
2012-01-14T21:48:59+00:00 app[web.1]: 
2012-01-14T21:48:59+00:00 app[web.1]: Started GET "/assets/rails.png" for 216.251.147.10 at 2012-01-14 13:48:59 -0800 
2012-01-14T21:48:59+00:00 app[web.1]: 
2012-01-14T21:48:59+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/assets/rails.png"): 
2012-01-14T21:48:59+00:00 app[web.1]: 
2012-01-14T21:48:59+00:00 app[web.1]: 
2012-01-14T21:48:59+00:00 app[web.1]: 
2012-01-14T21:48:59+00:00 app[web.1]: cache: [GET /assets/rails.png] miss 
2012-01-14T21:48:59+00:00 heroku[router]: GET mmcarrier.heroku.com/assets/rails.png dyno=web.1 queue=0 wait=0ms service=3ms status=404 bytes=728 
2012-01-14T21:49:18+00:00 app[web.1]: 
2012-01-14T21:49:18+00:00 app[web.1]: 
2012-01-14T21:49:18+00:00 app[web.1]: Started GET "/assets/rails.png" for 216.251.147.10 at 2012-01-14 13:49:18 -0800 
2012-01-14T21:49:18+00:00 app[web.1]: 
2012-01-14T21:49:18+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/assets/rails.png"): 
2012-01-14T21:49:18+00:00 app[web.1]: 
2012-01-14T21:49:18+00:00 app[web.1]: 
2012-01-14T21:49:18+00:00 app[web.1]: 
2012-01-14T21:49:18+00:00 app[web.1]: cache: [GET /assets/rails.png] miss 
2012-01-14T21:49:18+00:00 heroku[router]: GET mmcarrier.heroku.com/assets/rails.png dyno=web.1 queue=0 wait=0ms service=4ms status=404 bytes=728 
2012-01-14T21:49:33+00:00 app[web.1]: cache: [GET /] miss 
2012-01-14T21:49:33+00:00 app[web.1]: 
2012-01-14T21:49:33+00:00 app[web.1]: 
2012-01-14T21:49:33+00:00 app[web.1]: Started GET "/assets/rails.png" for 216.251.147.10 at 2012-01-14 13:49:33 -0800 
2012-01-14T21:49:33+00:00 app[web.1]: 
2012-01-14T21:49:33+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/assets/rails.png"): 
2012-01-14T21:49:33+00:00 app[web.1]: 
2012-01-14T21:49:33+00:00 app[web.1]: 
2012-01-14T21:49:33+00:00 app[web.1]: cache: [GET /assets/rails.png] miss 
2012-01-14T21:49:33+00:00 app[web.1]: 
2012-01-14T21:49:34+00:00 app[web.1]: cache: [GET /favicon.ico] miss 
2012-01-14T21:49:33+00:00 heroku[router]: GET mmcarrier.heroku.com/ dyno=web.1 queue=0 wait=0ms service=6ms status=200 bytes=5907 
2012-01-14T21:49:33+00:00 heroku[router]: GET mmcarrier.heroku.com/assets/rails.png dyno=web.1 queue=0 wait=0ms service=4ms status=404 bytes=728 
2012-01-14T21:49:34+00:00 heroku[router]: GET mmcarrier.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=3ms status=200 bytes=0 
2012-01-14T21:50:21+00:00 app[web.1]: cache: [GET /] miss 
2012-01-14T21:50:21+00:00 heroku[router]: GET mmcarrier.heroku.com/ dyno=web.1 queue=0 wait=0ms service=4ms status=200 bytes=5907 
2012-01-14T21:50:21+00:00 app[web.1]: 
2012-01-14T21:50:21+00:00 heroku[router]: GET mmcarrier.heroku.com/assets/rails.png dyno=web.1 queue=0 wait=0ms service=4ms status=404 bytes=728 
2012-01-14T21:50:21+00:00 app[web.1]: Started GET "/assets/rails.png" for 216.251.147.10 at 2012-01-14 13:50:21 -0800 
2012-01-14T21:50:21+00:00 app[web.1]: 
2012-01-14T21:50:21+00:00 app[web.1]: 
2012-01-14T21:50:21+00:00 app[web.1]: cache: [GET /assets/rails.png] miss 
2012-01-14T21:50:21+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/assets/rails.png"): 
2012-01-14T21:50:21+00:00 app[web.1]: 
2012-01-14T21:50:21+00:00 app[web.1]: 
2012-01-14T21:50:21+00:00 app[web.1]: 
2012-01-14T21:52:42+00:00 heroku[slugc]: Slug compilation started 
2012-01-14T21:52:54+00:00 heroku[api]: Deploy 983a24d by [email protected] 
2012-01-14T21:52:54+00:00 heroku[api]: Release v8 created by [email protected] 
2012-01-14T21:52:54+00:00 heroku[web.1]: State changed from up to bouncing 
2012-01-14T21:52:54+00:00 heroku[web.1]: State changed from bouncing to created 
2012-01-14T21:52:54+00:00 heroku[web.1]: State changed from created to starting 
2012-01-14T21:52:55+00:00 heroku[slugc]: Slug compilation finished 
2012-01-14T21:53:01+00:00 heroku[web.1]: State changed from starting to up 
2012-01-14T21:53:05+00:00 heroku[router]: GET mmcarrier.heroku.com/assets/rails.png dyno=web.1 queue=0 wait=0ms service=37ms status=404 bytes=728 
2012-01-14T21:53:17+00:00 heroku[router]: GET mmcarrier.heroku.com/assets/rails.png dyno=web.1 queue=0 wait=0ms service=5ms status=404 bytes=728 
2012-01-14T21:53:36+00:00 heroku[router]: GET mmcarrier.heroku.com/assets/rails.png dyno=web.1 queue=0 wait=0ms service=2ms status=404 bytes=728 
2012-01-14T21:53:38+00:00 heroku[router]: GET mmcarrier.heroku.com/ dyno=web.1 queue=0 wait=0ms service=107ms status=500 bytes=728 
2012-01-14T21:53:40+00:00 heroku[router]: GET mmcarrier.heroku.com/ dyno=web.1 queue=0 wait=0ms service=20ms status=500 bytes=728 
2012-01-14T21:53:49+00:00 heroku[run.1]: State changed from created to starting 
2012-01-14T21:53:52+00:00 heroku[run.1]: State changed from starting to up 
2012-01-14T21:53:57+00:00 heroku[run.1]: State changed from up to complete 
2012-01-14T21:53:57+00:00 heroku[run.1]: Process exited 
2012-01-14T21:55:15+00:00 heroku[router]: GET mmcarrier.heroku.com/assets/rails.png dyno=web.1 queue=0 wait=0ms service=35ms status=404 bytes=728 
2012-01-14T21:55:17+00:00 heroku[router]: GET mmcarrier.heroku.com/assets/rails.png dyno=web.1 queue=0 wait=0ms service=3ms status=404 bytes=728 
2012-01-14T21:55:22+00:00 heroku[router]: GET mmcarrier.heroku.com/ dyno=web.1 queue=0 wait=0ms service=12ms status=500 bytes=728 
2012-01-14T21:56:18+00:00 heroku[router]: GET mmcarrier.heroku.com/ dyno=web.1 queue=0 wait=0ms service=12ms status=500 bytes=728 

答えて

9

それはあなたがHerokuのにプッシュする前に、あなたの資産をプリコンパイルしていない可能性のように、してみてくださいになります。

rake assets:precompile 
git add . 
etc etc 

私は助けるべきだと思います。詳細については、こちらをご覧ください:http://devcenter.heroku.com/articles/rails31_heroku_cedar

+0

あなたは正しいですが、私はそれをしませんでしたが、なぜRailsがページを歓迎しましたか? – Leahcim

+1

ウェルカムページに必要なアセットがないために機能しました。すべてのスタイルはpublic/index.htmlファイルに含まれており、javascriptや画像は必要ありません。お役に立てて嬉しいです! –

+0

シンプルな、それは資産ではない、それは眺めだ。 – Hauleth

11

乱雑あなたのgitをプリコンパイルする必要はありませんが!

Herokuのは、あなたがUPDATE 16日july2012

3.2.xのレールapplication.rb

config.assets.initialize_on_precompile = false 

にこれを追加レール3.1.xへのあなたの資産

をプリコンパイルします

i ActiveRecordとdatabase.ymlに問題があるようです!通常のデータベースを使用せずにMongoDBを使用する場合は、上記は必要ありません。ただし、初期化時にactiverecordがデータベーステーブルを読み込むので、initilizeを無効にする必要がありますが、herokuのプリコンパイルフェーズではデータベースを使用できません。

MongoDBは不要です

/UPDATE

レール3.2.xのapplication.rbのトップを見てください。 config/application.rbで

:OMAのコメントは私が、私がしなければならなかった

if defined?(Bundler) 
    # If you precompile assets before deploying to production, use this line 
    "OMA - comment this line" 
    #Bundler.require(*Rails.groups(:assets => %w(development test))) 
    # If you want your assets lazily compiled in production, use this line 
    "OMA - uncomment this line" 
    Bundler.require(:default, :assets, Rails.env) 
end 
+0

私はすべてが更新された状態でRails 3.2.6を実行しています。それ以外の場合は、rails.pngは表示されません。私はRailsチュートリアルのオンラインブックに従っています。 – tentimes

+1

Dang ...私はJesseの答えを試してみる前にこれを読んでほしかった。単にプリコンパイルするだけでは役に立ちませんでした。そして、ええ...今、私のgit repoは肥大化しています。 –

2

レール3.2.3と怠惰開始(Herokuの上の)薄いと協力を得るためには、明確にするために追加されている

設定/環境/ production.rbで
if defined?(Bundler) 
    # If you precompile assets before deploying to production, use this line 
    # Bundler.require(*Rails.groups(:assets => %w(development test))) 
    # If you want your assets lazily compiled in production, use this line 
    Bundler.require(:default, :assets, Rails.env) 
end 

... 


module Romulo 
    class Application < Rails::Application 

... 

    # Enable the asset pipeline 
    config.assets.enabled = true 

    # Version of your assets, change this if you want to expire all your assets 
    config.assets.version = '1.0' 

    # get precompilation working on heroku: 
    config.assets.initialize_on_precompile = true 

    config.serve_static_assets = false 
    end 
end 

# Compress JavaScripts and CSS 
config.assets.compress = true 

# Don't fallback to assets pipeline if a precompiled asset is missed 
config.assets.compile = true 

# Generate digests for assets URLs 
config.assets.digest = true 

資産をプリコンパイルする必要はありません。

関連する問題