Warm tip: This article is reproduced from stackoverflow.com, please click
heroku java-home rjb

Can't deploy to Heroku the app with RJB gem

发布于 2020-03-27 10:24:55

I've set the JAVA_HOME variable

heroku config:add JAVA_HOME=/usr/lib/jvm/java-6-openjdk

checked that heroku config shows this variable with value, then pushed:

git push heroku master

and still get

JAVA_HOME is not set

error while bundler is installing RJB gem.

I can successfully deploy the same source to another Heroku application, and all environment variables are the same.

What is wrong?

Questioner
Paul
Viewed
66
14.1k 2013-05-31 04:26

I had the same question, and in case anyone else wants to know, this is what Heroku told me:

By default the config variables aren't made available when the application is compiled - only at runtime.

You can change this by making sure you have the latest heroku gem install, then enable the user_env_compile lab flag

$ heroku labs:enable user-env-compile

this will make JAVA_HOME available when the gem installs, hopefully getting you past this issue.