-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_env_ruby.sh
executable file
·43 lines (40 loc) · 1.38 KB
/
init_env_ruby.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# Installs and updates rvm
curl -L https://get.rvm.io | bash -s head --autolibs=4
read -d '' mac_port_error <<"EOF"
It seems macports is installed on your mac, this can cause issues\\n
the recommended path is to use homebrew. Since this is potentially\\n
destructive, I will not attempt to remove port myself! However\\n
here is how to do it:\\n
\\n
sudo port -fp uninstall installed\\n
sudo rm -rf
/opt/local
/Applications/DarwinPorts
/Applications/MacPorts
/Library/LaunchDaemons/org.macports.*
/Library/Receipts/DarwinPorts*.pkg
/Library/Receipts/MacPorts*.pkg
/Library/StartupItems/DarwinPortsStartup
/Library/Tcl/darwinports1.0
/Library/Tcl/macports1.0
~/.macports
EOF
# Check for mac ports and error out, prefer homebrew
if [ "`uname`" = "Darwin" ];then
which -s port && echo -e $mac_port_error && exit 1
# Updating brew cache
echo "Attempting to update brew cache, you may be asked for sudo password ..."
brew update
fi
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Install ruby-2 integrating with OS pkg mgr (apt/brew)
rvm install ruby-2.0.0-p195 --autolibs=4
rvm use ruby-2.0.0-p195
rvm --default use ruby-2.0.0-p195
rvm gemset create silicon-vision
rvm gemset use silicon-vision
gem install rails -v '3.2.13'
bundle install
rvm --rvmrc use ruby-2.0.0-p195@silicon-vesion
rvm use ruby-2.0.0-p195@silicon-vesion