无法使Rails 3.1.1资产管道在Heroku Cedar上部署

时间:2011-11-09 20:20:26

标签: ruby-on-rails heroku ruby-on-rails-3.1

我已经按照Rails 3.1 on Heroku Cedar教程,以及另外六篇文章,但无法使其正常工作。

该应用程序在推送Heroku后没有任何CSS / j可用。

Push似乎没有任何错误编译和注入rails3_serve_static_assets:

lsoave@ubuntu:~/rails/github/gitwatcher$ git push heroku +master
Counting objects: 30, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (21/21), done.
Writing objects: 100% (21/21), 1.99 KiB, done.
Total 21 (delta 16), reused 0 (delta 0)

-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.1.rc
       Running: bundle install --without development:test --path vendor/bundle --deployment
       Fetching gem metadata from http://rubygems.org/.......
       Fetching gem metadata from http://rubygems.org/..
       Using rake (0.9.2)
       Using log4r (1.1.9)
       Using XMLCanonicalizer (1.0.1)
       Using multi_json (1.0.3)
       Using activesupport (3.1.1)
       Using builder (3.0.0)
       Using i18n (0.6.0)
       Using activemodel (3.1.1)
       Using erubis (2.7.0)
       Using rack (1.3.5)
       Using rack-cache (1.1)
       Using rack-mount (0.8.3)
       Using rack-test (0.6.1)
       Using hike (1.2.1)
       Using tilt (1.3.3)
       Using sprockets (2.0.3)
       Using actionpack (3.1.1)
       Using mime-types (1.17.2)
       Using polyglot (0.3.3)
       Using treetop (1.4.10)
       Using mail (2.3.0)
       Using actionmailer (3.1.1)
       Using arel (2.2.1)
       Installing tzinfo (0.3.31)
       Using activerecord (3.1.1)
       Using activeresource (3.1.1)
       Using addressable (2.2.6)
       Using bson (1.4.0)
       Using bson_ext (1.4.0)
       Using chunky_png (1.2.5)
       Installing coffee-script-source (1.1.3)
       Using execjs (1.2.9)
       Using coffee-script (2.2.0)
       Using rack-ssl (1.3.2)
       Using json (1.6.1)
       Using rdoc (3.11)
       Using thor (0.14.6)
       Using railties (3.1.1)
       Using coffee-rails (3.1.1)
       Using fssm (0.2.7)
       Using sass (3.1.10)
       Using compass (0.12.alpha.0)
       Using crack (0.1.8)
       Using daemons (1.0.10)
       Using dalli (1.1.3)
       Using eventmachine (0.12.10)
       Using multipart-post (1.1.3)
       Using faraday (0.7.5)
       Using faraday-stack (0.1.3)
       Using haml (3.1.2)
       Using haml-rails (0.3.4)
       Using httparty (0.7.8)
       Installing jquery-rails (1.0.17)
       Using bundler (1.1.rc)
       Using rails (3.1.1)
       Using kaminari (0.12.4)
       Installing systemu (2.4.1)
       Using macaddr (1.5.0)
       Using mongo (1.4.0)
       Using mongoid (2.2.2)
       Using mongoid_taggable_with_context (0.7.2) from https://github.com/lgs/mongoid_taggable_with_context.git (at master)
       Using multi_xml (0.4.1)
       Using net-ldap (0.2.2)
       Using nokogiri (1.5.0)
       Using oa-core (0.3.2)
       Using rest-client (1.6.7)
       Using oa-basic (0.3.2)
       Using pyu-ruby-sasl (0.0.3.3)
       Using rubyntlm (0.1.1)
       Using uuid (2.3.4)
       Using oa-enterprise (0.3.2)
       Using oa-more (0.3.2)
       Using oauth (0.4.5)
       Using oauth2 (0.5.1)
       Using oa-oauth (0.3.2)
       Using ruby-openid (2.1.8)
       Using rack-openid (1.3.1)
       Using ruby-openid-apps-discovery (1.2.0)
       Using oa-openid (0.3.2)
       Using omniauth (0.3.2)
       Using pg (0.11.0)
       Using rufus-scheduler (2.0.10)
       Using sass-rails (3.1.4)
       Using thin (1.2.11)
       Using uglifier (1.0.4)
       Your bundle is complete! It was installed into ./vendor/bundle
       Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Rails plugin injection
       Injecting rails_log_stdout
       Injecting rails3_serve_static_assets
-----> Discovering process types
       Procfile declares types      -> web
       Default types for Ruby/Rails -> console, rake, worker
-----> Compiled slug size is 25.3MB
-----> Launching... done, v25
       http://gitwatcher.com deployed to Heroku

To git@heroku.com:gitwatcher.git
 + 6033342...d6921f3 master -> master (forced update)
lsoave@ubuntu:~/rails/github/gitwatcher$ 

任何帮助?

更新:

在heroku日志中,我注意到两件事:

  1. 可能是没关系,我不知道,......但它似乎寻找标准的公共/ javascripts路径:

    heroku [路由器]:GET gitwatcher.com/javascripts/application.js

  2. ,似乎缺少缓存:

    缓存:[GET /] miss

  3. ...这里有一个日志:

    2011-11-10T19:00:04+00:00 app[web.1]: Started GET "/" for 93.34.206.235 at 2011-11-10 19:00:04 +0000
    2011-11-10T19:00:04+00:00 app[web.1]:   Processing by HomeController#index as HTML
    2011-11-10T19:00:04+00:00 heroku[router]: GET gitwatcher.com/ dyno=web.1 queue=0 wait=0ms service=323ms status=200 bytes=2221
    2011-11-10T19:00:04+00:00 app[web.1]: Rendered home/index.html.haml within layouts/application (3.7ms)
    2011-11-10T19:00:04+00:00 app[web.1]: Completed 200 OK in 107ms (Views: 106.5ms | ActiveRecord: 0.0ms)
    2011-11-10T19:00:04+00:00 app[web.1]: cache: [GET /] miss
    2011-11-10T19:00:04+00:00 app[web.1]: 
    2011-11-10T19:00:04+00:00 app[web.1]: 
    2011-11-10T19:00:04+00:00 heroku[router]: GET gitwatcher.com/javascripts/application.js dyno=web.1 queue=0 wait=0ms service=34ms status=500 bytes=728
    

    @RyanWilcox: ...无论如何我确认这是一个雪松堆:

    lsoave@ubuntu:~/rails/github/gitwatcher$ heroku info --log | grep -i stack
    Stack:          cedar
    lsoave@ubuntu:~/rails/github/gitwatcher$ 
    

    卢卡

2 个答案:

答案 0 :(得分:3)

你确定确定你在雪松上吗?您是否使用heroku stack进行了检查?

例如,在我以前的应用程序中,我确信自己是在雪松上。 Heroku: Cedar and the asset pipeline文章谈到git push heroku ...回复说:

  

准备Rails资产管道

但我在我的应用中没有看到。然后我查了一下,我在竹子上......

答案 1 :(得分:0)

使用mongoid我必须从 config / application.rb 中删除 require'trail / all'

这是我没有看到heroku日志记录的方式:

-----> Preparing app for Rails asset pipeline

因为没有加载链轮。

如果您使用MongoID configuration,则需要将以下行添加到 config / application.rb

需要“sprockets / railtie”