Skip to content

Setup dev env

ZHENG Tao edited this page Feb 2, 2018 · 4 revisions

Use vagrant to mananger dev env (This step is optional)

You need install & configure vagrant before run the commands below

vagrant up #launch the vm

vagrant ssh #connect to the vm via ssh, normally, your project code could be found under /vagrant/

some post-installation had been configured in bootstrap.sh

Use rvm to manager ruby version

install ruby

sudo rvm install ruby

install nodejs

sudo apt-get install nodejs -y

install rails

gem install rails

install ruby on rails dependencies

bin/bundle install

launch server locally

rails s(server)

launch server in vagrant

To avoid vm block the port, maybe you need to use public ip instead of localhost

rails s(server) -b 0.0.0.0

since 0.0.0.0 is a broadcast ip

check via web console

visit localhost:3000 or curl localhost:3000