I am pushing to an app I haven't updated in months and am running into this problem. I only changed a few variables in my code. No idea why its suddenly doing this to me.
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
To git#heroku.com:myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:myapp.git'
rake aborted!
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `new'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `connect'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initialize'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/model_schema.rb:308:in `clear_cache!'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/railtie.rb:104:in `block (2 levels) in <class:Railtie>'
The most common reasons for asset recompilation issues can be found here on the heroku support page.
Based on the mention of Postgres in the error message, I would try changing the following line in your config/application.rb to false like so: config.assets.initialize_on_precompile = false.
You should prevent initializing your application and connecting to the database by ensuring that the following line is in your config/application.rb:
config.assets.initialize_on_precompile = false
Related
While trying to deploy in the "Ruby 3.0 running on 64bit Amazon Linux 2/3.6.2" platform, both using the eb deploy command or manually uploading a zipped version of my project, it seems the Postgresql service is not running in my instance since I get the next in eb-engile.log:
2023/01/17 17:31:04.238133 [ERROR] An error occurred during execution of command [app-deploy] - [rake tasks]. Stop running the command. Error: running rake task db:migrate failed with error command bundle exec rake db:migrate failed with error Command /bin/su webapp -c bundle exec rake db:migrate failed with error exit status 1. Stderr:rake aborted!
ActiveRecord::ConnectionNotEstablished: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/postgresql_adapter.rb:83:in `rescue in new_client'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_handling.rb:283:in `connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <main>'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/railties/databases.rake:90:in `each'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <main>'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/elasticbeanstalk/.rbenv/versions/3.0.5/bin/bundle:25:in `load'
/opt/elasticbeanstalk/.rbenv/versions/3.0.5/bin/bundle:25:in `<main>'
Caused by:
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/pg-1.2.3/lib/pg.rb:58:in `initialize'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/pg-1.2.3/lib/pg.rb:58:in `new'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/pg-1.2.3/lib/pg.rb:58:in `connect'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_handling.rb:283:in `connection'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <main>'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/railties/databases.rake:90:in `each'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <main>'
/var/app/staging/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/elasticbeanstalk/.rbenv/versions/3.0.5/bin/bundle:25:in `load'
/opt/elasticbeanstalk/.rbenv/versions/3.0.5/bin/bundle:25:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Although, when trying to run the /bin/su webapp -c bundle exec rake db:migrate command as root (please notice that, I am invoking bundler then as the webapp user), I get different kind of error (trying to install a missing gem?):
Bundler::PermissionError: There was an error while trying to write to
`/var/app/staging/vendor/bundle/ruby/3.0.0/cache/public_suffix-5.0.1.gem`. It is likely that you
need to grant write permissions for that path.
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/shared_helpers.rb:105:in `rescue in
filesystem_access'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/shared_helpers.rb:102:in
`filesystem_access'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/rubygems_integration.rb:479:in `block in
download_gem'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/retry.rb:40:in `run'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/retry.rb:30:in `attempt'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/rubygems_integration.rb:470:in
`download_gem'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/source/rubygems.rb:485:in `download_gem'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/source/rubygems.rb:447:in `fetch_gem'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/source/rubygems.rb:431:in
`fetch_gem_if_possible'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/source/rubygems.rb:158:in `install'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/installer/gem_installer.rb:54:in
`install'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/installer/parallel_installer.rb:155:in
`do_install'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/installer/parallel_installer.rb:140:in
`install_serially'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/installer/parallel_installer.rb:91:in
`call'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/installer/parallel_installer.rb:67:in
`call'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/installer.rb:244:in
`install_in_parallel'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/installer.rb:201:in `install'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/installer.rb:89:in `block in run'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/process_lock.rb:19:in `rescue in lock'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/process_lock.rb:15:in `lock'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/installer.rb:71:in `run'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/installer.rb:23:in `install'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/cli/install.rb:62:in `run'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:260:in `block in install'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/settings.rb:131:in `temporary'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:259:in `install'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in
`run'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in
`invoke_command'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in
`dispatch'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:34:in `dispatch'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in
`start'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:28:in `start'
/opt/rubies/ruby-3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.4.1/exe/bundle:45:in `block in <top
(required)>'
/opt/rubies/ruby-3.0.5/lib/ruby/site_ruby/3.0.0/bundler/friendly_errors.rb:117:in
`with_friendly_errors'
/opt/rubies/ruby-3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.4.1/exe/bundle:33:in `<top
(required)>'
/opt/elasticbeanstalk/.rbenv/versions/3.0.5/bin/bundle:25:in `load'
/opt/elasticbeanstalk/.rbenv/versions/3.0.5/bin/bundle:25:in `<main>'
An error occurred while installing public_suffix (5.0.1), and Bundler cannot
continue.
In Gemfile:
capybara was resolved to 3.38.0, which depends on
addressable was resolved to 2.8.1, which depends on
public_suffix
It also seems the postgresql service is not installed (checked installed services starting with the "post" string):
[root#ip************ staging]# systemctl list-unit-files | grep post
postfix.service enabled
So, the question is, how do I make the eb deploy command run without failing? given that:
I see one error using eb deploy that highlights a failing rake db:migrate command but, when trying to running it manually after connecting through SSH it throws a different error; the one that mentions public_suffix. This seems unexpected.
The postgresql service should be installed in AWS's managed platform, as with previous versions
Adding a database to your Elastic Beanstalk environment
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.managing.db.html
It looks like your app is trying to connect to a local database server:
Caused by:
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
What are the contents of your config/database.yml? Is it reading environment variables that elasticbeanstalk knows to pass in? Does your RDS instance have the right access rules set up to allow connections from EB?
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'm just sitting here trying to deploy my app to heroku for the last 4 hours.
I just want to push my changes, but the following appears each and every time I push my changes.
rake aborted!
The driver encountered an unknown error: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
I'm running a rails 4.0.2 application with jruby 1.7.4 and ruby 1.9.3.
I've already used this extension.
https://devcenter.heroku.com/articles/labs-user-env-compile
But it won't help either.
Here's a more detailed stack trace
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-jdbc-adapter-1.3.5/lib/arjdbc/jdbc/connection.rb:23:in `initialize'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-jdbc-adapter-1.3.5/lib/arjdbc/jdbc/adapter.rb:68:in `initialize'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-jdbc-adapter-1.3.5/lib/arjdbc/postgresql/adapter.rb:1275:in `initialize'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-jdbc-adapter-1.3.5/lib/arjdbc/jdbc/connection_methods.rb:12:in `jdbc_connection'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-jdbc-adapter-1.3.5/lib/arjdbc/postgresql/connection_methods.rb:45:in `postgresql_connection'
org/jruby/RubyBasicObject.java:1709:in `__send__'
org/jruby/RubyKernel.java:2213:in `send'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `checkout'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `connection'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-4.0.2/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-4.0.2/lib/active_record/connection_handling.rb:53:in `connection'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-4.0.2/lib/active_record/model_schema.rb:203:in `table_exists?'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activerecord-4.0.2/lib/active_record/attribute_methods.rb:123:in `attribute_method?'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activemodel-4.0.2/lib/active_model/validations/acceptance.rb:16:in `setup'
org/jruby/RubyArray.java:2651:in `reject!'
org/jruby/RubyArray.java:2614:in `reject'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activemodel-4.0.2/lib/active_model/validations/acceptance.rb:16:in `setup'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activemodel-4.0.2/lib/active_model/validations/with.rb:88:in `validates_with'
org/jruby/RubyArray.java:1617:in `each'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activemodel-4.0.2/lib/active_model/validations/with.rb:86:in `validates_with'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/vendor/bundle/jruby/1.9/gems/activemodel-4.0.2/lib/active_model/validations/acceptance.rb:51:in `validates_acceptance_of'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/app/models/user.rb:20:in `User'
/tmp/build_f358186b-fb40-492f-93f9-f05fa7b3f751/app/models/user.rb:1:in `(root)'
So this one was really really odd.
After nearly one whole day debugging I was able to solve the issue.
It has nothing to do with jRuby, nor with the active-record Adapter (you get a very similar error if you push this to heroku with a ruby-Runtime rather than a jruby-Runtime).
The issues was caused by this line in one of my models
validates_presence_of :terms_of_service
After commenting it out and pushing it to heroku again everything is fine.
Odd...
Can you try this?
Set username: systemuser, host: localhost in your YAML file
If above solution doesn't work, please refer to this link:
http://www.revsys.com/writings/postgresql/errors.html
Hope this solves your issue!
Heroku is rejecting the push with the following message:
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Running: rake assets:precompile
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out
and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on
this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_c758e521-24e9-4477-b6d7-73
cc961fb8d2/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out
and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on
this: (called from <top (required)> at /tmp/build_c758e521-24e9-4477-b6d7-73
cc961fb8d2/Rakefile:7)
rake aborted!
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:1222:in `initialize'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:1222:in `new'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:1222:in `connect'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:324:in `initialize'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:28:in `new'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:28:in `postgresql_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:315:in `new_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:325:in `checkout_new_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:247:in `block (2 levels) in checkout'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:242:in `loop'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:242:in `block in checkout'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:239:in `checkout'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:102:in `block in connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:101:in `connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:410:in `retrieve_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_specification.rb:171:in `retrieve_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_specification.rb:145:in `connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:310:in `cle
ar_cache!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/railtie.rb:103:in `block (2
levels) in <class:Railtie>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:418:in `_run
__1575907776091260551__prepare__1163126976531258673__callbacks'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:405:in `__ru
n_callback'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:385:in `_run
_prepare_callbacks'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:81:in `run_c
allbacks'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/action_dispatch/middleware/reloader.rb:74:i
n `prepare!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/action_dispatch/middleware/reloader.rb:48:i
n `prepare!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application/finisher.rb:47:in `block in
<module:Finisher>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `run'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:55:in `block in run_in
itializers'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `each'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `run_initializer
s'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application.rb:136:in `initialize!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/railtie/configurable.rb:30:in `method_m
issing'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/config/environment.rb:5:in `<top (required)>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `r
equire'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `b
lock in require'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `l
oad_dependency'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `r
equire'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application.rb:103:in `require_environm
ent!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application.rb:305:in `block (2 levels)
in initialize_tasks'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:93:in `block (2 level
s) in <top (required)>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:60:in `block (3 level
s) in <top (required)>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:23:in `invoke_or_rebo
ot_rake_task'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:29:in `block (2 level
s) in <top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
I've tried other's solutions in Stackoverflow without any success:
include gem rails_12factor
add the line " config.assets.initialize_on_precompile = false" in the application.rb
putting Sql3lite gem in the development/test group
and I've also tried some of my own including:
create a new stack cedar application
add a new SSH key
installed Heroku toolbelt.
commenting out PG gem in production
remove Gemfile.lock
My code is at https://github.com/charleshsu168/sample_app1
I am folloing Michael Hartl tutorial.
The DEPRECATION WARNING: 's are unrelated to your issue, I get them on my live servers.
It looks like Rails thinks that your DB server is available locally hence it is trying to connect to 127.0.0.1 which is localhost.
Based on the logs, looks like a DB configuration issue. Do you have postgres configured correctly. https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-ruby.
postgresql_adapter.rb:28:in `postgresql_connection'
I've got it to work somehow by trial and error. One of the thing I did is I deleted the old Heroku remote URL that doesn't exist anymore in .git/config, replace it with the new Heroku app name I've created, and then re-run: Heroku push master
Now it works!
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).