Live data from Hacker News

Using Vagrant and Chef for Reproducible, Isolated Rails Development Environments

gofullstack.com

1–10 of 21 posts

Re: Using Vagrant and Chef for Reproducible, Isolated Rails Development Environments

#2
Just want to point out that if you're using an encrypted filesystem, vagrant up will fail if NFS is enabled. The workaround is to use rsync to maintain the synced folders, a feature introduced in Vagrant 1.5. Just use vagrant rsync-auto to keep the guest folder in sync automatically with your local folder. If you modify files within the VM (like with a bundle install that modifies your Gemfile.lock or with rails generators), I recommend installing the vagrant-rsync-back plugin (https://github.com/smerrill/vagrant-rsync-back).

Re: Using Vagrant and Chef for Reproducible, Isolated Rails Development Environments

#4
post #2

Just want to point out that if you're using an encrypted filesystem, vagrant up will fail if NFS is enabled. The workaround is to use rsync to maintain the synced folders, a feature introduced in Vagrant 1.5. Just use vagrant rsync-auto to keep the guest folder in sync automatically with your local folder. If you modify files within the VM (like with a bundle install that modifies your Gemfile.lock or with rails gene…

Good to know. My filesystem is encrypted, running Mac OS X Yosemite, and it does work but I know there are a few other cases where NFS will crap out. As I mention this setup is pretty naive but could see making NFS optional using environment variables. That plugin looks pretty cool though, will look into it.

Re: Using Vagrant and Chef for Reproducible, Isolated Rails Development Environments

#6

I tried using Vagrant on my company Macbook but found it much slower than just running everything on OSX. Does anyone have any tips for improving the performance?

If you haven't tried it with NFS that'd be the first place to start, it makes a _huge_ difference.

Re: Using Vagrant and Chef for Reproducible, Isolated Rails Development Environments

#7
This is pretty much what I do when developing as it's a good idea to make your dev environment as close to production as possible.

I do however substitute chef for ansible as I found chef difficult to use on a single server (chef-solo was flakey) and bootstrapping is a pain.

For writing anisble playbooks to use with Vagrant I found the following post very useful - http://hakunin.com/six-ansible-practices

Re: Using Vagrant and Chef for Reproducible, Isolated Rails Development Environments

#9

I may be missing something, but isn't this what Docker is for?

And the bonus of using Docker is you can use the same image you develop on to test with, and the same image you test with in production.

This not only avoids the "Dunno, works on my system" but also the "Dunno, works in dev/test"

Re: Using Vagrant and Chef for Reproducible, Isolated Rails Development Environments

#10

This is pretty much what I do when developing as it's a good idea to make your dev environment as close to production as possible. I do however substitute chef for ansible as I found chef difficult to use on a single server (chef-solo was flakey) and bootstrapping is a pain. For writing anisble playbooks to use with Vagrant I found the following post very useful - http://hakunin.com/six-ansible-practices

berkshelf makes this a breeze, fyi. I do it for all of my AWS instances
Post reply on HN