Last active
March 17, 2024 17:40
-
-
Save asssis/d651462547018fd0b35a3b72a3da9f0f to your computer and use it in GitHub Desktop.
Instalar Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PARA INSTALAR FAVOR COPIE A PARTE | |
* copie o arquivo #INSTALAR COLE EM UM ARQUIVO com o nome install.sh | |
* Dê a permição com chmod +777 | |
* Rode o camando no terminal sudo ./install | |
#ATUALIZAR RUBY | |
cd /usr/local/rbenv | |
git reset --hard | |
git pull origin master | |
cd ~/.rbenv/plugins/ruby-build | |
git reset --hard | |
git pull origin master | |
# - Listando versoes existentes | |
rbenv install -l | |
# Excluindo versoes antigas | |
rbenv uninstall <versao> | |
rbenv install -v "$RUBY_VERSION" | |
rbenv global "$RUBY_VERSION" | |
gem install bundler | |
gem install bundler -v 1.17.3 | |
gem install rails | |
rbenv rehash | |
#INSTALAR | |
# RODAR COMO ROOT OU SUDO | |
if [[ $(id -u) -ne 0 ]] | |
then echo "Por favor executar como root" | |
exit 1 | |
fi | |
echo 'Instalando rbenv' | |
RUBY_VERSION=3.0.1 | |
USUARIO=$SUDO_USER | |
add-apt-repository main | |
add-apt-repository universe | |
add-apt-repository restricted | |
add-apt-repository multiverse | |
apt-get update | |
apt-get -y install curl unzip wget zsh git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev | |
# Install node 10.x | |
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - | |
apt-get install -y nodejs | |
apt-get autoremove -y | |
cd /usr/local | |
git clone http://github.com/sstephenson/rbenv.git rbenv | |
chgrp -R staff rbenv | |
chmod -R g+rwxXs rbenv | |
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /home/"$USUARIO"/.bashrc | |
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /home/"$USUARIO"/.bashrc | |
echo 'eval "$(rbenv init -)"' >> /home/"$USUARIO"/.bashrc | |
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /home/"$USUARIO"/.zshrc | |
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /home/"$USUARIO"/.zshrc | |
echo 'eval "$(rbenv init -)"' >> /home/"$USUARIO"/.zshrc | |
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /root/.bashrc | |
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /root/.bashrc | |
echo 'eval "$(rbenv init -)"' >> /root/.bashrc | |
export RBENV_ROOT=/usr/local/rbenv | |
export PATH="$RBENV_ROOT/bin:$PATH" | |
eval "$(rbenv init -)" | |
git clone https://github.com/sstephenson/ruby-build.git /root/.rbenv/plugins/ruby-build | |
git clone https://github.com/sstephenson/ruby-build.git /home/"$USUARIO"/.rbenv/plugins/ruby-build | |
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> /root/.bash_profile | |
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> /home/"$USUARIO"/.bashrc | |
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> /home/"$USUARIO"/.zshrc | |
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH" | |
rbenv install -v "$RUBY_VERSION" | |
rbenv global "$RUBY_VERSION" | |
gem install bundler | |
gem install rails | |
rbenv rehash | |
chown -R "$USUARIO":"$USUARIO" /home/"$USUARIO"/.bashrc | |
chown -R "$USUARIO":"$USUARIO" /home/"$USUARIO"/.rbenv | |
chown -R "$USUARIO":root /usr/local/rbenv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment