_Description: Vagrantfile with CentOS 6.5/ruby 2.1.2/rvm/MySQL/Nginx
-
Download and install Vagrant http://www.vagrantup.com/
-
Download and install VirtualBox https://www.virtualbox.org/
-
brew install python
-
sudo easy_install pip
-
sudo pip install ansible
-
git clone https://github.com/morizyun/vagrant-ansible-rails
-
cd vagrant-ansible-rails
-
chmod a+x set_vagrant.sh && ./set_vagrant.sh
-
export ANSIBLE_HOSTS=./ansible/hosts_vagrant
-
ansible-playbook ./ansible/playbook_vagrant.yml
-
create rails project
vagrant ssh
cd /var/rails
export rvmsudo_secure_path=1
rvmsudo gem install rails bundler --no-ri --no-rdoc
rails new sample --database=mysql
cd sample
echo "gem 'therubyracer', platforms: :ruby" >> Gemfile
bundle install
bundle exec rake db:create
rails s
- Browsing
http://192.168.33.10/
-
Sync Folder(Sever - Local) :
/vagrant/app
-app/
-
MySQL ROOT PASS : ``(nothing)