Skip to content

Commit

Permalink
RVM auto install Ruby (#11)
Browse files Browse the repository at this point in the history
* Use rvm requirements.
* Fix rvm key.
* Auto install ruby 2.3.0.
  • Loading branch information
huacnlee committed Apr 8, 2016
1 parent 3f5e470 commit f7c1aec
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 31 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,31 @@ Install packages first
```bash
sudo apt-get update
sudo apt-get install -y curl
curl -sSL https://raw.githubusercontent.com/huacnlee/init.d/master/install_packages | sh
curl -sSL https://raw.githubusercontent.com/huacnlee/init.d/master/install_packages | bash
```

### Install Nginx

```bash
curl -sSL https://raw.githubusercontent.com/huacnlee/init.d/master/install_nginx | sh
curl -sSL https://raw.githubusercontent.com/huacnlee/init.d/master/install_nginx | bash
```

### Install RVM + Ruby

```bash
curl -sSL https://raw.githubusercontent.com/huacnlee/init.d/master/install_rvm | sh
source ~/.rvm/scripts/rvm
rvm pkg install readline openssl
rvm install 2.3.0
rvm use 2.3.0 --default
curl -sSL https://raw.githubusercontent.com/huacnlee/init.d/master/install_rvm | bash
gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
gem install bundler
```

### Install MongoDB

```bash
curl -sSL https://raw.githubusercontent.com/huacnlee/init.d/master/install_mongodb | sh
curl -sSL https://raw.githubusercontent.com/huacnlee/init.d/master/install_mongodb | bash
```

### Install Redis

```bash
curl -sSL https://raw.githubusercontent.com/huacnlee/init.d/master/install_redis | sh
curl -sSL https://raw.githubusercontent.com/huacnlee/init.d/master/install_redis | bash
```
1 change: 1 addition & 0 deletions install_nginx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install -y nginx
nginx -v
27 changes: 10 additions & 17 deletions install_rvm
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
echo "Install RVM"
echo ""
command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
\curl -L https://get.rvm.io | bash -s stable
echo "[Done]"
echo ""
echo ""
echo "---------------------------------------------------------------------------"
echo "---------------------------------------------------------------------------"
echo ""
echo "Now you can use rvm command to install ruby"
echo ""
echo "source ~/.bashrc"
echo "rvm pkg install readline openssl"
echo "rvm install 2.3.0"
echo "rvm use 2.3.0 --default"
echo ""
echo ""
echo ""
command gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
command curl -L https://get.rvm.io | bash -s stable
command source /etc/profile.d/rvm.sh
command source ~/.bashrc
rvm requirements
rvm install 2.3.0
rvm use 2.3.0 --default
rvm -v
ruby -v
echo "--------------------------- Install Successed -----------------------------"
10 changes: 5 additions & 5 deletions wercker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ build:
- install-packages:
packages: curl
- script:
name: install packages
name: Base Packages
code: ./install_packages
- script:
name: install nginx
code: ./install_nginx
- script:
name: install rvm
name: Ruby
code: ./install_rvm
- script:
name: Nginx
code: ./install_nginx

0 comments on commit f7c1aec

Please sign in to comment.