开发者

deploying Rails 3.1 namespaced assets to Heroku

I have a Rails 3.1 application running on Heroku Cedar and it has a custom built Admin panel. Admin is just a namespaced controller/view combination which live in controllers/admin and in views/admin. I also 'namespaced' the assets: called them assets/javascripts/admin.js.coffe and assets/stylesheets/admin.css.scss and include both from layouts/admin/application.html.haml

Heroku perfectly compiles application.(css.scss|js.coffee) to a javascript/stylesheet files. When I visit frontend application it just works.

But when I visit '/admin' I get the following error:

When I visit website in production I get the following error:

2011-09-19T15:47:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/execjs-开发者_开发百科1.2.5/lib/execjs/runtimes.rb:46:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
2011-09-19T15:47:18+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/execjs-1.2.5/lib/execjs.rb:5:in `<module:ExecJS>'
2011-09-19T15:47:18+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/execjs-1.2.5/lib/execjs.rb:4:in `<top (required)>'
2011-09-19T15:47:18+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
2011-09-19T15:47:18+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
2011-09-19T15:47:18+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
2011-09-19T15:47:18+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
2011-09-19T15:47:18+00:00 heroku[web.1]: Process exited
2011-09-19T15:47:20+00:00 heroku[web.1]: State changed from starting to crashed

According to Heroku's documentation I don't need to add gems like therubyracer-heroku to my gemfile. My admin asset files are manifest files and are similar to application asset manifests:

# application.js.coffee
#= require jquery
#= require jquery_ujs

# admin.js.coffee
#= require jquery
#= require jquery_ujs

Any thoughts?

Update 19 sept: As it turns out, admin assets are never compiled into public/assets and neither are present in public/assets/manifest.yml


Did you update your application's PATH, as also mentioned in the Heroku documentation you linked?

I had this same problem, adding 'bin' to the PATH solved it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜