0

My rails app uses Rails 3.2.15. When I try to deploy to Heroku, I get the error:

Asset logical path has no extension: ]

In other examples I've seen of the "asset logical path" error, the element after the colon was the filename. Why does it think there is a file called "]"?

Here is the full error:

 /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/asset.rb:36:in `initialize'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/base.rb:380:in `new'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/base.rb:380:in `build_asset'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/index.rb:94:in `block in build_asset'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/caching.rb:58:in `cache_asset'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/index.rb:93:in `build_asset'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/base.rb:287:in `find_asset'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/index.rb:61:in `find_asset'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/manifest.rb:211:in `block in find_asset'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/manifest.rb:257:in `benchmark'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/manifest.rb:210:in `find_asset'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/manifest.rb:119:in `block in compile'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/manifest.rb:118:in `each'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/sprockets/manifest.rb:118:in `compile'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-rails-2.0.0.backport1/lib/sprockets/rails/task.rb:60:in `block (3 levels) in define'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2.backport2/lib/rake/sprocketstask.rb:146:in `with_logger'
       /tmp/build_4d16c741-7af1-443a-b0f0-8aad5d279d8f/vendor/bundle/ruby/1.9.1/gems/sprockets-rails-2.0.0.backport1/lib/sprockets/rails/task.rb:59:in `block (2 levels) in define'
       Tasks: TOP => assets:precompile
       (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.
 !

 !     Push rejected, failed to compile Multipack app

I can recreate this error locally by running the following command

 bundle exec rake assets:precompile

Some background:

I'm trying to integrate bootstrap-sass with my Rails 3.2 app. I followed the install instructions for 3.2.x outlined on the gem page:

https://github.com/twbs/bootstrap-sass

This works locally, but when I try to deploy, I get the errors described above.

scientiffic
  • 9,045
  • 18
  • 76
  • 149
  • To confirm you ran "RAILS_ENV=production bundle exec rake assets:precompile --trace" in development before [ushing to Heroku ? I also remember once having to run "rake assets:clean" and then precompile before push to Heroku. – user1854802 Sep 18 '14 at 23:15
  • thanks for your help. when i try running the first line, I get the error database project_production doesn't appear (which it doesn't). what does the line you shared do? – scientiffic Sep 19 '14 at 01:33
  • I'm sure you read this post? http://stackoverflow.com/questions/20856247/rails4-sprockets-asset-logical-path-has-no-extension – dav1dhunt Sep 19 '14 at 02:13
  • My understanding - indevelopment the java and coffescript is pre-compiled with each action a controller does. In the production evironment, Heroku , pre-complilation is done (e.g java and coffeescript compressed etc) BEFORe code executed. Any time you make a change to the javascript/coffeescript in development this needs to be pre-compiled before you see these changes in Heroku. To confirm you are pre-compiling in the development environment ? – user1854802 Sep 19 '14 at 02:13
  • @txdavidtx yes I looked at that post. Even though I'm using Rails 3.2 I tried adding the suggestion, and it did nothing to fix th eproblem. – scientiffic Sep 19 '14 at 02:26
  • @user1854802 yes I'm precompiling in development – scientiffic Sep 19 '14 at 02:28
  • Do you have a file in one of the asset folders with no extension? – Frederick Cheung Sep 19 '14 at 07:21
  • is there an easy way to check this? – scientiffic Sep 19 '14 at 14:13
  • Could you post your asset manifests `application.css` and `application.js` ? – sjaime Sep 19 '14 at 19:33

1 Answers1

0

If you're still on this or other people find this like I did, the trouble is with putting anything without an extension in the app/assets, you can safely move files to vendor/assets to avoid this error. For instance I recently installed third party files with bower and set their location to app/assets, but had trouble pushing to heroku. After pulling them out and into vendor/assets it worked fine. Also see: https://github.com/sstephenson/sprockets/issues/347 and https://github.com/stve/bower/pull/4/files for the issue and resolution.