Skip to content

Instantly share code, notes, and snippets.

@lcuevastodoit
Last active March 2, 2021 23:18
Show Gist options
  • Save lcuevastodoit/81947782c8740f01a046cf4e1de3fb18 to your computer and use it in GitHub Desktop.
Save lcuevastodoit/81947782c8740f01a046cf4e1de3fb18 to your computer and use it in GitHub Desktop.
Installing Ruby on Rails in Ubuntu 18.04 without any Ruby Manager
Installing Ruby on Rails in Ubuntu 18.04 without any Ruby Manager
1.- As Root
-- Install Ruby and other packages you could be needing for Rails
apt-get install ruby ruby-dev sqlite3 gcc g++ make zlib1g-dev
gem update system 3.0.8
gem install bundler
-- Install Node
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && \
apt-get install -y nodejs python-requests python-ipaddr && \
apt-get install -y python-dev python-setuptools make python-docutils
-- Install Yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
apt update && sudo apt install yarn
-- Install Rails
gem install rails
2. Now as normal user -> Create a New Rails Project
rails new Site
cd Site
bundle install --path vendor/bundle
bundle install
rails webpacker:install
yarn install --check-files
rails server -b 0.0.0.0 &
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
sudo apt update
sudo apt install git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev
curl -sL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash -
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
rbenv install 2.5.3
rbenv global 2.5.3
ruby -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment