Last active
October 15, 2018 23:21
-
-
Save kuczmama/ad6954a70088c64f5e5a8973ffb4f021 to your computer and use it in GitHub Desktop.
Install script to setup ubuntu 18.04
This file contains hidden or 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
#/bin/bash | |
usage() { echo "The usage is"; } | |
while getopts ':h:u:p:r:' opt; do | |
case "${opt}" in | |
h) HOST=${OPTARG};; | |
u) UNAME=${OPTARG};; | |
p) PWORD=${OPTARG};; | |
r) RUBY_VERSION=${OPTARG};; | |
*) usage;; | |
esac | |
done | |
# # Create user | |
# sudo adduser $UNAME --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password | |
# echo "$UNAME:$PWORD" | sudo chpasswd | |
# # # Add user to sudoers | |
# usermod -aG sudo $UNAME | |
# read -rp $'Paste in the public SSH key for the new user:\n' sshKey | |
# INSTALL GIT | |
echo "Installing git..." | |
sudo apt install -y git-all | |
# INSTALL RAILS | |
echo "Installing rbenv.." | |
git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
source ~/.bashrc | |
reset | |
echo "Finished installing rbenv" | |
#!/bin/bash | |
rbenv -v | |
echo "Installing ruby.." | |
rbenv install $RUBY_VERSION | |
rbenv global $RUBY_VERSION | |
echo "Finished installing ruby" | |
ruby -v | |
echo "gem: --no-document" > ~/.gemrc | |
echo "Installing rails.." | |
gem install bundler | |
gem install rails | |
rbenv rehash | |
echo "Finished installing rails" | |
rails -v | |
rbenv rehash | |
# echo $HOST | |
# echo $UNAME | |
# echo $PWORD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment