Created
April 2, 2012 18:31
-
-
Save theDisco/2286118 to your computer and use it in GitHub Desktop.
Setting up rails in vagrant
This file contains 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 | |
sudo apt-get install build-essential zlib1g-dev git-core vim curl mysql-server libmysql-ruby libmysqlclient-dev subversion | |
cd ~ | |
git clone git://github.com/sstephenson/rbenv.git .rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(rbenv init -)"' >> .bash_profile | |
source .bash_profile | |
git clone git://github.com/sstephenson/ruby-build.git | |
cd ruby-build/ | |
sudo ./install.sh | |
rbenv install 1.9.2-p290 | |
rbenv rehash | |
rbenv global 1.9.2-p290 | |
cd /vagrant | |
gem install bundler | |
rbenv rehash | |
read -p "Mysql Username: " username; | |
read -p "Mysql Password: " password; | |
read -p "New DB Username: " dbusername; | |
read -p "New DB Password: " dbpassword; | |
mysql --user=$username --password=$password --execute="CREATE USER '$dbusername'@'localhost' IDENTIFIED BY '$dbpassword';" | |
mysql --user=$username --password=$password --execute="CREATE DATABASE bt_development;" | |
mysql --user=$username --password=$password --execute="CREATE DATABASE bt_test;" | |
mysql --user=$username --password=$password --execute="GRANT ALL ON bt_development.* TO '$dbusername'@'localhost';" | |
mysql --user=$username --password=$password --execute="GRANT ALL ON bt_test.* TO '$dbusername'@'localhost';" | |
mysql --user=$username --password=$password --execute="FLUSH PRIVILEGES;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment