This will setup Heroku-like box using VirtualBox. For more information about base box go here
You should have VirtualBox and Vagrant installed.
- In your project root create Vagrantfile using template provided here.
- On your host machine run commands from 2_host.sh
- On your guest machine run commands from 3_guest.sh
After that you should have /vagrant
on guest machine be a shared dir with host machine and it will contain the files from dir in which you created Vagrantfile.
Potential problems:
bundle install
I needed to install nikogiri gem separategem install nokogiri -v '1.6.8'
rake db:create
I needed to create postgres user withsudo -u postgres createuser --createdb vagrant
rake db:schema:load
we need to go in rails console and create one HouseHouse.create(title: "First House", actual_value: 100000)
bundle exec rails s -b 0.0.0.0
192.168.1.42:3000
For Cucumber:
sudo apt-get update
sudo apt-get install firefox
sudo apt-get install xvfb
sudo wget -O /etc/init.d/xvfb https://gist.github.com/basti/2db0b71e893ee4d6d015/raw/5a3d63996b61ef034074a6ffd6cd07d4801fcde7/xvfb
sudo chmod a+x /etc/init.d/xvfb
export DISPLAY=:10
sudo /etc/init.d/xvfb start
Note: read this blog post http://icebergist.com/posts/headless-firefox-in-ubuntu-on-virtual-box-for-cucumber-testing/