Ruby On Rails on Windows - Linux VM or dual boot
I am a windows developer currently getting into Rails. While you can develop on RoR Windows, it's not the ideal experience. Things are glitchy and running cucumber tests are painfully slow.
So, would I be able to have a decent dev experience running Linux in a VM for doing开发者_StackOverflow社区 RoR development, or should I bite the bullet and just do a dual boot - Windows 7 / Linux?
It makes sense that your development environment should follow your production as closely as possible, especially while learning.
With that in mind, a virtual machine of some kind is going to be the best way forward, despite the additional headaches such as setting up networking between the host and the guest machine. I've been doing this personally in a Magento project, and can safely say the time spent getting it all just right was amply rewarded with less headaches at the end of the process, and now its all setup, can easily be reused.
About dual boot, its really not worth the hassle considering how easy it is to get a VM up and running, and for these purposes, there is no difference.
Just make sure you look into the virtual box guest additions installation if you go down this route, everything gets much cooler once they are installed and running on the guest.
Links for resources:
VirtualBox
NAT Configuration of virtualbox, some ideas
Redcar editor - textmate style editing on linux including TM bundle support
Dual boot is the way to go if you are at all serious about getting into rails, and will be spending extended periods of time working in rails.
Unless you have a very powerful machine the overhead of windows + Ubuntu/linux + rails server + database server + ide/editor will be painful.
Dual booting is easy to set up and with the fast boot speeds switching back and forth should be fairly painless.
However, if you are still very casually exploring rails or expect to switch back and forth very often, then maybe a VM is the way to go.
Don't bother with dual boot, you'll find yourself avoiding it before long. Just use VM's. I'd even - and currently do - use a VM for windows coding. VM snapshots are your friend.
Also, use Ubuntu; it's just easier to setup and get going. (ran Fedora for years but got tired of the setup)
VirtualBox or VMWare both work well.
I tried learning rails using cygwin. I got it up and running, but I found it impossible to deal with. I never was able to get mysql working after around 20 hours of playing with it. I found that cygwin is very buggy, and you will likely experience a lot of pain to get things up and running.
Other virtual machines, I'm not sure about, but my experience trying to do Rails development via Cygwin was awful.
I now dual boot Ubuntu Linux and Windows Vista. I don't think its a huge bother, and I'd recommend it.
In line with the recommendation to virtualize or dual boot, I strongly recommend Vagrant. It takes a little bit of setup, but it's Ruby (which is cool if you're getting into RoR development) and gives you a lot of power and flexibility. I've only started using it recently, but I'm already in love. It saves me the trouble of having to use an entire separate OS in a VM and the clunkiness of switching between OSs in a dual boot setup.
If you can't just run Ubuntu as your primary OS, Vagrant is definitely more developer useful than traditional virtual machines.
精彩评论