Skip to content

Instantly share code, notes, and snippets.

@kainam00
Created July 31, 2015 15:31
Show Gist options
  • Save kainam00/a5593550a3dbd77f1b3b to your computer and use it in GitHub Desktop.
Save kainam00/a5593550a3dbd77f1b3b to your computer and use it in GitHub Desktop.
Install RVM on Amazon Linux
#!/bin/bash
# Install prerequisites
yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel ruby-devel gcc-c++ jq git
# Import key
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
# Install RVM
curl -sSL https://get.rvm.io | bash -s stable --ruby
@Startouf
Copy link

Startouf commented Mar 27, 2018

Thanks ! Apparently despite my previous digging I was still missing some core libs and I had some weird errors with OpenSSL not being required despite being installed on this OS. With this and a rvm reinstall everything was fine again

Note that on Amazon linux 2, I also had to sudo yum install -y patch that does not seem to be installed by default =_= (and is required by certain ruby versions)

I am using the system wide RVM (my personal preference) with curl -sSL https://get.rvm.io | sudo bash -s stable without any problems, and this works on Amazon Linux 2. Following this I am adding the ec2-user to the rvm group with

sudo usermod -a -G rvm ec2-user # Replace user
source /etc/profile.d/rvm.sh # Amazon linux

At this point my current bash session has not loaded the rvm group and cannot yet write as the rvm user, so I just open a new shell before installing bundler, etc.

@pixotags
Copy link

pixotags commented Aug 9, 2021

Thank you for these commands.

@wenyikuang
Copy link

wenyikuang commented Nov 2, 2023

If any one faced Error running '__rvm_make -j1'

please refer to the instruction from aws:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ruby-development-environment.html

and rvm/rvm#5209

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