Вопрос

I'm having issues deploying my rails app to a t1.micro instance on Amazon EC2. I asked the question: RAILS_ENV=staging cap deploy fails on rake precompile assets

After I added the recommended code to my application.rb file, my first deploy was successful. Then I updated a js file and deployed to make sure it compiled successfully and updated assets correctly and it worked. But then the 3rd time I tried, it failed with the same error. Then I tried again and it deployed successfully. Then 2 days later, I tried to deploy and failed 3 times in a row and I'm not able to deploy at all again.

I wonder if it is taking too long to compile my assets on the t1.micro instance and it times out sometimes.

I don't have too many images, stylesheets or javascript code in there. It's a relatively new basic app.

Это было полезно?

Решение

EC2 micro instances do not have enough grunt to compile assets once they reach a critical mass. If you read your Capistrano logs, you might find an entry saying that the process was killed. I have found this with projects of mine I have attempted to deploy on micro instances, and upgraded to small instances to resolve.

Another solution is to precompile your assets locally and put them on a CDN using a gem like https://github.com/rumblelabs/asset_sync.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top