Ask HN: Should I learn Rails without a Mac?

13 points by prakster ↗ HN
I have zero programming experience. I have a HP Pavilion Laptop with Windows 8, and want to take one of the popular online Rails courses. I imagine the instructions, videos, screenshots etc will all be on Macs.

Am I unnecessarily creating additional barriers towards my goal? Should I just bite the bullet and purchase a Mac (which I can do in 3 months)? Learning how to navigate around a Mac will have its own learning curve too. Any advice will help.

59 comments

[ 4.7 ms ] story [ 136 ms ] thread
In a pinch, Windows will do, but your best option is probably to find a nice Linux distro and get comfortable with that. It will allow you to follow along with the command line, and when the time comes, it's an easy switch to a Mac.
I see. Just Wikipedia'ed it. Any particular one you can suggest which has easy setup instructions?
Download VirtualPC. Download Ubuntu Desktop. These are not actually my personal preferences but a very common setup.

I'd imagine most of the screenshots in the Rails tutorial will be command line stuff.

By VirtualPC, do you mean this site: www.virtualpc.com? (I think not, but I'm a novice).
I think they mean Microsoft Virtual PC, but I believe that only supports Windows guest OSes - Oracle VirtualBox is similar software.

I have a Xubuntu VM running in VirtualBox on my Windows 8 laptop that I keep around for coding; it's actually a pretty nice setup. I run the VM on my external monitor, and can use the Windows host to do web browsing, play music, etc. while I'm working - I've even made my Dropbox a shared folder with the VM, so the guest OS can use the files but the host OS handles syncing them so there's no edit conflicts.

Thanks for the clarification.
crap I meant virtualbox. I hope you haven't become an expert on virtualpc already.
I've actually been playing around a bit with Hyper-V in Windows 8, and you can run Linux guests, but nearly as nicely as VirtualBox does (it's harder to set up, and you don't get shared folders, shared clipboard, or proper full-screen resolution). Also, installing Hyper-V breaks VirtualBox, as it seems to monopolize the hardware features needed for good CPU virtualization.
Hi Bruce, thx for suggesting Hyper-V, but I think I will try VirtualBox first. Appreciate your responses.
Haha no; am setting up VirtualBox.
Linux Mint, probably - it's got Ubuntu's hardware support and the out-of-the box install has Flash, mp3 codecs, proprietary video drivers, and all the other "non-free" software you generally expect on a consumer desktop.

If you're running in a VM, one of the lighter Ubuntu variants might be a good choice as well - check out Lubuntu or Xubuntu.

That said, the Linux distro you choose doesn't matter a whole lot, they all tend to be pretty equivalent (well, I'd avoid Gentoo and Arch unless you want to learn a lot more than you'd planned on about building packages from source).

Three months from now, you can be a bit knowledgeable in Rails or own a Mac. Which is the better option depends on what you really want to do and how much effort you want to put forth.

I second the idea of Linux, and suggest installing it in a VM under Windows 8. And yes there:s a learning curve, but one driven by necessity and applicable to the world of web applications of which Rails is a part.

Good luck.

Thanks. Any pointers / links for where I can go from here?
I recommend installing Ubuntu on a separate partition to avoid upgrading issues later on:

https://youtu.be/SKsIvLPqlrc

Then completing this Rails tutorial:

http://ruby.railstutorial.org

Then expanding your knowledge with RailsCasts while developing your own web application:

http://railscasts.com

Am aware of Railscasts. Thank you for the links to the video and RailsTutorial.
Get a vps. For 20-30 usd you have a machine on the internet to play with.

Yes, you are making barriers.

If VPS = Virtual Private Server, which one can you recommend?
I'd recommend Digital Ocean, I've been using them for about 5 months now and they have been pretty good. Smooth running, fast machine, and they start at $5 a month (which is what I'm on). For Rails you might want to go for a $10 a month one, but it won't matter too much.

Here's a (referral) link: https://www.digitalocean.com/?refcode=09e94b0118a3

Although I have given my referral link, my recommendation holds whether you choose to go for them or not.

Here is my suggestion: use virtualization software and run an ubuntu vm. Deploy code to Heroku.
Yes; Heroku for sure.
Heroku is good for their free tier, but when it comes to production hosting I think they are hugely overpriced. If you can manage to get a bit of experience configuring a basic Linux server, using a VPS or dedicated hosting provider will be considerably cheaper.
It's absolutely worth learning to use Linux in a VM for this kind of development work - you'll be deploying on Linux anyway, so it makes sense to use that as your development environment as well.

Give VirtualBox a try - it's free. https://www.virtualbox.org/

Personally I like Ubuntu.

+1 for Virtual Box, I find it to be practically as good as any of the paid options.

As for Linux, lots of people seem to dislike Ubuntu for various reasons, but at the end of the day, googling "ubuntu <something> tutorial" will almost always get you a good solution.

+1 I learned Rails on Ubuntu & later used it on Windows, too. If you watch online tutorials where they type "brew install [something]", you most likely will be served by either "apt-get install [something]" - if this doesn't work try a quick Google search or find the package's name with "apt-cache search [something]".
Will look up VirtualBox. Thanks.
A virtual machine is definitely the way to go. If you want, you can boot it, then use PuTTY (for shells) and Samba mounts (for disk access) and treat it like you'd treat any other remote machine. Quite handy as devops training with your Rails practice.
Agree. A Mac is totally unnecessary and I would advise setting up a vm like VirtualBox (easy and free) and running a popular Linux distro (Ubuntu).
Been programming with a Windows box for a few years now with virtual box. It's quite good. Recent versions have solid dual monitor support too. It's still not flawless but it's good enough to not be disruptive or annoying enough to warrant dual booting.
There is a ruby installer for Windows http://rubyinstaller.org/ , so you can just install that and then do "gem install rails" from the command line.

I imagine this is good enough to get you started.

Once you are ready to move on and start developing on a unix system you can install Vagrant which will give you disposable dev virtual machines running Linux (which will likely be closer to a real deployment environment than a Mac would be). http://www.vagrantup.com/

Your other alternative is to install a full Linux distribution on your computer. Honestly though you are best off using Vagrant in the long run regardless of your primary OS simply to avoid various headaches. Probably even if you use a Mac.

One of the biggest problems for newbies is that filenames in Linux are case sensitive whereas on Mac/Windows they are not.

A Mac is by no means a prerequisite for using Rails. The screenshots might look a little different , but in most cases the important parts will be identical.

Thank you for the pointers.
Don't buy a mac for this. It's an expensive way to solve the problem.

This will probably get me downvoted but:

Download a dodgy OSX VM and run it inside VMware.

Then contact whoever is issuing the course and explain to them that the course should be OS neutral.

Either that or find another more friendly course.

Appreciate your feedback. They all say that their course is OS neutral, but I've heard that once you're in it, you could get lost.
Windows used to work when running Rails but then it broke again for some reason. That's just the way it is with Rails, since very few people use it on Windows, Windows bugs are taken care of extremely slowly.

So what I did when starting out was use Linux Mint on a virtual machine to learn. It was a pain in the ass but it worked, the speed of the VM was negligible but sometimes I wished I was on a real machine instead of a VM.

When I knew that I would be use Rails for the long-run I bought myself an iMac and haven't looked back. Everything Rails-related runs beautifully because the majority of Rails developer use Mac OSX. You got homebrew, rubymine, sublimetext, the works. I love my dev machine and can't see myself using Linux to develop things on again.

Your experience is the reason why I asked this question on this forum. Thanks for sharing.
You're probably excited about learning rails - if so, just go ahead and jump into it. Like right now, don't worry about anything else.

You'll soon realize the value of not using Windows. A big part of learning as a newbie is to just try things out. Then you can understand in a very personal way why everyone on HN is telling you to develop on a linux VM (or Mac when you get it).

You'll also find out that "learning Rails" as someone with zero programming experience really isn't about learning just Rails. It's going to be valuable to learn the command line, git, heroku, etc.

A great resource for a complete newbie is the material from Coursera's "Startup Engineering" class. There's a lot of business-y stuff in it (e.g. market sizing) but you can just ignore that and follow the instructions they give for setting up a decent dev environment and all the tools you'll need to do basic work. The reason it's so great is that they really hold your hand through setting up a lot of the background "infrastructural" stuff that someone with zero programming experience might not be aware of.

Thank you. Will also look up 'Startup Engineering'.
I'd actually caution against this, as a Rails dev of 7 years who works on Windows. Trying to follow even basic tutorials on Windows will get frustrating quickly.
What are you cautioning me about, cheald? Can you clarify.
Don't just "dive in" on Windows. The frustration will drive you away from learning Rails, just because it's such a miserable experience on Windows. Set up a VM or use a VPS.
Sublime Text and Ubuntu is not a bad choice.
You could try the RailsInstaller (http://www.railsinstaller.org/en) project from Luis Lavena. I went from essentially zero webdev experience to completing Michael Hartl's Rails Tutorial to building modest production applications in Rails on my Windows 7 PC at work with RailsInstaller as my starting point. It hasn't been problem-free, but I've been able to get great support through the RailsInstaller Google group.

Full disclosure, though, I also have a Mac for personal use and I've definitely found Rails development and deployment to be much easier on a linux-like platform than a Windows one.

Michael Hartl had suggested to me that while it can be done on Windows, I'd probably be more efficient with his tutorial if I get a Mac.
Honestly it shouldn't make too much of a difference. I've never used rails on Windows myself, but I've heard it works alright. If you're really worried, I'd install a Linux VM on your computer and work from there.
You want to do rails development on a nix system, which basically means Linux or Mac. Developing on Windows will be frustrating: some gems won't work (especially ones that call C code written for a nix environment), everything will run slower, and many tutorials will be confusing.

If you're just setting out learning programming it's a very instructive experience to set up a Linux environment anyway. With modern machines you can "virtualize" an operating system -- basically running linux as a program inside windows -- which gets rid of a bunch of the hassle involved in maintaining a linux desktop. I'd start by installing Ubuntu desktop inside Virtualbox and getting a rails environment set up there. This will give you a much more frictionless rails experience and you'll get to learn a bit about linux in the process.

You may end up buying a mac later on, but there's no reason to delay learning about rails just because of it. Just get started with the Virtual machine, learn a bit about linux, and go from there. Many professional rails developers use linux VMs on their Macs anyway.

learn rails however you can, then do some freelance work and buy a Mac ASAP
I'd suggest a VM with Samba mount and Sublime Text. I'd suggest this setup even if you're using a Mac because then you can match your deployment environment.
The short answer is do it right now with whatever tools youve got and learn what you need to learn to get a Rails app up and running.

Your OS doesn't matter so much when you're first starting out. It'll matter later on when you get the hang of some more intermediate to advanced concepts.

My belief (and a question like this will solicit only beliefs from everyone even if presented as facts) is that you probably want a Unix-like OS if you're getting into any web development. The only exception to that rule is if you're going to be primarily using Microsoft technologies like .NET, C#, IIS, or any other number of MS technologies.

I'll give you a rundown of what I've found the best uses for each OS are. This is coming from someone who prefers a Mac (used at home) and uses both Windows and Linux at work. So I've got a lot of experience with all 3 and have used them all for heavy web development projects.

Windows is just fine to start with. You have access to a lot of high level and mainstream tools like code editors and graphics programs. If you're a point-and-click kind of person you'll have no problem. Problems start to arise when you need to set up a local dev environment that would resemble a test or prod environment. You have to jump through hoops and install non-standard programs to get things like Rubygems, and different Ruby versions running locally. It's not difficult per se but you'll find out what I mean when I say its a hassle if you use any other OS. Also, the command line is sorely lacking on Windows and even tools like Cygwin leave something to be desired at times.

Macs are a great alternative to Windows and my Preferred OS for web development. You get a beautiful interface that's relatively easy to switch over to from Windows. You still get all the power of GUI tools plus the vast majority of Unix-y tools under the hood. It's great for design (you can run Photoshop and other great tools natively) and you get equal or better variety of code editos like Wondows. Where the Mac really shines is once you start playing with the terminal. You've got almost all of the Unix tools you'd have in a prod environment installed by default and you can run things like RVM, Rbenv, and server stacks like AMP (apache, MySQL, PHP) or Nginx instead of Apache and generally just replicate a standard Ruby stack locally through the command line like you would in Linux or with MAMP-style programs. It lacks a decent package manager but tools like Homebrew take care of that for you. Macs, to me, are like Linux distros with top notch desig tools (and minus the freedom but I'm not speaking philosophically here).

Linux distros are very similar to OS X in a lot of ways but have extra Unix tools pre installed that a Mac doesn't have (but can get). They're not always the prettiest and its rare that a designer prefers them (I mention design because for me its a standard part of development) but they're usually the most powerful when it comes to the 3 main OSes out there today. By power I don't mean speed and the ability of the software to take advantage of the hardware. I mean it gives you powerful tools and an unspoken but understood "Unix Way" of doing things. There is a bit of a learning curve however. A local development environment on a Linux machine will most likely best mirror anything you'd publish online.

I went from Windows to Mac to Linux when I was learning web development. Windows let me jump right in with the real simple high level stuff but then gave me trouble when it was time to get more advanced. My Macs let me get all the way to an expert level and never got in my way. I was actually able to learn a lot about how Linux works on a Mac and transfer those skills over so when I got into Linux I was very comfortable. Linux taught me even more valuable skills, many of which I brought back to the Mac.

In the end I chose Mac as my preference because for me its a great middle ground between the absol...

> It'll matter later on when you get the hang of some more intermediate to advanced concepts.

Or when you want to install any gem with a C extension, like mysql2 or nokogiri, which many tutorials will steer you towards in the first 30 seconds.

Yes, Ruby is unbearably painful to use on Windows for this reason. Your dev environment will be brittle and you'll have to spend lots of time dealing with platform issues, which you won't find easy help for.
Bill,thanks for taking the time to write your comments. Writeapp.me looks cool; is it built on Rails?
It actually isn't built on Rails but I'm in the middle of a rewrite which is using Rails. Thanks for the compliment!
Probably the simplest approach that lets you do local dev is VirtualBox + Vagrant + an Ubuntu box. This combination shouldn't take a great deal of time to setup (10-20 minutes + download time), is pretty much zero cost and means you can use the laptop that you currently have.

If you can do remote dev, then a cheap VPS might make sense, however this means that you need to be learning somewhere with 'net access.

If you don't want to bother with VMs and other Windows workarounds, I can suggest signing up for http://action.io and getting a basic development server. You can then use PuTTY or their own web IDE to connect to the machine and start developing.