Can't run bundle exec in Rails on ubuntu 20.04

I am on the server as my rails user. Running bundle install ends with “Killed” When I try to run in the project folder

bundle exec rails -v

I get the following output

Could not find rails-7.0.4, sprockets-rails-3.4.2, puma-5.6.5, importmap-rails-1.1.5, turbo-rails-1.3.2, stimulus-rails-1.1.0, jbuilder-2.11.5, bootstrap-5.2.2, simple_form-5.1.0, ransack-3.2.1, bootstrap-select-rails-1.13.8, jquery-rails-4.5.0, sqlite3-1.5.3-x86_64-linux, sprockets-4.1.1, sassc-rails-2.1.2, sassc-2.4.0, tilt-2.0.11, ffi-1.15.5 in locally installed gems
Run `bundle install` to install missing gems.

My gemfile looks like this

source ""
git_source(:github) { |repo| "{repo}.git" }

ruby "3.1.0"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.4"

# The original asset pipeline for Rails []
gem "sprockets-rails"

# Use the Puma web server []
gem "puma", "~> 5.0"

# Use JavaScript with ESM import maps []
gem "importmap-rails"

# Hotwire's SPA-like page accelerator []
gem "turbo-rails"

# Hotwire's modest JavaScript framework []
gem "stimulus-rails"

# Build JSON APIs with ease []
gem "jbuilder"
# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"

# Use Kredis to get higher-level data types in Redis []
# gem "kredis"

# Use Active Model has_secure_password []
 gem "bcrypt", "~> 3.1.7"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false

# Use Sass to process CSS
#gem "sassc-rails"
gem 'bootstrap', '~> 5.1', '>= 5.1.3'
gem 'simple_form'
gem 'ransack'
gem 'bootstrap-select-rails'
gem 'jquery-rails'
gem 'sqlite3'
# Use Active Storage variants []
# gem "image_processing", "~> 1.2"

group :development, :test do
  # See
  gem "debug", platforms: %i[ mri mingw x64_mingw ]
  gem 'i18n-debug'

group :development do
  # Use console on exceptions pages []
  gem "web-console"

  # Add speed badges []
  # gem "rack-mini-profiler"

  # Speed up commands on slow machines / big apps []
  # gem "spring"

group :test do
  # Use system testing []
  gem 'timecop'
  gem "capybara"
  gem "selenium-webdriver"
  gem "webdrivers"

If I am in the user folder i can run rails -v and get version name

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
November 3, 2022
Accepted Answer

Hi there,

It sounds like your server might be running out of RAM.

What I could suggest is adding a swap file so that you could have some extra buffer:

Also, you could try adding extra RAM as well.

Let me know how it goes!



Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel