Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×

Apple Publishes Ruby On Rails Tutorial 228

bonch writes "Apple has noticed the high amount of Mac usage in the Ruby on Rails community and has posted an illustrated Ruby on Rails tutorial. The document goes into more concise detail in getting new users up to speed, from database schema to moving beyond scaffolding, all done with the favored Rails editor, Textmate."
This discussion has been archived. No new comments can be posted.

Apple Publishes Ruby On Rails Tutorial

Comments Filter:
  • by ObsessiveMathsFreak ( 773371 ) <obsessivemathsfreak.eircom@net> on Tuesday February 28, 2006 @07:47AM (#14815536) Homepage Journal
    Jobs: Ruby is groovy man. It's got like, vibe. We had to get in on that.

    Gates: C# with .NET offers more flexibility with less development worries and higher performance...

    Jobs: Man! Talk about Squaresville! Ruby is hip man! It's a love machine. A child of the earth.

    Torvalds: Ruby is based on perl, which is in turn based on bash scripting, which I like.

    Jobs: You see man! Ruby is a free spirit. It grows in like, the sunshine. It doesn't obey your rules!

    Gates: But it's just another paradigm. .NET can accomplish all the same....

    Jobs: On Rails man! Rails!!! It's like hyperspeed into the cosmos. And that's why its fit for Apple's attention. Now if you'll excuse me, I have to go get some podcasts over rss, browse some blogs, do some yoga. You dig?

    ***Jobs walk's away clicking fingers rhythmicly***

    Gates: But it's all just flash and hype. Nothing really new is going on! .NET does all this! Why won't anyone listen? You believe me right?

    Torvalds: Look man. I really just don't give a shit.
    • Re:Ruby Is Groovy (Score:2, Insightful)

      by Anonymous Coward
      .NET's ORM system is nowhere near as complete or useful as the one in Rails... You're kidding yourself if you think otherwise (and yes, I have tried development in both systems and Rails beats .NET hands down)
    • Re:Ruby Is Groovy (Score:3, Insightful)

      by k2r ( 255754 )
      > Ruby is a free spirit. It grows in like, the sunshine. It doesn't obey your rules!

      It's more like "Ruby doesn't get in your way!" as Rails dosn't do (most of the time) and OSX avoids to do quite successfully , too.

      Chunky. Bacon.
      k2r
      • I disagree with that statement thoroughly.

        Ruby is fantastic. Rails will probably be fantastic in about two years. Right now it's an immature product that gets in your way constantly, if you do anything seriously involved in it. Rails error messages range from "moderately unhelpful" to "holy shit obscure".

        It seems that premature rails hype is leading to coders looking at it, and deciding that ruby is a shitty, inflexible, immature language, when they're blaming the wrong thing.
    • Ballmer: (Throws a chair)
    • But have you ever seen Ruby on Rails... on weeeeeeed?
  • ...to delve into Ruby. I was kind of tired of trying other tutorials (mainly from the internet) as I fouind them incomplete and sincerely wanting. Thanks to slashdot for the link.
    • I was kind of tired of trying other tutorials (mainly from the internet) as I fouind them incomplete and sincerely wanting.

      Did you see Programming Ruby: The Pragmatic Programmer's Guide [rubycentral.com], by Ruby's creator Yukihiro Matsumoto? It's a freely-available transcript of a paper book, and I'm halfway through and finding it good going.

      Now I'm only playing with Ruby at the moment, so I couldn't say how the examples and sections stand up to heavy industrial use, but if seems an excellent introduction and the tone an

  • Hey, I hear Baskin Robins is coming out with a new ice cream this month, "Ruby."

    This month only though, flavor of the month. Next month they're doing AJAX.

  • According to Apple's article:
    The version of Ruby that ships on Mac OS X Tiger is 1.8.2, but it doesn't work well with Rails. So you'll need to upgrade your Ruby installation as well as install a newer version of Rails (as of this writing, use version 1.8.4).
    So my question is: if Apple thinks Ruby on Rails is such hot shit, why doesn't they just upgrade their version to 1.8.4 via Software Update?
    • by skribble ( 98873 ) on Tuesday February 28, 2006 @08:45AM (#14815697) Homepage
      So my question is: if Apple thinks Ruby on Rails is such hot shit, why doesn't they just upgrade their version to 1.8.4 via Software Update?

      Because it's probably not fully tested to work with Tiger. The only system updates you get with Software Update and bug fixes and security fixes. Occasionally you'll get something else which works behind the scenes with an updated iApp as well (there have been minor CoreImage and other framework pieces updated this way).

      This is just good sense, it's stability vs. cutting edge. Also it can be a very bad thing to update the system incrementally (Ask Microsoft who have been bitten by this many times... often updating one thing can have unexpected results on others.

      Also, for a developers interested in using Rails, updating Ruby is fairly trivial. I would also add that often even if Apple includes the latest version of something you may want to compile it yourself anyway (Apache, PHP. MySQL are good examples of things that people will often *upgrade* right out of the box).

      • Because it's probably not fully tested to work with Tiger. The only system updates you get with Software Update and bug fixes and security fixes.

        Well, actually, Apple has miscompiled Ruby since 2003. The pack/unpack functions don't work correctly. You can recompile 1.8.2 yourself and make it work just fine with Rails.

        The problem is that Apple cross compiled Ruby screwy, so it thinks it's on a little endian machine when it's really on a PPC.

        Converting stuff to Network Byte Order will actually give you the
      • [...] for a developers interested in using Rails, updating Ruby is fairly trivial.

        Another point is that many people use a custom install of Ruby to ensure that they're using the same version as their webhosting service. There's no reason to run a newer version when that just introduces an unecessary difference between your development and production environments.
      • I have been going to WWDC for three years now. Every year during the feedback sessions people always ask the same things.

        1) How come you hate webobjects developers so much.
        2) When are you going to get a decent package management tool or formally adopt darwinports.

        Every year the answers are the same.

        1) We don't really hate you guys, we really love you, we neglect webobjects on purpose.
        2) We are apple, neither darwinports nor pkgsrc, nor fink is good enough for us. One day we will write a really cool one just
    • Here's a tutorial for getting a completely self contained Rails dev environment ready to go on OS X, without having to worry about the default OS X Ruby install not supporting Readline and such.

      Ruby on Rails, Lighttpd, MySQL on OS X Tiger [hivelogic.com]

      It's also a good tutorial for learning in general how to get the development tools you need and compiling them from source into /usr/local/

    • Because later in that same paragraph:

      It starts by installing Ruby 1.8.4 without overwriting the system-installed Ruby (it puts the new version in /usr/local). That way, the default system works as expected for other users or programs already coded for the system-installed ruby.

      Now if you'd asked why 1.8.4 might break things expecting 1.8.2, that's another question :)

      Mark
    • Comment removed based on user account deletion
      • No, it's that Apple's version of Ruby is screwed up. I still run most of my Rails apps on 1.8.2 (25th December 2004 build).
      • "There's something wrong, somehow, about the notion that a "mature" framework requires the absolute bleeding edge version, such that 1.8.4 works and 1.8.2 doesn't."

        Rails only hit 1.0 a few months ago, makes sense that they'll want people to run it with a Ruby release at least as recent, if only so people don't get bitten by security issues or bugs Rails exposes in earlier versions. FWIW I run Rails fine on an oldish Ruby 1.8.2 out of FreeBSD ports; I dare say Apple don't maintain their Ruby release as well
    • ... the majority of Apple users don't care about Ruby or Ruby on Rails, so there really isn't a reason for a Software Update upgrade that only .5 % (maybe less?) of their users want. For those that do care (such as myself) it's a relatively painless upgrade doing it yourself.
  • by MrByte420 ( 554317 ) * on Tuesday February 28, 2006 @08:35AM (#14815666) Journal
    The authors of rails books need to stop writing tutorials and write some comprehensive documentation. Even the page is quite lacking. [rubyonrails.org]

    For example, suppose you have a time field, not a date field, no year, just time. And you want to create that element in your webform.

    If it were date, you'd use date_select, pass it the name of the object and the name of the field, and your done, you get a nice input box. Suppose you want the same thing for time, its still date select with a series of discard attributes, e.g.

    date_select('meeting','starttime', :discard_year => true)

    However, you as the person looking for the documentation for this are led on somewhat of a goose chase becuase your time input box information is not even close to what you'd expect (time_select perhaps?) and you should be looking under "date" for "time".

    (Incidentally, Rails 1.0 has a bug where it seems to ignore :discard_year so the whole exercise is quite fustrating when you do find the docs, but i can live with bugs that will be fixed)
    • The authors of rails books need to stop writing tutorials and write some comprehensive documentation.

      This is what pushed me away from Rails not long after I started looking into it. Aside from API guides and the like, all real documentation on Rails and Ruby is outdated or sparse. Sure, there are lots of Rails tutorials out now, plus there's Why's Poignant Guide, but these alone are not nearly enough. The RoR community's answer is, of course, to simply buy the Programming Ruby and Agile Web Development wit
      • Don't get me wrong, the pragmatic progarmmer's book is pretty good, but its sparse in many parts.
      • (Aside: You can get the pickaxe and awdw/ror books for a little under fifty on bookpool.com, fwiw. (I just ordered them yesterday.))

        Yeah, it is kind of a bummer to need to shell out some cash up front for texts, but on the other hand:
        a) I remember when that was pretty much the case for Perl (Camel Book), and at least I've gotten a lot of mileage out of that investment.
        b) to most anyone in IT, $50 is not that much money
        c) assume the best case, where RoR really is good for you and your needs, what's the

        • the author states he's moving onto the next development tree, and the current version is 39 euro with no mention of the possibility to freely upgrade to 2.0 whenever that comes out (if the upgrade would even fix the bugs!).

          Don't be so lazy next time, and try actually reading the blog entry where the new branch was mentioned [macromates.com]...

          You may wonder if this will be the 2.0 release, and likely it will. But it will be a free upgrade for all registered users. Though please do not buy TextMate today for what you think

        • At least if you buy the PDF's, Pragmatic Programmers iteratively "develops" the PDFs, so you can d/l a new version at a later date.

          Again, how many Java books did you buy, that you rebought after each major Java upgrade, etc.?

        • As a long-time text editor junkie, I actually like TextMate in a lot of ways despite its occasional warts. I've been a Vim user since the late '90s, it's pretty powerful, and you certainly can't beat its price, but the only editor I've seen that really beats TextMate's extensibility through its "bundle" system is XEmacs. (Or GNU Emacs, of course -- I just find XEmacs a bit friendlier.) And TM is considerably easier to extend than Emacsen.

          If you like Vim for everything, more power to you; I'm still likely to
      • WTF. Why object to paying 50 bucks for a book? You get a free language, free framework, free IDE, free operating system. Just pay 50 bucks for a book and be happy.
  • As noted on the Ruby on Rails weblog, the author is Mike Clark, who is fairly involved in the Rails community. He's not an Apple employee though. The ADC article just doesn't have his name on it, so it mistakenly seems like this tutorial came from within Apple.
  • The tutorial is concise and clean - a must for folks like me that don't have tons of time... I appreciate the post to ./ about this... my son has been asking about Ruby, and neither he nor I have had time to do anything with it at this point.

    I agree that the article should be attributed. It's important to give credit where credit is due. It's also interesting that the article mentions http://macromates.com/ [slashdot.org]">TextMate. TextMate is a nice concept.

    Simple tutorials like this are critical to the adoption
  • Hey Ruby/Rails users...giving you a chance to evangelize. I've never used it, but to me, it almost seems like a framework designed to make quick demos, but every demo I have seen is completely lacking in any design or uniqueness.

    So, my question is this: how easy is it if you want to have a more complex visual layout? What If I want a form to submit to an encrypted text file? What if I need to work this system into a very intricate design?

    What I'm trying to get at is: does its simplicity w/r/t getting s
    • Give it a try and you'll find it can meet just about any needs. The HTML templates are something like JSP where you drop your data into an HTML page, so there is no limit on RoR site designs.

      You'll find that most of the time Rails' data handling makes your life much easier than other frameworks. When Rails doesn't quite make the right decisions about your data you can always override the default functionality with the same or less work than would be required using other frameworks.

      In my opinion, Rails is a
    • I'm a bit too busy to go into any depth, but Ruby can be a very 'meta' language (much like LISP or Smalltalk) and it's easy to override almost anything, so dealing with special cases is pretty easy.

      I've developed some pretty large scale things with RoR that required a lot beyond what the framework offered, and it's been fine.. although in hindsight I can see how I should have done things a bit different. That's mainly due to a lack of knowledge of Ruby rather than Rails though. Ruby is a lot more powerful t
  • by YetAnotherName ( 168064 ) on Tuesday February 28, 2006 @09:46AM (#14815997) Homepage

    See also this screencast [nasa.gov] for a comparison of Ruby on Rails, Zope (Plone), TurboGears, and Django. Oh, and J2EE which fares ... rather poorly in my opinion.

    Warning: the screencast is 36 minutes long!

    • Can you expand your point about exposing too much SQL? My worst experience with a framework was with J2EE entity beans (EJB ver. 2.0.) - the persistence layer that tried to hide the SQL only to reimplement it totally half-assedly. The EQL sucked a big time:

      - no mass updates/deletes.
      - no aggregation (count,max,min,sum)
      - no dynamic queries
      - restricted joins
      I've heard they fixed it to some degree in EJB ver. 3.0, getting it close to the actual SQL expression power.

      Do you know a persistence framework

    • It's not as if J2EE is the only way to do web application development with Java. Some times a Mack truck is needed, most of the time a pickup [apache.org] will do.
  • This may be a dumb question but...

    Everything I'm seeing about Ruby on Rails says it's great for making "Web Applications". I'm going to start designing a new dynamic website soon, and I was wondering about building it using RoR.

    I just want to use CSS, and plug the whole thing into a database.

    So are they just buzzwording me, or is RoR the wrong tool to use for something like this?
    • "I just want to use CSS, and plug the whole thing into a database."

      I'm confused. CSS works with HTML to do page layout. Ruby on Rails uses template which are written in HTML and CSS just like any other web page.

      As far as just plugging it into the database, I suppose Rails is as close as you're going to get unless you just want to use a Content Management System (try joomla if you want a CMS). With Rails you build your database backend, then create a few lines of code to have Rails pull out the data and put
  • I'm going gung ho into RoR. I've bought the book from the Pragmatic Studio. I've bought TextMate. But I continue to hit a dead end. And its not getting away from scaffolding. No it comes down to an admin interface. RoR needs one desperately. And now. Django has one built in. Every tutorial on Rails is basically a one table tutorial with an occasional lookup table thrown in. Please somebody point me to a comprehensive step by step tutorial that details the creation of an administrative side of a we
    • The AWDR book from Pragmatic includes material on creating an admin interface to the Depot application. I've found that to be a useful starting point for my own efforts. Chad Fowler's upcoming Rails Recipes book also has information on authentication. There are also a good number of auth plugins to be found on the wiki (wiki.rubyonrails.org), though I've found that it's simple enough to roll your own.

      Once you've worked out your authentication, it's pretty easy to use scaffolding to create the basics of yo
    • During the snakes and rubies talk david was asked about admin interfaces. He said something like "ROR doesn't really need one because there is a shell and you can work directly with activerecord objects from the shell, this is better then an admin screen".

      His take is that you can work right inside the framework using nothing but ruby to manipulate your activerecord objects. This should be better then directly manipulating your tables because theoretically your activerecord objects keep your relations, valid
  • by Qbertino ( 265505 ) <moiraNO@SPAMmodparlor.com> on Tuesday February 28, 2006 @09:57AM (#14816056)
    Hey, Guys! Get with the programm. Ruby on Rails is so last-season.
    Django [djangoproject.com] is where the musics at. And for good reasons too. It's more mature, easyer to use, faster in developement, less performance hungry, has a documentation that's up to date and has a grown up backend kit. It's only that they GPLd it last summer, that's why it hasn't gotten all the press yet.
    And this is not to start a flamewar. Compare them both and you'll see what I mean.
    The RoR and Django guys are good friends btw.
  • I hope they've told this guy [onlamp.com] about this new article.
  • no Locomotive love? (Score:3, Informative)

    by cygnus ( 17101 ) on Tuesday February 28, 2006 @12:45PM (#14817525) Homepage
    i'm kind of bummed that they didn't mention Locomotive [raaum.org], which really makes getting started with Rails very very easy. it seems like every Rails tutorial starts with "OK compile Ruby, install Gems, install Rails, install and configure MySQL, and 10 hours later, you can use this really simple framework!" when with Locomotive and SQLite3, you can basically just download one app, click two buttons, and start typing.
    • I used Locomotive when I was playing with RoR a few months back and it is amazingly simple. Locomotive is easy to install, run, and even easy to get rid of if necessary (just drag it to the trash like everything else).

      Andrew
  • WebObjects (Score:3, Interesting)

    by macserv ( 701681 ) on Tuesday February 28, 2006 @03:40PM (#14819618)
    I don't understand why someone would want to use Ruby on Rails on Mac OS X, when WebObjects comes with the developer tools, is an enterprise-class Java app server, and is way faster in both development and deployment (on Mac, Windows, Unix, or Linux) than anything else I've seen.

    It really is the best kept secret in the web app world. If you've not tried it, you might want to give it a shot.
  • Catalyst [perl.org] is the hot new Perl based Model-View-Controller framework. It's been out for about a year, it's production ready easy for any competent programmer to work with, and backed by massive collection of libraries on CPAN [cpan.org]. It has a large friendly and active user community, which you can find via the website.

    Me, I'm using it for lots of things - my project of the moment is gluing in some of the tasty AI modules on CPAN into it for automatic classification.

What is research but a blind date with knowledge? -- Will Harvey

Working...