-
Notifications
You must be signed in to change notification settings - Fork 284
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
"Must supply cloud_name in tag or in configuration" when precompiling assets #21
Comments
Thank you for reporting this issue. heroku config:add CLOUDINARY_URL=cloudinary://API_KEY:API_SECRET@CLOUD_NAME Do you have a config initializer or a cloudinary.yml file? Maybe the asset precompiling process does not fully initializes the Rails application? |
I have already set that ENV variable.. but it is not working. I'm deploying on heroku without the actual "cloudinary addon", but with manual setup. Is the presence of addon required to make things work? I have cloudinary.yml file.. it looks like this:
|
In addition, having something like this:
Serves assets from cloudinary in development, but from /assets folder in production env. |
It seems that running 'rake assets:precompile' is using 'production' Rails environment in default (instead of development or staging). |
I've added the production section in yml file and now it fails during push:
|
Btw, my heroku app is in staging env. I have these two as my heroku env vars:
|
From Heroku's documentation: https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar You can specifically define the cloud_name parameter (only) either in a cloudinary.yml file or in a Rails initializer. |
I added cloud_name parameter to cloudinary.yml in production section and now it works! Thanks @nadavs! |
Now it doesn't work again on heroku. It just fails silently and doesnt serve static assets from cloudinary |
and in development, some of assets are served from cloudinary and some from local /assets folder even though all are synced and references in .cloudinary.static files are fine |
Hi Milovan, |
I have '.cloudinary.static' file ignored by git. After deploying to heroku I run: |
Please check if it works for you. |
There are two things I don't like about this approach:
I don't think we can even write to file (.cloudinary.static) from rake task on heroku. I think that heroku doesn't allow that..? When I run that task on heroku it kinda completes, but this Is there any way to have some kind of deploy hook that will sync static assets BEFORE precompiling assets? |
If heroku could write to |
Thank you for sharing your thoughts about this approach. Regarding writing to .cloudinary.static in Heroku: which Heroku stack do you use? In new stacks it should work: https://devcenter.heroku.com/articles/dynos#isolation_and_security |
For any one else facing issues have a look at: https://devcenter.heroku.com/articles/labs-user-env-compile |
+1 with Carrierwave and Cloudinary in Rails application. |
I was using
cloudinary_url
sass helper in my app:When I try to deploy the app to heroku, it fails to precomplie assets with following error:
https://github.com/cloudinary/cloudinary_gem/blob/master/lib/cloudinary/utils.rb#L71
The text was updated successfully, but these errors were encountered: