top | item 3044908

Modern Ruby Development

83 points| davesims | 14 years ago |ascarter.net | reply

53 comments

order
[+] sunkencity|14 years ago|reply
Interesting guide, one thing I find lacking in ruby is longevity in projects. Too much cool new stuff, why not just work out the bugs in the existing projects instead? Of course it's easier to write a new half-assed implementation than getting the hard last percent done.

Interesting that he roots for homebrew over macports and rbenv over rvm while at the same time voting for capistrano. Of those 3 projects I find macports and rvm to do what I need from them perfectly and capistrano to be really lacking in both performance and complexity.

[+] rhizome|14 years ago|reply
Too much cool new stuff, why not just work out the bugs in the existing projects instead?

This may not be a popular opinion, but I have a suspicion that the high degree of wheel reinvention in the world of Ruby and Rails libraries is due to two things: NIH Syndrome & the professed preference by employers for people with active GitHub projects. This causes all kinds of people to make their own gems and such where existing implementations could be improved without such a division (diffusion?) of labor.

[+] invisiblefunnel|14 years ago|reply
It seems to me that Homebrew is much more popular than Macports among rubyists. I would like to see actual data though.
[+] angelbob|14 years ago|reply
Capistrano is lacking, but has fewer good alternatives. What would you recommend over it?
[+] hello_moto|14 years ago|reply
Maybe maintaining someone else code is not something that this particular crowd prefer?

As today generation programmers, we often prefer to work on new features, new things as opposed to keeping things stable and fixing all the kinks.

Back in the old days, people were so happy if they could submit a patch.

[+] mrinterweb|14 years ago|reply
Personally, I don't understand the hype of rubyenv. I really love rvm. I'm not sure why the author called rvm a "mess of bash scripts". I guess because rvm has a lot of features? If I did not care for gemsets and all of the other niceties that rvm has, I guess I would be on the market for another ruby manager. The fact that the author of this article was rubbed the wrong way by Wayne and rvm, rubbed me the wrong way.
[+] rsanheim|14 years ago|reply
He probably called it a "mess of bash scripts" because, uh, it is a mess of bash scripts. Have you looked at the implementation? RVM is amazing in the functionality it has, don't get me wrong, but it hacks into your shell in some nasty ways and when things go wrong good luck figuring out why without diving deep into the underlying bash.
[+] angelbob|14 years ago|reply
Part of the problem is that it overrides extremely low-level things like cd. That can get in your way pretty badly if there's a bug, or just a feature you don't understand.
[+] mzatko|14 years ago|reply
Sorry guys, but this post is silly. What is modern on "ruby development" on mac? Why use zsh, xcode? "ruby development" doesn't mean you are doing rails.
[+] heimidal|14 years ago|reply
There's nothing silly about a developer sharing his preferred development configuration.

Also, you glossed over the fact that he's not installing Xcode so that he can use its IDE; rather, he's installing to get LLVM/GCC easily. He makes it clear that ZSH is his preference and that he recommends it.

The vast majority of developers looking for a guide to set up their machine for Ruby development will be Rails developers. Denying that is silly.

[+] stephencelis|14 years ago|reply

  If you want to set your login shell to zsh, go to System 
  Preferences -> Users and Groups. Right-click on your user 
  account and select Advanced Options. Change the login shell 
  dropdown to /bin/zsh.
You're better off using `chsh -s /bin/zsh` (or, better yet, `brew install zsh`, append `/usr/local/bin/zsh` to `/etc/shells`, and use that, instead).
[+] Groxx|14 years ago|reply
Software that lacks a good uninstaller is always suspect, to me. It makes me smile to know that this is all that's necessary to remove RVM:

  > rvm implode
How's rbenv for uninstallation? I'm familiar-enough with rvm that I know I can restore absolutely everything from scratch with a couple config options and a while for compilation - I'm more than happy to spend that to experiment as long as rbenv has a similar panic-button.
[+] JonnieCache|14 years ago|reply
You just delete your clone of the git repo and remove the oneliner from your .bash_profile
[+] skrebbel|14 years ago|reply
This article tells me that i'm not modern because I don't use a Mac, I don't like zsh, I prefer Mercurial, and so on.

Why isn't it titled "My brand new Rails development stack on Mac"?

[+] saraid216|14 years ago|reply
I thought this post would be about Ruby, but instead it's about Rails. Sort of. :(
[+] kristopolous|14 years ago|reply
Alright, let's do ruby then. I use vim with Ri, Rdoc, and ack-grep plugins (https://github.com/kristopolous/vimbuild) and then use irb with a bunch of extensions (http://stackoverflow.com/questions/2952793/anything-like-bpy...) but there is nothing out there that makes my life phenomenally easy yet (for instance, some really awesome code navigation tool). zsh has built-in autocomplete for ri; try running zsh then do "ri <tab>" (http://qaa.ath.cx/ri.png); that ought to win you to at least having it installed. And yes, you can do "ri XXX#<tab>" for the second level! (http://qaa.ath.cx/ri-kernel.png)

For the record, I do straight ruby; I don't even know how to deploy rails.

[+] BornInTheUSSR|14 years ago|reply
It's always interesting to see differences in people's 'base' stacks. Where feasible I like to have the environment on my dev machine reflect production as closely as possible so I would go with Passenger over Pow, but this is a great little guide.
[+] Pewpewarrows|14 years ago|reply
That's what I use Vagrant for: attempting to mimic production machines as close as possible. But that only happens as I'm testing before a release. Otherwise I use the easiest / best tool for the OS and machine that I'm developing on.
[+] Xylakant|14 years ago|reply
I actually miss vagrant/virtualbox in the stack. Why not use a virtual dev environment for every project you're working on. It seems silly to me to install all required components for each and every project on my dev machine, possibly with different/conflicting versions (think: multiple pg server versions etc.) instead of having a self contained environment for every project.
[+] gurkendoktor|14 years ago|reply
I thought the ad-hominem-ish bit about rvm was disappointing. The Ruby landscape is a weird place where each project belongs to one and only one name. Instead of improving on projects, people prefer to invent their own, and then the drama race begins. Open your Gemfile and try to find a gem with a truck factor != 1.

I think it is natural and understandable because there are many Ruby freelancers around who desire to build a brand around their name. But the "competition" between rbenv and rvm was not constructive at all so far. It would be much more helpful if there was one .rubyversion file that both would respect, for starters.

[+] capkutay|14 years ago|reply
Interesting...still weighing whether I want to familiarise myself with Ruby/RoR or if I should continue to enhance my python skills and learn Django...I think the fact that more people are talking about Ruby development may sway me towards RoR
[+] Dalves|14 years ago|reply
Depends, if I look at my local job listings where there's one ruby listing for every 10 python ones I'd say different but I'll admit that that ratio is abnormally high but indicates that the same trend governs most places bar Chicago. However, if I look at HN submissions, it's almost the other way around. Given that I've worked in three countries in the last 5 years and noticed the same trend in all of them, I am starting to think that Ruby developers are simply more evangelist.
[+] uptown|14 years ago|reply
Any recommendations for a good beginner ruby/rails book? Coming from a PHP world, but want to learn something new.
[+] telemachos|14 years ago|reply
For tutorial/walkthrough with lots of example small scripts Beginning Ruby, 2nd ed by Peter Cooper. For a straight reference The Ruby Programming Language by David Flanagan and Yukihiro Matsumoto. A middle-ground (tutorial first half; reference second half): Programming Ruby 1.9 (aka, the Pickaxe Book) by Dave Thomas.

A great second book (maybe even first if you're comfortable enough learning basic syntax on your own) is Eloquent Ruby by Russ Olsen.

[+] blantonl|14 years ago|reply
A huge flaw of Mac OS X is the lack of a proper package manager.

Mac OS X does provide a package manager - the App Store.

[+] crazydiamond|14 years ago|reply
I've been using macports for ages, nothing wrong with it. Okay, it does not check to see the stock installs of OSX, and installs its own ruby, perl, python etc. Apart from that it's been very reliable.