News for hackers. Stuff that matters.
Re:Getting Started in Rails is Insane by smacktoward on Monday October 17, 2011 @12:39PM (#3121215)
To get Rails running on a Mac, you simply have to install XCode

Why?

Seriously, even in Java you can get to "Hello World" with just a text editor. You don't need to download Eclipse first.

If installing XCode and editing things freaks you out, then you may not be cut out for the level of coding required to actually use Rails

I love the idea that someone who prefers emacs or vim over an IDE like XCode is insufficiently l33t for the awesomeness that is Rails.

Re:Getting Started in Rails is Insane by jshen on Monday October 17, 2011 @12:42PM (#3121230)
You have to install java first before you can create hello world in your text editor. That's the same as installing xcode. The point is to get a compiler, either the java compiler or the c compiler.
Re:Getting Started in Rails is Insane by smacktoward on Monday October 17, 2011 @12:44PM (#3121238)
Bzzt wrong. Installing Java is the same as installing Ruby. The JDK doesn't include an IDE.

And why do I need a C compiler to work in Ruby, anyway? I assume it's to compile your own version of Ruby. (Which is another way the Java comparison doesn't work -- you need the Java tools to compile your own code, not to compile Java.) But why on earth would a newbie want/need to do that?

Re:Getting Started in Rails is Insane by stevelosh on Monday October 17, 2011 @12:51PM (#3121271)

    And why do I need a C compiler to work in Ruby, anyway?
I'm not a Ruby programmer, but I'm betting it's the same reason as in Python: to be able to use libraries that have pieces written in C for speed.
Re:Getting Started in Rails is Insane by smacktoward on Monday October 17, 2011 @12:58PM (#3121305)
You're probably right. But at least in the Pythonverse that's something you don't run into right off the bat. The first step to getting started with, say, Django isn't "get a C compiler."
Re:Getting Started in Rails is Insane by jshen on Monday October 17, 2011 @01:43PM (#3121523)
nor is that the first step for rails. But for anything non trivial app you will likely need a C compiler in the end. I'm guessing this is the same for python.
Re:Getting Started in Rails is Insane by smacktoward on Monday October 17, 2011 @02:36PM (#3121778)
It's fairly uncommon in Python, at least in my limited experience. Libraries commonly advertise themselves as "Pure Python" to make it clear that they don't require compiling things in C.

If your project gets up to very large scale things are probably different, but there's no need to deal with that in a "Hello World"-type tutorial.

Re:Getting Started in Rails is Insane by jshen on Monday October 17, 2011 @02:48PM (#3121839)
I'm talking about very common things. How do you talk to a mysql database, i'll bet it's C code. how do you parse html, i'll bet it's C. python has a json lib as part of it's standard library, ruby does not so you install it as a gem. Both are C.

Actually, django is worse if this tutorial is correct.

http://programmingzen.com/2007/12/22/how-to-install-django-w...

They are telling you to install a binary precompiled library. I much prefer having my dependencies managed as they are in bundler than downloading libraries manually and installing them.

Re:Getting Started in Rails is Insane by smacktoward on Monday October 17, 2011 @04:32PM (#3122317)
Or you can just let your distribution's repositories deal with all that for you. On Debian/Ubuntu/etc. Django and mysql-python are both installable via apt. That manages all your dependencies nicely. The versions you get may be a little older than you'd get if you grabbed them from elsewhere, but usually not so much that you'd notice.

I know there's been some bad blood between the Ruby and Debian communities about Debian package maintainers not accepting bleeding-edge versions of Ruby software into the Debian repos; that may have been why Ruby went off and built its own set of package managers.

Re:Getting Started in Rails is Insane by jshen on Monday October 17, 2011 @05:06PM (#3122458)
the ruby world moved away from this for a few reasons.

1. I develop on a mac and deploy on different linux distros. It makes more sense for me to have a single system for managing ruby dependencies than to do it with 3 or 4 different systems that work differently and may not be fully compatible. Plus, with bundler and rubygems I'm not stuck on whatever version the distro decides to support.

2. If I install something like the mysql driver manually or with apt-get, and then a year from now I'm no longer around and some other developer checks out the code ... how do they know which versions of the libraries were used? With bundler all versions of all gems are checked into version control. This is a big win, and they can get a system with exactly the same versions of everything with a simple 'bundle install' after a clean checkout!

Edit: 3. Also, there are likely to be C based python libraries you want to use that aren't maintained by your distro. Now you're in a situation where you are mixing multiple dependency management systems which gets ugly fast.

Re:Getting Started in Rails is Insane by jshen on Monday October 17, 2011 @12:51PM (#3121274)
You need the C compiler to compile gems that have C code which is pretty common.

If you wish you can use JRuby and you don't need a C compiler.

Re:Getting Started in Rails is Insane by smacktoward on Monday October 17, 2011 @01:00PM (#3121317)
So to work in Ruby I either need a C compiler or a JVM?

Is Ruby really so slow that you can't do "Hello World" in Rails without leaping into a faster environment?

Re:Getting Started in Rails is Insane by jshen on Monday October 17, 2011 @01:35PM (#3121476)
No, you can do hello world without a C compiler assuming you installed ruby from somewhere. If you want to use JRuby you will need a jvm for it to run on, this is the same as any JVM language.
Re:Getting Started in Rails is Insane by jcromartie on Monday October 17, 2011 @12:51PM (#3121276)
I beg to differ:

Java for OS X Lion: 62.53 MB; includes all basic tools to write Java code

Xcode for OS X Lion: 1.68 GB; is just a prereq for getting set up for cutting-edge Rails development

But Java and Xcode and Rails are really apples and oranges and pomegranates.

Re:Getting Started in Rails is Insane by jshen on Monday October 17, 2011 @01:41PM (#3121499)
I'm not sure what your saying here. The fact that apple decided to bundle gcc with Xcode doesn't have anything to do with ruby or rails. On linux you are fine as long as you have gcc.
Re:Getting Started in Rails is Insane by jcromartie on Monday October 17, 2011 @12:42PM (#3121228)
You don't need Xcode to develop with Rails on a Mac. You just need to install Xcode to get GCC and various other tools that the Rails install process requires.