Skip to content

Instantly share code, notes, and snippets.

@ouaziz
Last active November 2, 2023 18:13
Show Gist options
  • Save ouaziz/201228bf2abe7a29b45c22d72f990678 to your computer and use it in GitHub Desktop.
Save ouaziz/201228bf2abe7a29b45c22d72f990678 to your computer and use it in GitHub Desktop.
install or update ruby and rails on centos
#Remove old Ruby
$ yum remove ruby
# Install dependencies
$ yum groupinstall "Development Tools"
$ yum install zlib zlib-devel
$ yum install openssl-devel
$ wget http://pyyaml.org/download/libyaml/yaml-0.1.5.tar.gz
$ tar xzvf yaml-0.1.5.tar.gz
$ cd yaml-0.1.5
$ ./configure
$ make
$ make install
# Install ruby
$ wget http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.0.tar.gz
$ tar zxf ruby-2.1.0.tar.gz
$ cd ruby-2.1.0
$ ./configure
$ make
$ make install
# if you use proxy, create ~/.gemrc file containing :
# http_proxy: http://proxy:3128
# Update rubygems
$ gem update --system
$ gem install bundler
#Test ruby and rubygems
$ruby -v
$gem --version
# Rails
$ yum install sqlite-devel
$ gem install rails
$ gem install sqlite3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment