Last active
July 11, 2018 13:49
-
-
Save KefDS/b6c0fe946f664c5ec661 to your computer and use it in GitHub Desktop.
Script for install rbenv and rails enviroment for development
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 -x | |
| # Script for install Ruby and Rails (rbenv). | |
| # Notes: | |
| # * Do not run with sudo because the rbenv directory will belong to root | |
| # * Change Ruby version and Rails if you wish. | |
| # * After the instalation, close and open again the terminal | |
| # Created: 16/3/16 | |
| # rbenv dependencies | |
| sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev -y | |
| # rbenv | |
| git clone git://github.com/sstephenson/rbenv.git ~/.rbenv | |
| cd ~/.rbenv && src/configure && make -C src | |
| # Ruby build | |
| git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
| # If this is alredy in ~/.bashrc do not write again | |
| grep -q 'export PATH="$HOME/.rbenv/bin:$PATH"' ~/.bashrc || echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
| grep -q 'eval "$(rbenv init -)"' ~/.bashrc || echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
| grep -q 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' ~/.bashrc || echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc | |
| # NOTE: If you do not running this file as script do not copy this | |
| export PATH="$HOME/.rbenv/bin:$PATH" | |
| eval "$(rbenv init -)" | |
| export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH" | |
| ~/.rbenv/bin/rbenv init | |
| rbenv install 2.3.1 | |
| rbenv global 2.3.1 | |
| ruby -v | |
| # Gem without documentation | |
| echo 'gem: --no-document' >> ~/.gemrc | |
| # Bundler | |
| gem install bundler | |
| rbenv rehash | |
| # NodeJS | |
| curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - | |
| sudo apt-get install -y nodejs | |
| # Rails | |
| # If you alredy have a Rails project, do not do this, the Gemfile of the project has Rails as a dependency | |
| gem install rails -v 4.2.7 | |
| # Other programs | |
| # Nginx (Server) | |
| # sudo apt-get update | |
| # sudo apt-get install curl git-core nginx -y | |
| # MySQL (Complete) | |
| # sudo apt-get install mysql-server mysql-client libmysqlclient-dev | |
| # Postgres (Client adapter) | |
| # sudo apt-get install libpq-dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment