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.
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.
Related
Rails 4.1.6, Ruby 2.1. We use CircleCI, and so far it's been working great. On development, our app runs fine, but today an issue cropped up on CircleCI and I don't know how to fix the problem. Could someone help?
I updated our gems yesterday, but we didn't have any issues until today (perhaps there was some caching going on?). I've rebuilt the build again and again (also selecting the option to clear the cache, but still no success), and the error persists.
I believe all of the tests pass, but here is where the error starts:
I, [2014-10-11T04:14:07.529348 #9596] INFO -- : Writing /home/ubuntu/my-app-name/public/assets/jasmine/grunt/templates/SpecRunner-af60bb7e74338e42129e060a5ef78fcc.html
rake aborted!
NameError: undefined local variable or method `jasmine_version' for #<#<Class:0x00000002b8b1e8>:0x0000000d8e6540>
(in /home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/rails-assets-jasmine-2.0.0/app/assets/templates/jasmine/src/templates/example_project_jasmine_tags.html.erb)
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/rails-assets-jasmine-2.0.0/app/assets/templates/jasmine/src/templates/example_project_jasmine_tags.html.erb:1:in `block in singleton class'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/rails-assets-jasmine-2.0.0/app/assets/templates/jasmine/src/templates/example_project_jasmine_tags.html.erb:-5:in `instance_eval'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/rails-assets-jasmine-2.0.0/app/assets/templates/jasmine/src/templates/example_project_jasmine_tags.html.erb:-5:in `singleton class'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/rails-assets-jasmine-2.0.0/app/assets/templates/jasmine/src/templates/example_project_jasmine_tags.html.erb:-7:in `__tilt_5657380'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:197:in `block in evaluate'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `each'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `evaluate'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:12:in `initialize'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:374:in `new'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:374:in `block in build_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:395:in `circular_call_protection'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:373:in `build_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:94:in `block in build_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58:in `cache_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:93:in `build_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:287:in `find_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:61:in `find_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/bundled_asset.rb:16:in `initialize'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in `new'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in `build_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:94:in `block in build_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58:in `cache_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:93:in `build_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:287:in `find_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:61:in `find_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:211:in `block in find_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:257:in `benchmark'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:210:in `find_asset'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:119:in `block in compile'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in `each'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in `compile'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/non-stupid-digest-assets-1.0.4/lib/non-stupid-digest-assets.rb:31:in `compile_with_non_digest'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-2.1.4/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-2.11.0/lib/rake/sprocketstask.rb:146:in `with_logger'
/home/ubuntu/my-app-name/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-2.1.4/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace) bundle exec rake assets:precompile returned exit code 1bundle exec rake assets:precompile returned exit code 1bundle exec rake assets:precompile returned exit code 1bundle exec rake assets:precompile returned exit code 1
I think this may have been an issue with updating our gems. We I did a gem update, the version of Jasmine Core was fixed at 2.0.0, whereas Jasmine was updated from 2.0.2 to 2.0.3. Of course, I did update a number of other gems, and I went through our Gemfile and removed some version specifications.
Additionally, in our circle.yml file, our pre tasks included:
bundle exec rake assets:clobber
bundle exec rake tmp:clear
bundle exec rake assets:precompile
These were originally added because of some earlier problems we were having. I removed these.
I am also guessing that CircleCI was using cached gems, so the problem didn't appear immediately.
Anyways, this appears to have fixed the problem.
I'm not sure about what's going on here, but it could be due to wrong gem groups in your Gemfile. Try taking the jasmine gem out of any groups such as :development or :test and placing it along with the gems required for all environments.
I am unable to push to Heroku. When I attempt to I get an ExecJS::ProgramError: of some kind or another. I have had multiple people check my code and no one can seem to figure it out. It appears that I have something saved wrong possibly.
When I do git push heroku master I get the following when it tries to precompile the assets:
Running: rake assets:precompile
rake aborted!
ExecJS::ProgramError: Unexpected character '#' (line: 16164, col: 0, pos: 471385)
Error
at new JS_Parse_Error (/tmp/execjs20140502-719-9ngq7y.js:2357:10754)
at js_error (/tmp/execjs20140502-719-9ngq7y.js:2357:10973)
at parse_error (/tmp/execjs20140502-719-9ngq7y.js:2357:12691)
at Object.next_token [as input] (/tmp/execjs20140502-719-9ngq7y.js:2357:17713)
at next (/tmp/execjs20140502-719-9ngq7y.js:2357:19012)
at semicolon (/tmp/execjs20140502-719-9ngq7y.js:2357:19857)
at simple_statement (/tmp/execjs20140502-719-9ngq7y.js:2357:22669)
at /tmp/execjs20140502-719-9ngq7y.js:2357:20820
at /tmp/execjs20140502-719-9ngq7y.js:2357:20069
at /tmp/execjs20140502-719-9ngq7y.js:2358:40
(in /tmp/build_e82cf52d-86e5-45ea-83e9-
9841d4de5c60/app/assets/javascripts/application.js)/tmp/build_e82cf52d-86e5-45ea-
83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/execjs-
2.0.2/lib/execjs/external_runtime.rb:68:in `extract_result'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/execjs-2.0.2/lib/execjs/external_runtime.rb:28:in `block in exec'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/execjs-2.0.2/lib/execjs/external_runtime.rb:41:in `compile_to_tempfile'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/execjs-2.0.2/lib/execjs/external_runtime.rb:27:in `exec'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/uglifier-2.5.0/lib/uglifier.rb:186:in `really_compile'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/uglifier-2.5.0/lib/uglifier.rb:110:in `compile'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/uglifier_compressor.rb:25:in `evaluate'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:197:in `block in evaluate'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `each'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `evaluate'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/bundled_asset.rb:25:in `initialize'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in `new'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:377:in `build_asset'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:94:in `block in build_asset'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/caching.rb:58:in `cache_asset'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:93:in `build_asset'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/base.rb:287:in `find_asset'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/index.rb:61:in `find_asset'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:211:in `block in find_asset'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:257:in `benchmark'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:210:in `find_asset'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:119:in `block in compile'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in `each'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/sprockets/manifest.rb:118:in `compile'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:60:in `block (3 levels) in define'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-2.11.0/lib/rake/sprocketstask.rb:146:in `with_logger'
/tmp/build_e82cf52d-86e5-45ea-83e9-9841d4de5c60/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.1/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 Ruby app
To git#heroku.com:dumb-law.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:dumb-law.git'
I had the same problem and finally discovered the cause in the console output of the website, where it showed me an error of a js-file with illegal tokens. In my case, it was an empty, auto-generated coffeescript file, that I recklessly renamed into a js file, which doesn't use '#' for comments. The site still worked without problems but the precompilation did not. Removing the file solved my problem. Maybe you can find something similar in your js-console :)
Commenting out in production.rb resolved the problem for me
#config.assets.js_compressor = :uglifier
The answer is in config/environments/production.rb you have to change config.assets.compile = false to config.assets.compile = true
One reason this may happen is when renaming auto-generated coffee-scripts to js. They contain:
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
Which causes this error (because # should be changed to // in js).
I just installed carrierwave and have set my rails 4 app up to store images on Amazon s3 through fog. The app was working and deploying to Heroku with Carrierwave (but images were getting purged with dyno). After some initial issues I got it working on my localhost (as far as I could tell).
Now I am having trouble pushing the new version to Heroku. I have reset the DATABASE. Precompiled the assets and now trying to migrate the database. Below is the error I'm getting.
Running `rake db:migrate` attached to terminal... up, run.6517
rake aborted!
uninitialized constant Sprockets::Helpers
/app/app/uploaders/image_uploader.rb:12:in `<class:ImageUploader>'
/app/app/uploaders/image_uploader.rb:4:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:464:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:464:in `block in eager_load!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:462:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:462:in `eager_load!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:347:in `eager_load!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `each'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/app/config/environment.rb:5:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
Tasks: TOP => db:migrate => environment
I have tried to include and not include Sprockets in the Uploader file and get the same error either way. I understand that Sprockets is no longer included in the master for Rails 4. I have now installed the sprockets-rails and sprockets-helper gems. I have also tried to require them at the top of the file (I don't understand this completely, but following this suggestion https://github.com/petebrowne/sprockets-helpers). Nothing has worked. Any suggestions about how I can go about resolving this. How do I initialize Sprockets::Helpers. Thanks.
I was making a pretty silly mistake. I had corrected files in my app and as committing the changes to the master, but I kept running the heroku run rake db:migrate command and getting the same error, so I didn't think I have resolved it yet. I had forgotten to push the new version to heroku! Hence the reason for still getting the same error.
Also, in case anyone else has a similar issue. Make sure you have fixed this:
https://github.com/carrierwaveuploader/carrierwave/issues/1020
Im trying to deploy my application in heroku. My app uses mongohq for the database. I have added the respective add-on to my app.
When deploying the app i get this error.
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
** Notice: The native BSON extension was not loaded. **
For optimal performance, use of the BSON extension is recommended.
To enable the extension make sure ENV['BSON_EXT_DISABLED'] is not set
and run the following command:
gem install bson_ext
If you continue to receive this message after installing, make sure that
the bson_ext gem is in your load path.
rake aborted!
Invalid DATABASE_URL
(erb):9:in `rescue in <main>'
(erb):6:in `<main>'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/configuration.rb:106:in `database_configuration'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/railtie.rb:174:in `block (2 levels) in <class:Railtie>'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:27:in `each'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/railtie.rb:173:in `block in <class:Railtie>'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/tmp/build_3o2y20a7ewhl/config/environment.rb:5:in `<top (required)>'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.0/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby/Rails app
It looks like is trying to write the DATABASE_URL in database.yml but i don't use one. I just use monogoid.yml and set the proper ENV var MONGOHQ_URL.
Do i need to setup any configuration so heroku can detect i'm using mongo as my database?
EDIT:
My mongoid.yml file looks like this.
production:
sessions:
default:
uri: <%= ENV['MONGOHQ_URL'] %>
I have read that article, i'm following those steps.
In case anyone is going through the same, i had in my application.rb a reference to active record that i needed to take away:
#require "active_record/railtie"
Also double check your environments files, in some cases you could have some active_record configuration code.
Hope it helps.
I'm currently working on a project that requires the ZXing gem (http://rubydoc.info/gems/zxing/0.3.1/frames) for decoding images of barcodes. In my attempts to install the gem locally, I ran into some complications with dependencies, but those were resolved by adding the ffi (http://rubygems.org/gems/ffi) and spoon (http://rubygems.org/gems/spoon) gems to my Gemfile, in addition to jruby-jars. Now, everything is working fine on my local machines (an iMac and a MacBook Pro, both running Lion). However, when I try to push the application to Heroku, the terminal hangs on the following line for several minutes:
-----> Writing config/database.yml to read from DATABASE_URL
Then finally gives me the error message:
/app/slug-compiler/lib/utils.rb:62:in `block (2 levels) in spawn': command='/app/slug-compiler/lib/../buildpacks/ruby/bin/compile /tmp/build_31wo219fllz4d /app/tmp/repo.git/.cache' exit_status=0 out='' event=timeout elapsed=581.3388702869415 (Utils::TimeoutError)
from /app/slug-compiler/lib/utils.rb:48:in `loop'
from /app/slug-compiler/lib/utils.rb:48:in `block in spawn'
from /app/slug-compiler/lib/utils.rb:44:in `popen'
from /app/slug-compiler/lib/utils.rb:44:in `spawn'
from /app/slug-compiler/lib/buildpack.rb:35:in `block in compile'
from /app/slug-compiler/lib/buildpack.rb:33:in `fork'
from /app/slug-compiler/lib/buildpack.rb:33:in `compile'
from /app/slug-compiler/lib/slug.rb:464:in `block in run_buildpack'
from /app/slug-compiler/lib/utils.rb:117:in `log'
from /app/slug-compiler/lib/slug.rb:702:in `log'
from /app/slug-compiler/lib/slug.rb:463:in `run_buildpack'
from /app/slug-compiler/lib/slug.rb:107:in `block (2 levels) in compile'
from /app/slug-compiler/lib/utils.rb:98:in `block in timeout'
from /usr/local/lib/ruby/1.9.1/timeout.rb:58:in `timeout'
from /app/slug-compiler/lib/utils.rb:98:in `rescue in timeout'
from /app/slug-compiler/lib/utils.rb:93:in `timeout'
from /app/slug-compiler/lib/slug.rb:96:in `block in compile'
from /app/slug-compiler/lib/utils.rb:117:in `log'
from /app/slug-compiler/lib/slug.rb:702:in `log'
from /app/slug-compiler/lib/slug.rb:95:in `compile'
from /app/slug-compiler/bin/slugc:85:in `block in <main>'
from /app/slug-compiler/lib/slug.rb:472:in `block in lock'
from /app/slug-compiler/lib/repo_lock.rb:44:in `call'
from /app/slug-compiler/lib/repo_lock.rb:44:in `run'
from /app/slug-compiler/lib/slug.rb:472:in `lock'
from /app/slug-compiler/bin/slugc:66:in `<main>'
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.application-testing-account:integrating-zxing-on-heroku.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.application-testing-account:integrating-zxing-on-heroku.git'
The problem seems to be caused by the ZXing gem and/or its dependencies (ffi, spoon). If I remove zxing from my Gemfile, Heroku compiles the application and everything works fine. Upon re-adding the gem, I experience the same problems. I've also tried setting config.assets.initialize_on_precompile to both true and false in my application.rb, but to no avail. I'm kind of stumped as to what to do now.
My application is on the Cedar stack and using PostgreSQL in development and production.
Could anyone offer any suggestions?
Yeah, unfortunately you can't use anything with C++ or Java dependencies. I'm having trouble finding a QR decoder that's pure ruby (and works well).