rails + dokku bundle fails when trying to deploy for the first time
Asked Answered
L

2

8

I'm trying to deploy my rails app with Dokku. I added git remote to my repository and it starts deploying when I push remote, but it stops with this message:

Killed. Failed to install gems via Bundler.

! [remote rejected] master -> master (pre-receive hook declined)
  • the gem at which it stops changes.
  • It's my first time deploying to dokku.
Luhe answered 11/4, 2016 at 18:12 Comment(0)
L
3

turns out that upgrading my droplet to a bigger one did the trick, and deployment worked. so seems like it needed something bigger than the smallest droplet.

Luhe answered 12/4, 2016 at 19:11 Comment(2)
You'll probably run into the same problem later on though. Look at my answer. Creating a swapfile will prevent this in a more durable way.Contrarily
Creating a swapfile isn't "more durable", it's a slower alternative to actually having more memory.Bremsstrahlung
C
8

I just had a similar/same issue and solved it by enabling a swapfile.

While creating a bigger droplet works you aren't solving the real issue: The system runs out of memory while installing the gems.

On a 'normal' system this wouldn't be a problem since we'd have a swapfile. DigitalOcean does not have a default swapfile. Some reason this is to make people thing they need bigger droplets. While this solves the issue of installing your gems, you are doing it at a much higher yearly cost.

Instead, just create a swapfile. Ironically DigitalOcean has a great guide for this: http://dokku.viewdocs.io/dokku/getting-started/troubleshooting/

Contrarily answered 10/1, 2017 at 7:35 Comment(1)
Direct link to instructions dokku.com/docs/getting-started/troubleshooting/…Illuminism
L
3

turns out that upgrading my droplet to a bigger one did the trick, and deployment worked. so seems like it needed something bigger than the smallest droplet.

Luhe answered 12/4, 2016 at 19:11 Comment(2)
You'll probably run into the same problem later on though. Look at my answer. Creating a swapfile will prevent this in a more durable way.Contrarily
Creating a swapfile isn't "more durable", it's a slower alternative to actually having more memory.Bremsstrahlung

© 2022 - 2024 — McMap. All rights reserved.