Skip to content

Instantly share code, notes, and snippets.

@kolosek
Last active January 15, 2022 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kolosek/acfbdc9f3373c36a3ff40c04b325b3e9 to your computer and use it in GitHub Desktop.
Save kolosek/acfbdc9f3373c36a3ff40c04b325b3e9 to your computer and use it in GitHub Desktop.
Basic installation of rails under ubuntu 18.04
#!/bin/bash
echo 'This script will set up your Ubuntu 18.04 for Rails development.'
echo 'Make sure you run our Basic Library installation at https://gist.github.com/kolosek/6ee0a6f9ffe374e7a1d6ff04143cd203'
echo 'Press ENTER to continue with installation, press ^C to cancel.'
# libssl1.0-dev
read
# Install RVM
echo "------Installing rvm------"
sudo apt install -y curl gnupg2
sudo apt-get -y install build-essential openssl zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev automake libtool bison subversion
sudo apt-get -y install libffi-dev libgdbm-dev libncurses5-dev libgmp-dev libreadline-dev gnupg2 nodejs
command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
command curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
#curl -sSL https://rvm.io/mpapis.asc | gpg --import -
#gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable --ruby
source ~/.bashrc
# Install bundler
echo "-----Installing bundler------"
gem install bundler
# Add shortcuts and aliases
echo "------Configuring .bashrc------"
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
echo "# Bundle aliases" >> ~/.bashrc
echo "alias be='bundle exec'" >> ~/.bashrc
echo "alias bi='bundle install --path vendor/bundle'" >> ~/.bashrc
echo "# Git aliases" >> ~/.bashrc
echo "alias gc='git commit'" >> ~/.bashrc
echo "alias ga='git add'" >> ~/.bashrc
echo "alias gaa='git add --all'" >> ~/.bashrc
echo "alias gp='git push'" >> ~/.bashrc
echo "Adding git branch info to command line"
echo "PS1='[\u@\h \W"'$(__git_ps1' "\"" "(%s)\")]\\$ '" >> /home/ubuntu/.bashrc
# For beautiful color promt in terminal - especially line 43, that includes git branch
#if [ "$color_prompt" = yes ]; then
# PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$(__git_ps1 '')\$ "
#else
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
#fi
source ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment