Skip to content

Instantly share code, notes, and snippets.

@lokcito
Last active July 30, 2021 04:08
Show Gist options
  • Save lokcito/d7212e5d6c5eec1649c272da93f76ed6 to your computer and use it in GitHub Desktop.
Save lokcito/d7212e5d6c5eec1649c272da93f76ed6 to your computer and use it in GitHub Desktop.
Vagrant Setup for RoR
#!/usr/bin/env bash
# actualizar el sistema completamente
echo mejorar y actualizar el sistema
sudo apt-get update
sudo apt-get -y upgrade
# instalar node.js para ejecutar comandos js al utilizar Rails
echo instalando node.js para ejecutar JS y Git
sudo apt-get install -y nodejs
sudo apt-get install -y git
# instalar RVM
echo instalando RVM
sudo apt-get install software-properties-common
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm -y
source /etc/profile.d/rvm.sh
echo source /etc/profile.d/rvm.sh >> ~/.profile
sudo usermod -a -G rvm $USER
rvm user gemsets
rvm requirements
# instalar Ruby y establecer 2.3.1 como predeterminada
echo instalando Ruby
rvm install 2.7
rvm use 2.7 --default
# instalar Bundler y Rails
echo instalando Bundler and Rails
gem install bundler --no-document
gem install rails -v 6 --no-document
# instalar postgres y sus dependencais
echo instalando psql y sus dependencias
sudo apt-get install -y postgresql postgresql-contrib libpq-dev
#!/usr/bin/env bash
# actualizar el sistema completamente
echo mejorar y actualizar el sistema
sudo apt-get update
sudo apt-get -y upgrade
# Install gcc
echo instalando build-essential
sudo apt install curl autoconf bison build-essential \
libssl-dev libyaml-dev libreadline6-dev zlib1g-dev \
libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev -y
# instalar node.js para ejecutar comandos js al utilizar Rails
echo instalando node.js para ejecutar JS y Git
sudo apt-get install -y nodejs
sudo apt-get install -y git
# instalar postgres y sus dependencais
echo instalando psql y sus dependencias
sudo apt-get install -y postgresql postgresql-contrib libpq-dev
# create Postgres User
sudo -u postgres createuser vagrant -s
# Set super unsafe defaultz (dev only)
sudo sh -c "echo '######vagrant######' >> /etc/postgresql/12/main/pg_hba.conf "
sudo sh -c "echo 'local all all trust\nhost all all 127.0.0.1/32 trust\nhost all all ::1/128 trust' >> /etc/postgresql/12/main/pg_hba.conf "
sudo /etc/init.d/postgresql reload
# instalar rbenv
# git clone https://github.com/rbenv/rbenv.git ~/.rbenv
# echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
# echo 'eval "$(rbenv init -)"' >> ~/.bashrc
# source ~/.bashrc
# type rbenv
# git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
# rbenv install 2.7.2
# cd ~/.rbenv && src/configure && make -C src
# echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
# ~/.rbenv/bin/rbenv init
# curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
rbenv install 3.0.1
rbenv global 3.0.1
ruby -v
# rbenv install 2.7.2
# # instalar Ruby y establecer 2.3.1 como predeterminada
# echo instalando Ruby
# rvm install 2.7
# rvm use 2.7 --default
# # instalar Bundler y Rails
# echo instalando Bundler and Rails
# gem install bundler --no-document
# gem install rails -v 6 --no-document
#!/usr/bin/env bash
# actualizar el sistema completamente
echo mejorar y actualizar el sistema
sudo apt-get update
sudo apt-get -y upgrade
# instalar node.js para ejecutar comandos js al utilizar Rails
echo instalando node.js para ejecutar JS y Git
sudo apt-get install -y nodejs
sudo apt-get install -y git
# instalar postgres y sus dependencais
echo instalando psql y sus dependencias
sudo apt-get install -y postgresql postgresql-contrib libpq-dev
# create Postgres User
sudo -u postgres createuser vagrant -s
# Set super unsafe defaultz (dev only)
sudo sh -c "echo '######vagrant######' >> /etc/postgresql/12/main/pg_hba.conf "
sudo sh -c "echo 'local all all trust\nhost all all 127.0.0.1/32 trust\nhost all all ::1/128 trust' >> /etc/postgresql/12/main/pg_hba.conf "
sudo /etc/init.d/postgresql reload
# instalar RVM
echo instalando RVM
sudo apt-get install software-properties-common
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm -y
source /etc/profile.d/rvm.sh
echo source /etc/profile.d/rvm.sh >> ~/.profile
sudo usermod -a -G rvm $USER
rvm user gemsets
rvm requirements
# instalar Ruby y establecer 2.3.1 como predeterminada
echo instalando Ruby
rvm install 2.7
rvm use 2.7 --default
# instalar Bundler y Rails
echo instalando Bundler and Rails
gem install bundler --no-document
gem install rails -v 6 --no-document
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment