Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heroku pre-compiling assets fails after Heroku deprecated user-env-compile #146

Open
LoganDSPrice opened this issue Jun 19, 2017 · 5 comments

Comments

@LoganDSPrice
Copy link

In the Deploying to Heroku section, the instructions state to run heroku labs:enable user-env-compile -a myapp in order to properly precompile assets. Heroku has since deprecated that.

I've found reference to the Buildpack API, but I don't understand it and how it relates to the precompiling issues with refinerycms-page-images.

I'm getting:

remote: Bundle completed (37.20s)
remote: Cleaning up the bundler cache.
remote: -----> Installing node-v6.10.0-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: PageImages is unable to find model class: Refinery::Project
remote: PageImages is unable to find model class: Refinery::TeamMember
remote: I, [2017-06-19T22:48:46.443418 #1616] INFO -- : Writing /tmp/build_90b279a9215d270edbde0c7b129f78ce/public/assets/font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot
remote: I, [2017-06-19T22:48:46.444823 #1616] INFO -- : Writing /tmp/build_90b279a9215d270edbde0c7b129f78ce/public/assets/font-awesome/fontawesome-webfont-7bfcab6db99d5cfbf1705ca0536ddc78585432cc5fa41bbd7ad0f009033b2979.eot.gz

... and so on.

It seems like there has to be a new method for deploying to Heroku while using refinerycms-page-images.

@anitagraham
Copy link
Contributor

I use Refinerycms-page-images on Heroku with no problems.

I precompile my assets on my dev systems using

RAILS_ENV=production rake assets:precompile

then incorporate changed assets into the git repo using

git status
git add /git rm / etc
git commit -m 'precompiled assets'
git push heroku master

@LoganDSPrice
Copy link
Author

Thanks for the reply!

I ran RAILS_ENV=production rake assets:precompile and I'm still getting the same error:

RAILS_ENV=production rake assets:precompile
PageImages is unable to find model class: Refinery::Project
PageImages is unable to find model class: Refinery::TeamMember

Any idea how that would be fixed?

@LoganDSPrice
Copy link
Author

More info:

When I run rake assets:precompile, precompiling finishes without error.
When I then try to push to heroku, I still get the error in my above comment.

I don't understand why PageImages is unable to find the models.

I did follow this guide to be able to use image collections for my models. Is there a chance that is messing things up?

I found elsewhere that putting config.assets.initialize_on_precompile = false in the application.rb file could prevent the precompile issue when pushing to Heroku. Any ideas on that?

@anitagraham
Copy link
Contributor

If precompile in production isn't completing, then heroku is trying to do the precompile and getting the same error.

Try changing your gemfile so that the gem(s) with Project and TeamMember are called before refinerycms-page-images. You have to do this with Refinerycms-blog and this sounds like a similar problem.

gem 'refinerycms-blog',           git: 'https://github.com/refinery/refinerycms-blog', branch: 'master'
# blog must come before page-images
gem 'refinerycms-page-images',     git: 'https://github.com/refinery/refinerycms-page-images',    branch: 'master'

@bricesanchez
Copy link
Member

Is your issue fixed @LoganDSPrice ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants