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

Assets aren't uploaded on Heroku deploy #5

Closed
mrship opened this Issue Aug 31, 2011 · 6 comments

Comments

Projects
None yet
4 participants
@mrship

mrship commented Aug 31, 2011

I'm using Rails 3.1.RC6 and have added asset_sync into my project for deploy to Heroku. When I deploy with a new git push, the assets are not uploaded to my S3 bucket. However, if I run

heroku run rake assets:precompile

then they are uploaded successfully. This implies that the setup is correct but for some reason the rake task isn't getting run on deploy. I'll open a ticket with Heroku as well, but given that you mention this will work "automagically" I wondered if you had any ideas?

@davidjrice

This comment has been minimized.

Show comment
Hide comment
@davidjrice

davidjrice Aug 31, 2011

Contributor

Hey dude,

We still need to check fully what's going on with rc6 and rc7, I think a bug was introduced in those release candidates.

I'd suggest going back to rc5, or up to rc8. We've got it tested and working on both of those.

Or you could jump to Rails 3.1 which was just fully released. All being well if there hasn't been any regression of that bug since rc8 fixed it then we're good!

On 31 Aug 2011, at 12:26, mrship wrote:

I'm using Rails 3.1.RC6 and have added asset_sync into my project for deploy to Heroku. When I deploy with a new git push, the assets are not uploaded to my S3 bucket. However, if I run

heroku run rake assets:precompile

then they are uploaded successfully. This implies that the setup is correct but for some reason the rake task isn't getting run on deploy. I'll open a ticket with Heroku as well, but given that you mention this will work "automagically" I wondered if you had any ideas?

Reply to this email directly or view it on GitHub:
#5


David Rice
+44 (0)75 905 38303
http://davidjrice.co.uk

Contributor

davidjrice commented Aug 31, 2011

Hey dude,

We still need to check fully what's going on with rc6 and rc7, I think a bug was introduced in those release candidates.

I'd suggest going back to rc5, or up to rc8. We've got it tested and working on both of those.

Or you could jump to Rails 3.1 which was just fully released. All being well if there hasn't been any regression of that bug since rc8 fixed it then we're good!

On 31 Aug 2011, at 12:26, mrship wrote:

I'm using Rails 3.1.RC6 and have added asset_sync into my project for deploy to Heroku. When I deploy with a new git push, the assets are not uploaded to my S3 bucket. However, if I run

heroku run rake assets:precompile

then they are uploaded successfully. This implies that the setup is correct but for some reason the rake task isn't getting run on deploy. I'll open a ticket with Heroku as well, but given that you mention this will work "automagically" I wondered if you had any ideas?

Reply to this email directly or view it on GitHub:
#5


David Rice
+44 (0)75 905 38303
http://davidjrice.co.uk

@hamstarr

This comment has been minimized.

Show comment
Hide comment
@hamstarr

hamstarr Aug 31, 2011

Contributor

This is an issue up to 3.1 final release. See rails/rails#2747 for a fix merged into the final release.

Contributor

hamstarr commented Aug 31, 2011

This is an issue up to 3.1 final release. See rails/rails#2747 for a fix merged into the final release.

@mrship

This comment has been minimized.

Show comment
Hide comment
@mrship

mrship Aug 31, 2011

Well, I just upgraded to 3.1 from RC6 and am still seeing it fail to upload any assets to S3 when deploying to Heroku. It may be a factor that I've moved from RC6 to 3.1 release, but I don't see where at this point. I'll keep looking...

mrship commented Aug 31, 2011

Well, I just upgraded to 3.1 from RC6 and am still seeing it fail to upload any assets to S3 when deploying to Heroku. It may be a factor that I've moved from RC6 to 3.1 release, but I don't see where at this point. I'll keep looking...

@hamstarr

This comment has been minimized.

Show comment
Hide comment
@hamstarr

hamstarr Aug 31, 2011

Contributor

Actually, it looks like it wont be fixed until 3.1.1. See rails/rails@e3efe78. There are some more directives in the config for development and production.

Contributor

hamstarr commented Aug 31, 2011

Actually, it looks like it wont be fixed until 3.1.1. See rails/rails@e3efe78. There are some more directives in the config for development and production.

@arvida

This comment has been minimized.

Show comment
Hide comment
@arvida

arvida Sep 9, 2011

We had the same problem (rails 3.1 stable, cedar) and for us the problem was on heroku; it looks like your config vars is not available when heroku runs rake assets:precompile on a new deploy.

We fixed this by keeping the actual aws key/secret in the initializer:

config.aws_access_key = "your-aws-key" config.aws_access_secret = "your-aws-secret"

instead of:

config.aws_access_key = ENV['AWS_ACCESS_KEY'] config.aws_access_secret = ENV['AWS_ACCESS_SECRET']

Not the best/securest solution, but works for now ;(

arvida commented Sep 9, 2011

We had the same problem (rails 3.1 stable, cedar) and for us the problem was on heroku; it looks like your config vars is not available when heroku runs rake assets:precompile on a new deploy.

We fixed this by keeping the actual aws key/secret in the initializer:

config.aws_access_key = "your-aws-key" config.aws_access_secret = "your-aws-secret"

instead of:

config.aws_access_key = ENV['AWS_ACCESS_KEY'] config.aws_access_secret = ENV['AWS_ACCESS_SECRET']

Not the best/securest solution, but works for now ;(

@mrship

This comment has been minimized.

Show comment
Hide comment
@mrship

mrship Sep 12, 2011

I'm made the same change and this is working fine for me now in production - thanks all!

mrship commented Sep 12, 2011

I'm made the same change and this is working fine for me now in production - thanks all!

@mrship mrship closed this Sep 12, 2011

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