Skip to content

Instantly share code, notes, and snippets.

@wellington1993
Last active April 4, 2018 08:37
Show Gist options
  • Save wellington1993/fe6b74f5b1409e3d3b814aea28d884ee to your computer and use it in GitHub Desktop.
Save wellington1993/fe6b74f5b1409e3d3b814aea28d884ee to your computer and use it in GitHub Desktop.
Ubuntu instructions to install Node.js(+ npm) + AngularJS + YEOMAN + generator-angular + rbenv + Ruby + Rails-api - App Example: https://github.com/wellington1993/astronauta-test1-rails-angular
# Before this please install zsh and oh-my-zsh
apt-get install curl
#curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs vim htop git gitg
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install -y build-essential libssl-dev curl openssl git python phantomjs libreadline-dev
sudo apt-get install -y python-software-properties optipng chrpath git-core libssl-dev libfontconfig1-dev
# If use mysql
# sudo apt-get install mysql-server mysql-client libmysqlclient-dev
#From:
# https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
# https://www.digitalocean.com/community/tutorials/como-instalar-o-node-js-em-um-servidor-ubuntu-14-04-pt
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
zsh
bash
nvm --version
nvm install stable
nvm install stable --reinstall-packages-from=node
nvm use stable
nvm current
#From:
# https://www.digitalocean.com/community/tutorials/how-to-install-node-js-with-nvm-node-version-manager-on-a-vps
# https://www.digitalocean.com/community/tutorials/como-instalar-o-node-js-em-um-servidor-ubuntu-14-04-pt
# https://keymetrics.io/2015/02/03/installing-node-js-and-io-js-with-nvm/
# http://learn.bevry.me/node/install/#-download-install-node-js-http-nodejs-org-download-
# http://workshop.botter.ventures/2015/10/23/how-to-install-node-js-using-nvm-on-ubuntu/
# https://richardkall.se/installing-node-js-using-node-version-manager-nvm/
# http://michael-kuehnel.de/node.js/2015/09/08/using-vm-to-switch-node-versions.html
# http://garywoodfine.com/install-node-js-via-node-version-manager-on-ubuntu/
#sudo apt-get install npm
sudo npm install npm -g
npm -g update
#From:
# https://docs.npmjs.com/getting-started/installing-node
# http://tableless.com.br/yeoman-e-quando-as-coisas-dao-errado/
#echo "export NODE_PATH=$NODE_PATH:~/.nvm/versions/node/v5.11.0/lib/node_modules" >> ~/.zshrc && source ~/.zshrc
#echo "export NODE_PATH=$NODE_PATH:~/.nvm/versions/node/v5.11.0/lib/node_modules" >> ~/.bashrc && source ~/.bashrc
echo "export NODE_PATH=$NODE_PATH:~/.nvm/versions/node/v6.0.0/lib/node_modules" >> ~/.zshrc && source ~/.zshrc
echo "export NODE_PATH=$NODE_PATH:~/.nvm/versions/node/v6.0.0/lib/node_modules" >> ~/.bashrc && source ~/.bashrc
npm install -y -g yo
npm update -g yo
npm install -g grunt-cli bower
yo doctor
yo
# From:
# http://tableless.com.br/yeoman-e-quando-as-coisas-dao-errado/
# https://candidosalesg.wordpress.com/2012/11/19/instalando-yeoman-no-ubuntu-12-10/
# As root "sudo su -"
cd /var
touch swap.img
chmod 600 swap.img
dd if=/dev/zero of=/var/swap.img bs=1MB count=512
mkswap /var/swap.img
swapon /var/swap.img
echo "/var/swap.img none swap sw 0 0" >> /etc/fstab
# else continue
#From:
# https://github.com/christopher5106/swap-simple/blob/master/recipes/default.rb
# https://www.digitalocean.com/community/tutorials/how-to-configure-virtual-memory-swap-file-on-a-vps
npm install -g typescript typings
npm i -g istanbul mocha babel gulp-cli grunt-cli
npm install -g gulp bower
bower install
grunt server
#npm install -g generator-ng-fullstack
#npm install -g generator-karma generator-angular
npm install -g generator-gulp-angular
mkdir my-new-project && cd $_
mkdir frontend && cd $_
yo gulp-angular
# Use/Select this options:
# ? Which version of Angular do you want? 1.5.x (stable)
# ? What Angular modules would you like to have? (ngRoute and ngResource will be addressed after)
# ? Do you need jQuery or perhaps Zepto? jQuery 2.x (new version, lighter, IE9+)
# ? Would you like to use a REST resource library? Restangular, an alternative service to handle RESTful requests
# ? Would you like to use a router? UI Router, flexible routing with nested views
# ? Which UI framework do you want? Angular Material, the reference implementation of the Google's Material Design specification
# ? Which CSS preprocessor do you want? Sass (Node), Node.js binding to libsass, the C version of the popular stylesheet preprocessor, Sass.
# ? Which JS preprocessor do you want? CoffeeScript, "a little language that compiles into JavaScript".
# ? Which HTML template engine would you want? Jade (*.jade)
# If npm install killed
bower install
npm install
gulp test
gulp
gulp serve
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
#From:
# https://github.com/rbenv/rbenv
# https://gist.github.com/MicahElliott/2407918
sudo apt-get install -y libxslt-dev libxml2-dev libsqlite3-dev
aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev
sudo apt-get install -y aptitude
sudo aptitude install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev apt-get install libruby
zsh
bash
# Sometimes work whitout 2.3.0
rbenv install 2.3.0
rbenv local 2.3.0
rbenv global 2.3.0
rbenv rehash
#Create gemrc
# Form https://gist.github.com/wellington1993/86e7351dcea76b07c8daf3f73f50b77c
#If gem command not found add the path od ruby version to user .bashrc in $PATH
gem install bundle
gem install rails
gem install rails-api
gem install foreman
rails -v
gem install compass
#From:
# https://gorails.com/setup/ubuntu/16.04
rails-api new your-project-name
rails s
@wellington1993
Copy link
Author

captura de tela de 2016-04-27 15-28-54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment