Failing to Enable User-Env-Compile on Heroku

failing to enable user-env-compile on Heroku

You don't have to do anything (the labs is deprecated and you should delete it), by default now heroku is exporting your environement variables during slug compilation.

Be careful, it is not recommended to use the environement variable during slug compilation (you can check http://12factor.net/ for more informations)

Hope it helps.

heroku heroku labs:enable user-env-compile

I found the documentation on the asset_sync github page that says when you run command:

heroku labs:enable user-env-compile --app <appname>

In order for it to work.

Heroku also has AssetSync https://devcenter.heroku.com/articles/cdn-asset-host-rails31#configuration documentation

It's so nice to only be compiling assets once now

This worked for me as well when I wanted to get a direct deploy to Heroku. I use the i18n-js https://github.com/fnando/i18n-js gem which requires config.assets.initialize_on_precompile = true in application.rb.

So, this command allowed me to not have to precompile assets at all before deployment. I really help Heroku keeps this around.

Also we called heroku labs:enable user-env-compile -a <appname>, not user_env_compile.

Edited:
For working this issue, just update your heroku toolbelt, please refer below mentioned link
https://blog.heroku.com/archives/2012/10/15/upgrading-to-the-heroku-toolbelt

Getting Error while pushing into Heroku (Precompiling assets failed.)

Check this article about Heroku and Rails asset:precompile error. You should set

config.assets.initialize_on_precompile = false

failing to find ENV['SECRET_KEY'] in devise setup on heroku

You're wanting to use a config var before (at compile time) it's actually made available to your app (at slug compilation time).

Try switching on the Heroku Labs: user-env-compile

I suspect it will solve the problem.

Heroku precompile assets failed on Rail 4 app

You'll need to enable a labs feature on Heroku user-env-compile which gives the app access to the environment variables at compile time.

heroku labs:enable user-env-compile -a myapp

Read more about it at https://devcenter.heroku.com/articles/labs-user-env-compile

rake assets:precompile failing during push to Heroku

I can see you're running the assets:precompile rake task with --app my-app-name option. Just to be sure, do you have multiple apps on Heroku? (eg. staging and production). If you do make sure make sure running heroku config --app my-app-name results in the output you had with heroku config.

If you had the expected results with the above command, it's likely the ENV vars aren't available on git push as suggested here asset_sync_test github readme . You can go around that by using the following in your config/environments/*.rb file:

config.asset_sync.aws_access_key = ENV['AWS_ACCESS_KEY_ID']
config.asset_sync.aws_access_secret = ENV['AWS_SECRET_ACCESS_KEY']
config.asset_sync.aws_bucket = ENV['FOG_DIRECTORY']
config.asset_sync.fog_provider = ENV['FOG_PROVIDER']

Heroku Precompiled Assets Failed

I had just added Unicorn, I added the following to my application.rb in config and was able to precompile:

config.assets.initialize_on_precompile = false

Heroku Rails 4 could not connect to server: connection refused

The accepted answer did not fully resolve this. I tried to find a solution for 2-3 hours without success, then this worked:

In your app directory.

heroku labs:enable user-env-compile

it is still failing?

heroku labs:disable user-env-compile
heroku labs:enable user-env-compile

Then it worked for me, just had to remove and do again.

The following config is no longer needed in Rails 4. Compiling assets must work without it.

config.assets.initialize_on_precompile = false

Precompile failing on Heroku with initialize_on_precompile set to false

Have you tried this Heroku labs fix?

https://devcenter.heroku.com/articles/labs-user-env-compile

Just came across it recently, and haven't had a chance to try, but will do so next time asset compilation invariably fails...

There's also a blog post on it here:

http://blog.genuitytech.com/2012/01/31/heroku-labs-and-user-env-compile/

Could not detect rake tasks

you can also try enabling user-env-compile

heroku labs:enable user-env-compile


Related Topics



Leave a reply



Submit