Slashdot Mirror


Part 2 of Ruby on Rails Tutorial Online

An anonymous reader writes "Curt Hibbs has released Part 2 of his tutorial Rolling with Ruby on Rails to the O'Reilly ONLamp site. The first part was published in January. Topics covered are database transactions, callbacks, unit testing and caching." From the article: "In Rolling with Ruby on Rails, I barely scratched the surface of what you can do with Ruby on Rails. I didn't talk about data validation or database transactions, and I did not mention callbacks, unit testing, or caching. There was hardly a mention of the many helpers that Rails includes to make your life easier. I can't really do justice to all of these topics in the space of this article, but I will go into details on some of them and present a brief overview of the rest, with links to more detailed information."

187 comments

  1. Python Version of RoR by grayrest · · Score: 4, Interesting

    http://subway.python-hosting.com

    It's rough, but it's coming along.

    1. Re:Python Version of RoR by jellomizer · · Score: 3, Insightful

      It is always good to have two closly competing languages. Ruby and Python are so close in design it helps keep both on their toes. Some people consider Python and Perl to be competive but the language syntax is much more different, and often lead to more of a holy war debate on what is better. While I don't find this type of argument for Python vs. Ruby But I could just be looking in the wrong spots.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    2. Re:Python Version of RoR by KiloByte · · Score: 0, Troll

      Python and Perl not only differ in syntax, but also aim at completely different niches.
      You're not really supposed to write big programs in Perl -- Perl is better suited for short tasks, anything that includes heavy string parsing and/or sysadmin chores.

      [evil Perl zealot hat on] Python, on the other hand, serves as a poor excuse for a "real" language aimed for apps longer than several screenfuls of code -- but, it loses because of [XXXXX]. It's also likely to give you Cobol fingers.

      In the above, [XXXXX] stands for the real arguments against Python. They were censored out to keep this post within the Holy Wars traditions -- meaningful arguments are not allowed.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    3. Re:Python Version of RoR by m50d · · Score: 1

      Cobol fingers? If you've ever coded in a team you will be indenting anyway, python just means you can type most of the language using the normal keys, rather than twisting your fingers round to reach the edge of the keyboard at every turn. (Seriously, how do you type all that punctuation? I suppose the extreme conciseness of perl means there's less typing overall which maybe makes up for it, but still....)

      --
      I am trolling
    4. Re:Python Version of RoR by SpamJunkie · · Score: 0, Redundant
    5. Re:Python Version of RoR by Colonel+Panic · · Score: 4, Insightful

      Wouldn't that be PoR?

      Seriously, though, I really think that Ruby the language is part of what makes RoR so great. I'm not sure you can do a lot of the same stuff in Python as you can with Ruby. Being able to define natural looking domain-specific languages using Ruby's code blocks seems like something that would be very difficult in Python. But as they say, imiation is the sincerest form of flattery...

    6. Re:Python Version of RoR by Colonel+Panic · · Score: 3, Funny

      Sorry...
      That should be 'immolation is the sincerest form of flattery'.

    7. Re:Python Version of RoR by Simon · · Score: 3, Insightful
      Being able to define natural looking domain-specific languages using Ruby's code blocks seems like something that would be very difficult in Python.

      Do you any examples of this in action? I mean a non-trivial example showing a Ruby block based solution for a problem that is clearly better than the more tradional (messy?) solution.

      Impress me. :-)

      --
      Simon

    8. Re:Python Version of RoR by Anonymous Coward · · Score: 1, Funny

      Being able to define natural looking domain-specific languages using Ruby's code blocks seems like something that would be very difficult in Python. But as they say, imiation is the sincerest form of flattery...

      Yes, the guys who invented Smalltalk must be really proud that Ruby has finally managed to produce a popular version of all their innovations.

    9. Re:Python Version of RoR by Tyler+Eaves · · Score: 1

      Haven't done any ruby in a while, so I don't have any code handy, but blocks are great for things like GUI callbacks. You can put the code right where it would logically fit, and you don't end up with a 1001 quitButtonOnClick() type functions cluttering your namespace.

      --
      TODO: Something witty here...
    10. Re:Python Version of RoR by BridgeBum · · Score: 1

      Similar ideas worth taking a look at for python:

      http://www.cherrypy.org/

      BSD Licence, also based on MVC style design.

      --
      My UID is the product of 2 primes.
    11. Re:Python Version of RoR by smittyoneeach · · Score: 1

      Hopefully not a Java-esque Megalithic Vacuous Classterfsck (MVC).

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    12. Re:Python Version of RoR by Anonymous Coward · · Score: 1, Informative

      [3, 4, 2, 6, 7, 8, 1, 12, 5].sort { |x, y|
      if x >= 5 and y >= 5
      y x
      else
      x y
      end
      }

      This sorts the array in the ascending order up to 5, and in the descending order after that, which gives [1, 2, 3, 4, 12, 8, 7, 6, 5]. This is a very simple example, but it would be less nice without blocs. Then you have more interesting cases, like:

      [1, 3, 7].collect { |x| x+1 }

      Which gives [2, 4, 8]. The result array is built by taking every element of the first array and applying the bloc to it. Not convinced ?

      [3, 4, 12, 76, 2].find { |x| x > 4 and x.modulo(2) == 0 }

      Gives 12, of course. But by using the same bloc with find_all instead of find, you get [12, 76].

      Of course, it's nothing new. You could get an equally nice syntax by using a functional language. But to my mind, ruby brings you the best from OOP and the best front functional programming. I just wish it was faster.

    13. Re:Python Version of RoR by Anonymous Coward · · Score: 0

      It seems I should have be more careful. In the first bloc, you should have

      "y <=> x" and "x <=> y" instead of "y x" and "x y".

    14. Re:Python Version of RoR by congaflum · · Score: 1

      The ActiveRecord classes in Rails make use of these sorts of things quite a lot. For example:

      class Firm < ActiveRecord::Base
      has_many :clients
      has_one :account
      belongs_to :conglomorate

      before_destroy { |record| Client.destroy_all "client_of = #{record.id}" }
      end

      The before_destroy is a callback used to implement triggers in the code, similar to how they'd work in the DB. Shown here using a block but you can also just have regular method calls.



      Although it doesn't use blocks, I think the very declarative-looking use of has_many etc is quite nice too.


    15. Re:Python Version of RoR by Paradox · · Score: 4, Informative
      I can't impress you, sorry. But I can say that Ruby blocks are a powerful tool that are very flexible and useful. Ruby iterators are the showcase of this tool, and they're something you use every day in ruby. For example:
      ary = [1,2,3,4,5] # Example Array
      ary.each do |val| # Begin a block
      puts val.to_s + " was here!"
      end
      Blocks can be used inline as above, or turned into true closure-bearing functors like so:
      my_block = lambda { |x| puts x.to_s was here }
      my_block.call "Kilroy"
      ary = [1,2,3,4,5]
      ary.each &my_block
      You can write higher order functions that accept lexical blocks trivially. For example:
      def my_hof( &block )
      yield # Calls the associated block within scope
      block.call #Calls the associated block as a function
      end
      Also, ruby's blocks are used to do neat things like ensure things happen at the end of an operation. File I/O is the classic example. Check out how Ruby's library ensures your file closes:
      File.open( "somefile.txt", "w" ) do |handle|
      handle.puts "This is text in the file."
      end # File is ensured to be closed now
      This is just a small sample of what Ruby's standard lib does with blocks. They're really quite useful. They're like Lisp's lambdas but with a cleaner syntax when used inline.
      --
      Slashdot. It's Not For Common Sense
    16. Re:Python Version of RoR by Paradox · · Score: 1
      It isn't just Ruby's blocks that make Rails so great. It's the fact that it's possible for Ruby Classes to reopen themselves and dynamically define, alias, and remove methods from themselves.


      When you see a block of code like this in Rails:

      class Person < ActiveRecord::Base
      has_many :addresses
      has_and_belongs_to_many :friends, :class_name => "Person"
      end
      What it does is take the schema for the People table, parse it, and actually re-open the Person class at runtime and adds the methods to support the schema fields and relations.

      Open classes are something many languages frown upon, which is why it's so darn hard to make an ActiveRecord class or an ActionView class like Rails' in another language besdies Ruby.
      --
      Slashdot. It's Not For Common Sense
    17. Re:Python Version of RoR by thraxil · · Score: 2, Informative

      list comprehensions are fun.

      off the top of my head,

      [1,3,7].collect { |x| x + 1}

      would be written in python as:

      [x + 1 for x in [1,3,7]]

      (which i personally find much more readable) and

      [3,4,12,76,2].find { |x| x > 4 and x.modulo(2) == 0 }

      would be written in python as:

      [x for x in [3,4,12,76,2] if x > 4 and (x % 2) == 0][0]

      and the find_all version just wouldn't have '[0]' at the end.

      and the weird sort would be something like:

      [3,4,2,6,7,8,1,12,5].sort(lambda x,y: ((x >= 5 and y >= 5) and cmp(y,x)) or (cmp(x,y)))

      except that python's sort is in-place, so you'd really want to have that list in a variable if you intended to do anything with the results:

      l = [3,4,...]
      l.sort(lambda:...)

      most python programmers would shun that use of lambda though and do things in a slightly longer but more obvious fashion.

      --
      Smokey the Bear says, "Strip mining prevents forest fires!"
    18. Re:Python Version of RoR by Anonymous Coward · · Score: 0

      Or you can just use Ruby on Rails *today*. Yeah, Python is the "Java" of the open source world, but it won't kill you to learn Ruby.

      I don't think "Python on Rails" will ever quite be the same, because:

      1) it's not easy to add code to a class at run-time in Python (correct me if I'm wrong)

      and

      2) you can't use Python directly in HTML templates because of the whitespace thing.

      So I guess if you really want to use Python, go ahead, but I think the Ruby version will always be cleaner and tighter.

      You can actually do it *easier* in Perl than Python, but Perl is hard to read with all those dollar signs and things. Ruby beats both of them.

    19. Re:Python Version of RoR by Anonymous Coward · · Score: 0

      Exactly the opposite.

      from cherrypy import cpg

      class HelloWorld:

      @cpg.exposed
      def index(self):
      return "Hello world!"

      cpg.root = HelloWorld()
      cpg.server.start()

      As you can see, very little plumbing (more apparent on longer code).

      I never understood what's great about MVC when I looked at Java adoptions.

    20. Re:Python Version of RoR by arkanes · · Score: 1

      On the other hand, I actually prefer explicitly creating functions for everything rather than using lamdas or anonymous blocks all over the place. It makes refactoring easier, and the explicitness aids my comprehension of the code. Different strokes for different folks, I suppose.

    21. Re:Python Version of RoR by namekuseijin · · Score: 1

      So, as we all can see:

      Python programmers like procedures and procedure declarations;
      Ruby programmers like functions and anonymous function calls;

      and both languages and styles have their pros and cons and are Turing-equivalent.

      boy, that was boring...

      --
      I don't feel like it...
    22. Re:Python Version of RoR by swimmar132 · · Score: 1

      You don't have to use anonymous blocks.

  2. What is this? by Lovesquid · · Score: 3, Insightful

    Hmmm... nowhere in the summary does it tell what "Ruby on Rails" is, or why I should care about it, and with the server getting hammered, I can't RTFA to find out. How about including a 1-sentence summary of what the topic of any story IS before posting it, for those of us who don't already know everything there is to know about everything.

    1. Re:What is this? by JMUChrisF · · Score: 0

      from the rubyon rails web site

      Rails is a full-stack, open-source web framework in Ruby for writing real-world applications with joy and less code than most frameworks spend doing XML sit-ups

    2. Re:What is this? by Otter · · Score: 1
      I must have gotten in just ahead of the mob...to quote from Part I:

      Ruby on Rails, the super productive new way to develop web applications

      OK, that's helpful. Continuing...

      Ruby is a pure object-oriented programming language with a super clean syntax that makes programming elegant and fun...

      Rails is a open source Ruby framework for developing database-backed web applications. What's special about that? There are dozens of frameworks out there and most of them have been around much longer than Rails. Why should you care about yet another framework?

      What would you think if I told you that you could develop a web application at least ten times faster with Rails than you could with a typical Java framework? You can--without making any sacrifices in the quality of your application! How is this possible?

      Part of the answer is in the Ruby programming language. Many things that are very simple to do in Ruby are not even possible in most other languages. Rails takes full advantage of this. The rest of the answer is in two of Rail's guiding principles: less software and convention over configuration.

      Less software means you write fewer lines of code to implement your application. Keeping your code small means faster development and fewer bugs, which makes your code easier to understand, maintain, and enhance. Very shortly, you will see how Rails cuts your code burden.

      Convention over configuration means an end to verbose XML configuration files--there aren't any in Rails! Instead of configuration files, a Rails application uses a few simple programming conventions that allow it to figure out everything through reflection and discovery. Your application code and your running database already contain everything that Rails needs to know!

    3. Re:What is this? by Metteyya · · Score: 1

      You can always use Google. Ever heard of that tool? If not, check out Ruby on Rails Site.

    4. Re:What is this? by Cyberax · · Score: 1

      It's a collection of Java Best Practices rewritten in a 'cool' geeky language. Nothing new....

    5. Re:What is this? by davestar · · Score: 1
      Well, don't feel too bad. Even if you'd already read the previous article, you still wouldn't have a clue what this is:

      "In Rolling with Ruby on Rails, I barely scratched the surface of what you can do with Ruby on Rails"

    6. Re:What is this? by ggvaidya · · Score: 0

      I was about to say, "This is part two, as mentioned in the brief, part one is still around and up, so you could check that up if you wanted a background", but part one didn't really have much in the summary either. Ah, well, this is Slashdot, you must be new here, etc. etc. JFGI.

    7. Re:What is this? by iwan-nl · · Score: 1

      I've never used Ruby myself, but judging from the text you quoted, RoR people seem to have a weak spot for superlatives and exclamation marks... Let's just hope their coding is more "super" than their writing.

      --
      I'm trying to improve my English. Please correct me on any spelling/grammar errors in this post.
    8. Re:What is this? by JamesOfTheDesert · · Score: 5, Insightful
      It's a collection of Java Best Practices rewritten in a 'cool' geeky language. Nothing new....

      Quite true. For example, Java Best Practice #1 is to avoid using long, detailed XML files for configuration, and instead use the programming languge itself, which is dynamically loaded and interpreted when needed.

      Another Java Best Practice is to let the framework write the tedious boilerplate code for you. For example, in Struts, you just run

      % struts myAppName
      and you're halfway done writing your Web application.

      Here's one more Java Best Practice: Avoid expensive , complex application server software, and do rapid development using the Web server that is built into the standard library. Then deploy to the Web server of choice with no code changes or quirky vendor-specific API hacks.

      --

      Java is the blue pill
      Choose the red pill
    9. Re:What is this? by Saeed+al-Sahaf · · Score: 1

      Normally, "editors" would do something like this. Does Slashdot have "editors"?

      --
      "Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
    10. Re:What is this? by bobbinFrapples · · Score: 1

      harsh

    11. Re:What is this? by Cyberax · · Score: 1

      I advise you to read "Better, Faster, Lighter Java" by Bruce Tate for a list of current best practices.

    12. Re:What is this? by coldtone · · Score: 3, Insightful

      Halfway done?! You must be kidding!

      Being a java web developer, and using struts to build 3 different applications I have to say that enough is enough.

      Struts is a very simple web framework, which will do several things for you.
      Dramatically increase the size of your app.
      Limit the functionality of your app.
      Makes the code hard to read and follow. Just about everything runs though the struts config file.

      The only benefit I see with struts is that is provides some clean definitions for code. (A place for display, a place for validation, a place for the work to be done) And gives you some tags to help with internationalization. (Just help mind you, if you need to have a totally different layout for a different language then, well you're screwed.)

      I would only use struts again if I was writing an application that was to be localized and translated, and was working on a large team. Otherwise a well written set of JSP's will get the job done faster and will be easier to read.

    13. Re:What is this? by Anonymous Coward · · Score: 0

      sarcasm went over your head.. not that I agreed what he had to say...

    14. Re:What is this? by tigeba · · Score: 1, Insightful

      Please correct me if this is a mis-characterization, but RoR replaces maintaining long detailed XML configuration files with maintaing long, detailed database specific sql files.

      Using RoR, you create a table and let Ruby dynamically determine a bunch of information about relationships and data types and then you access various properties of this data. You are also forced to use RoR's Object model (You have to extend ActiveRecord, correct?)

      Using something like Hibernate, you write an object, then do something do describe it (Java Annotations, XDoclet markup, tedious XML configuration file) and It can create the DDL/alter tables on the fly for you, and you are not forced to extend any object.

      To me each approach seems to have merit, as well as inherent drawbacks.

    15. Re:What is this? by Anonymous Coward · · Score: 0
      What would you think if I told you that you could develop a web application at least ten times faster with Rails than you could with a typical Java framework?

      That you were exaggerating just a tiny bit.

      Many things that are very simple to do in Ruby are not even possible in most other languages.

      *cough* bullshit! *cough*

    16. Re:What is this? by swimmar132 · · Score: 2, Informative

      RoR replaces maintaining long detailed XML configuration files with maintaing long, detailed database specific sql files.

      No, RoR's models don't come from maintained SQL files. I believe it uses reflection to dynamically build the models.

      Using RoR, you create a table and let Ruby dynamically determine a bunch of information about relationships and data types and then you access various properties of this data.

      Yes.

      You are also forced to use RoR's Object model (You have to extend ActiveRecord, correct?)

      No. You can use the other components of Rails (ActionPack and the Web Service portion) without using ActiveRecord.

      Using something like Hibernate, you write an object, then do something do describe it (Java Annotations, XDoclet markup, tedious XML configuration file) and It can create the DDL/alter tables on the fly for you, and you are not forced to extend any object.

      That's probably true, I haven't worked with Hibernate. But with Rails, you make a change to the DB table, and the model instantly reflects that change.

    17. Re:What is this? by tigeba · · Score: 1

      "No, RoR's models don't come from maintained SQL files. I believe it uses reflection to dynamically build the models."

      I understand that RoR is not literally reading some sql file containing DDL. My point is merely that the database schema does not magically appear from nowhere. You as the developer have to create and maintain this DDL somehow. Most developers would probably maintain this as one or many sql files that they would blow into the database as needed.

      No. You can use the other components of Rails (ActionPack and the Web Service portion) without using ActiveRecord."

      Developing a database web application using RoR would be a bit pointless without the ActiveRecord portion now wouldnt it? I think I was fairly clear ly discussing the persistence portion of RoR.

    18. Re:What is this? by Enahs · · Score: 1

      Wow! You don't have time to read the article, but you have time to post a bitchy whiny comment.

      Amazing!

      --
      Stating on Slashdot that I like cheese since 1997.
    19. Re:What is this? by arkanes · · Score: 2, Informative
      My point is merely that the database schema does not magically appear from nowhere.

      It is magically pulled from the database. Lots of existing OR mapping tools can do this, including Java ones, but lacking Ruby's dynamic nature it's done as an extra pre-compilation step. Rails can do it at runtime.

    20. Re:What is this? by tigeba · · Score: 1


      Yes, but what magically puts it in the database? Nothing, the developer has to do this. Again the whole point is that this is not a zero configuration system, you are just offloading the configuration somewhere else.

    21. Re:What is this? by JamesOfTheDesert · · Score: 1
      Yes, but what magically puts it in the database? Nothing, the developer has to do this. Again the whole point is that this is not a zero configuration system, you are just offloading the configuration somewhere else.

      Yes, of course, and any claims that Rails eliminates config files are, um, over-statements.

      But: Given that *no* tool magically pulls the database schema by psychic forces straight from one's brain, the next best thing is to use a library that at least encourages you to use the best tool for the job. I would prefer to define my database using either a nice admin tool, or SQL. Or code in Ruby and have the database layer created for me (as Og/Nitro does).

      The goal in these kinds of tools is to decrease or eliminate the need for intermdiary formats. I'd rather define my database layer using either Ruby or SQL. Tools that require the use of some additional "binding" language introduce yet another layer of abstraction with little gain for the trouble (and yes, the current version of Rails still requires one to use YAML as a database config language).

      If Struts or whatver comes after it let the user define system details using Java or Groovy it would be a big improvement.

      --

      Java is the blue pill
      Choose the red pill
    22. Re:What is this? by arkanes · · Score: 1

      I may be overstating what Rails does, as I am not an expert in this, but i have worked with frameworks (and written a little half-assed one of my own) which pulls the *schema* information directly from the database, parses it, and uses that to create the mappings. The "configuration" is your database schema. The developer does nothing, unless they want to override the way the tool does the default OR mappings.

    23. Re:What is this? by cygnus · · Score: 1
      actually, some Java OR frameworks *do* do stuff at runtime... it's called "bytecode enhancement." Hibernate uses this to allow for lazy loading, for example.

      i guess the question is, does it make sense for your application to be continually figuring out what it's database schema is at runtime, when it usually changes so little once the app is developed. i can imagine for smaller projects with light loads and in RAD situations, this makes a lot of sense, because you're exchanging a little processing overhead for a lot of flexibility during development. but for large databases with lots of simultaneous users, where the database is never changed, or even was set in stone long before the app ever came along, using tools like Middlegen or XDoclet to do things like this at compile time makes a hell of a lot of sense.

      --
      Just raise the taxes on crack.
    24. Re:What is this? by legirons · · Score: 1

      "Hmmm... nowhere in the summary does it tell what "Ruby on Rails" is"

      We already know. Sorry. We watched the first video, and have been using it ever since. Seriously, it's fairly well-known among developers.

      "or why I should care about it"
      You don't have to care about it. And Slashdot summaries probably won't help. The video however, probably will, so it's good that they linked to that.

      Just my luck that at the moment I wanted to get RoR anyway for a project, I look on slashdot and see they've posted a story about it, with link to MPEG.

      "How about including a 1-sentence summary of what the topic of any story IS"

      Highlight any words you don't understand, right-click, and select "web search for selected text".

      As with many other technology definitions, you could just type the phrase literally into wikipedia and expect a reasonably good answer.

  3. Ruby is great by boeserjavamann · · Score: 1, Informative

    too bad there isn't the big fellowship right now (besides japan, where it is bigger than python, whatever that means ;) i think its the most clean and powerful oo-scriptings language available.

  4. Any interesting projects? by elh_inny · · Score: 4, Interesting

    Has anyone actually done some interesting stuff that now works in a productive environment?

    1. Re:Any interesting projects? by Nik13 · · Score: 2, Informative

      Last time when Pt1 of the the article came out, in the discussions on /. some sites were pointed out (seemed like decent sites too).

      I've been meaning to get around to add RoR to my apache (XAMPP) setup to try it out. Most of what I do at work is ASP/ASP.Net and I've been looking for something else (not to fully replace them, but perhaps as a complement). I'm not big on php, but it has it's uses and followers (I use it on some small websities with cheap hosting). J2EE isn't my definition of fun (although it's robust and all).

      From what I had seen, RoR seemed pretty promising (and it keeps getting better they say), but I'll have to dig deeper to see it's full power. The only problem I can see now is finding some decent hosting for that, preferably cheap (RoR *with postgresql* to make things worse).

      --
      ///<sig />
    2. Re:Any interesting projects? by elmartinos · · Score: 5, Informative
      Shure! Even though Ruby on Rails is really very young, there are a few commercial sites that use it already. Here are a few links: Although, the first 3 links are somewhat related.
    3. Re:Any interesting projects? by mrmargolis · · Score: 1, Redundant

      Basecamp(http://www.basecamphq.com/): tens of thousands of users, designed by the creator of RoR 43Things(http://www.43things.com/): thousands of users, now working with Amazon.com TadaList(http://tadalist.com/): an online todo list app with thousands of users Snowdevil(http://www.snowdevil.ca/): an online store that is powered by rails. It was deployed very rapidly using rails. If you can get through to the onlamp article there is a more complete listing of real world RoR applications at the end.

    4. Re:Any interesting projects? by orion024 · · Score: 1

      From what I had seen, RoR seemed pretty promising (and it keeps getting better they say), but I'll have to dig deeper to see it's full power. The only problem I can see now is finding some decent hosting for that, preferably cheap (RoR *with postgresql* to make things worse).

      Check out http://www.textdrive.com/

    5. Re:Any interesting projects? by gavri · · Score: 0, Insightful

      And there's Odeo about which there was a New York Times Article

    6. Re:Any interesting projects? by Anonymous Coward · · Score: 0

      Try out Perl-Mason

  5. Sounds exciting... by szlevente · · Score: 4, Interesting

    "A Rails web application can run under virtually any web server"
    Now that really made me curious. Is that really true, tried, and tested? If so, we need another bunch of tutorials about how to use Rails under Tomcat, Apache, etc. There is no way this framework will replace existing Java frameworks, but using it for prototyping is promising.

    1. Re:Sounds exciting... by zimba-tm · · Score: 3, Informative

      Some answers for those who are lazy

      == ROR runs and was tested under :
      Apache + CGI
      Apache + FCGI
      Apache + mod_ruby
      Lighttpd + FCGI
      WebRick (ruby server)

      OS : Linux / Window / OSX / *BSD

      == Real-life examples :
      www.basecamphq.com
      www.tadalist.com
      www.43thi ngs.com
      www.snowdevil.ca
      www.bellybutton.de

    2. Re:Sounds exciting... by Nik13 · · Score: 1

      In this case, I guess "virtually any webserver" means either apache, lighttpd or WebRick. I couldn't find anything IIS related (not that I spent hours looking either).

      DB wise, it supports MySQL, PostgreSQL, SQLite, MS SQL Server, IBM DB2 and Oracle.

      --
      ///<sig />
    3. Re:Sounds exciting... by Anonymous Coward · · Score: 0

      It supports FastCGI so pretty much any webserver that has support for FCGI should work. lighttpd is my personal favorite (much less bloated than Apache). IIS has a FastCGI ISAPI plugin so IIS should be fairly easy.

    4. Re:Sounds exciting... by rubycodez · · Score: 5, Informative

      No way this framework will replace existing java frameworks

      There is actually a chance it may become a mainstream way of building an enterprise framework. There is a very cool new bytecode Ruby virtual machine and just-in-time compiler (YARV), and the next generation of Ruby, Ruby 2, will support native OS threading. Unlike Java, the source for Ruby is and will be completely open & transparent. Ruby can run on platforms where java can't, like BeOS and MS-DOS.

    5. Re:Sounds exciting... by geniusj · · Score: 1

      Well.. BeOS and MS-DOS. That just seals Java's fate ;). Seriously though, I love Ruby.. The consistency it shows throughout the language is very refreshing. I can usually guess at syntax or method names if I don't already know them. We're on the same wavelength ;)

    6. Re:Sounds exciting... by Anonymous Coward · · Score: 0

      > There is no way this framework will replace
      > existing Java frameworks, but using it for
      > prototyping is promising.

      Serious question: Why? I see this kind of framework as more useful than Java frameworks for many many production tasks. However, this kind of framework is sort of my "home turf". I'd love to see your reasoning.

      Eivind.

    7. Re:Sounds exciting... by Anonymous Coward · · Score: 0

      Unlike Java, the source for Ruby is and will be completely open & transparent.

      What do you mean by that, other than something you've repeated from /.?

    8. Re:Sounds exciting... by drew · · Score: 3, Funny

      yeah, 'cause BeOS and MS-DOS are crucial platforms to support when you're developing an enterprise framework.

      --
      If I don't put anything here, will anyone recognize me anymore?
    9. Re:Sounds exciting... by rubycodez · · Score: 1

      it means in the past 7 years I've had to use java technology (from BEA, from Sun, from IBM, etc.) professionally for which the source wasn't available, and it's caused me headaches.

  6. Rails and other Rails tutorials by teidou · · Score: 5, Informative

    To explain Ruby on Rails, I could say it is a highly integrated model-view-controller type web application framework. That would be like saying a Ferrari is a 4 wheeled internal combustion vehicle: true, but misses the point.

    For more info, see RubyOnRails.com. An good alternative tutorial is at http://rails.homelinux.org/.

    There are even better introductory materials coming. Dave Thomas (of Pragmatic Programmers) is working on a Rails book, chapters are being reviewed presently.

    Rails is powerful an flexible. More importnatly, it's a lot of fun. If you are a programmer who want to enjoy web-based application development, please do take a look at Rails.

    1. Re:Rails and other Rails tutorials by pamri · · Score: 3, Informative

      Another great resource is the Ruby on rails weblog which has links to more tutorials, job postings about rails, updates, etc., There's also an updated video tutorial on building a weblog.

    2. Re:Rails and other Rails tutorials by snorklewacker · · Score: 1

      > To explain Ruby on Rails, I could say it is a highly integrated model-view-controller type web application framework.

      Rails is not really MVC -- The Controller part at any rate, the bane of every struts programmer, is entirely invisible in Rails. I suppose not having to deal with it yourself doesn't make it go away ... but really, nearly ANY application can be broken down into MVC parts or otherwise viewed through some MVC lens. The term was never all that meaningful (it only made sense when the controller was implementing low-level stuff like device drivers in smalltalk), but it's almost wholly meaningless for modern web apps.

      At any rate, you tend to define look and behavior in the same file in Rails, which makes it rather not MVC. It's there to make programmers productive, not create divisions between coders and web monkey designers. You could template if you wanted to, you just generally don't. It's rather a breath of fresh air, actually.

      --
      I am no longer wasting my time with slashdot
    3. Re:Rails and other Rails tutorials by Anonymous Coward · · Score: 0

      That would be like saying a Ferrari is a 4 wheeled internal combustion vehicle: true, but misses the point.

      I'm not sure you can really compare Ferraris with Ruby. Ferraris are blindingly fast and very short on comforts. Ruby is as slow as molasses, but extremely comfortable and fun to program in. It's more like a stretch limo than a sports car.

    4. Re:Rails and other Rails tutorials by Anonymous Coward · · Score: 0

      If I (a limited programmer in every sense of the work) was looking to learn something new, would you recommend that I start off just learning Ruby on its own, or start off with ruby on rails?

      Thanks,
      -dan

  7. One thing has changed... by WWWWolf · · Score: 4, Informative

    When the part one was published, I had severe problems getting Rails to work in Debian. There was a lot of really odd tools that needed to be installed and all that. Rails web page had tons of Ruby packages that I was pretty sure I didn't need...

    But one thing has changed since then: Rails is now in Debian unstable!

    1. Re:One thing has changed... by pamri · · Score: 2, Informative

      Actually, rails/any ruby library/app/whatever is quite easy to install if it is available on ruby gems and you have installed ruby gems. ruby gems is sort of like apt for ruby. Once you install gems, to install rails, all you have to do is, gem install rails and gem uninstall rails to uninstall rails. Although you are unlikely to need it. :-D

    2. Re:One thing has changed... by Tobias+Luetke · · Score: 4, Informative

      Please don't make this sound like an rails or ruby issue. Debian really blew it on packaging ruby. Most of the system related problems which come up in #rubyonrails are related to debian linux installations.

      How did they come up with the brilliant idea to split the standard library into 34 different packages? I just can't see how something moronic like this can even get started considering that a standard library is all about raising the status quo of the language by providing some shoulders to stand on so people can reach for higher goals.

      Keep in mind that ruby has no dependencies at all. All dependencies are optional and the libraries using them (tk,x11, readline) fail gracefully with exceptions when the parts are not installed. Not so if the entire library is missing, this will cause a runtime exception with cryptic error message which rails will never be able to handle. Also ruby is tiny the entire package is 3mb!

      I heard they are talking about improving the situation by adding a "virtual package" for ruby which contains all 34 seperate packages

      Future in Debian terminology is traditionally not soon and thats a fix feeble fix considering all they need to do is to put all 3mb of ruby in one package

      Anyways the point is fairly moot now since debian doesn't have ruby 1.8.2 anyways which is required for the latest rails

      Luckily its easy to install ruby by hand. And I heard gentoo and freebsd install pretty easily too...

    3. Re:One thing has changed... by cortana · · Score: 2, Informative

      $ cat /var/lib/apt/lists/ftp.uk.debian.org_debian_dists_ sarge_main_binary-i386_Packages | grep-dctrl -n --field=Package ruby --show=Size

      Summing the output, yeilds 31806976 bytes or 30 MB.

      $ aptitude show rails
      Package: rails ...
      Depends: ruby (> 1.8), ruby ( 0.10.7),
      libyaml-ruby (> 1.8.2), rdoc (> 1.8.2), libtest-unit-ruby (> 1.8.2),
      libdrb-ruby1.8, libsoap-ruby1.8, libxmlrpc-ruby (> 1.8)
      Recommends: libwebrick-ruby1.8, irb (> 1.8)
      Suggests: libapache-mod-ruby
      Description: MVC ruby based framework geared for web application development ...

      If you see a dependancy missing from that list, please file a bug.

    4. Re:One thing has changed... by Anonymous Coward · · Score: 0

      Whoops, replied to the wrong comment. And setting the format to plain text wouldn't have hurt, either...

    5. Re:One thing has changed... by agrippa_cash · · Score: 1

      http://www.2sheds.ru/blog/2005/02/installing-ruby- on-rails-on-debian.php has a good tutorial which shows an alternate server for a acouple debs and from which you can just copy and paste the horrensously long atp-get command. Sadly, I get a 'permission denied' error chenever I try to run 'rails foo'. So maybe the tutorial wasn't that great after all.

    6. Re:One thing has changed... by TheMysteriousFuture · · Score: 1

      Well how about, uhm, I dunno, fixing your permissions? either just sudo rails foo && chown -R me:me foo, or ensure you have permission to create a directory in the current directory.

      --
      .sig
    7. Re:One thing has changed... by agrippa_cash · · Score: 1

      It sounds just crazy enough to work. (Actually the permission denied error was the first of many showstoppers for me.)

    8. Re:One thing has changed... by TheMysteriousFuture · · Score: 1

      What are or were the others?

      --
      .sig
  8. Re:Any interesting projects? now with line breaks by mrmargolis · · Score: 0, Redundant

    Basecamp(http://www.basecamphq.com/): tens of thousands of users, designed by the creator of RoR
    43Things(http://www.43things.com/): thousands of users, now working with Amazon.com
    TadaList(http://tadalist.com/): an online todo list app with thousands of users
    Snowdevil(http://www.snowdevil.ca/): an online store that is powered by rails. It was deployed very rapidly using rails.

    If you can get through to the onlamp article there is a more complete listing of real world RoR applications at the end

  9. English language logic format by Anonymous Coward · · Score: 0


    In the world of computers, canonical always means real, and virtual always means fake.

    For instance, a canonical host name is the real name. A virtual host name is a fake name.

    So if somethings runs on virtually any web server, that means canonically it does not run on every web server.

  10. Really Getting Started in Rails by slipnslidemaster · · Score: 0


    "(24)Slash7 is written & produced by Amy Hoy. a self-proclaimed renaissance woman who enjoys designing, coding, and writing for herself and others (but mostly for herself). Her business is infocookie Interactive and she can perform all of the above services for you. In her spare time she enjoys cooking, mucking about in her darkroom, and writing about herself in the the third person."


    http://www.slash7.com/flashback/2005/01/oreilly_on lamp.html
    --


    "What the hell is an aluminum falcon?"
  11. ROR rocks! by Pfhreakaz0id · · Score: 5, Interesting

    As a guy who has written db-driven web apps in ASP, asp.net ( alittle), perl CGI, plain JSP/Servlet and j2ee app server with EJB's (both with and without a persistence framerwork/Object-relational bridge), I can tell you ROR is my favorite. I've only been using it for two weeks on a part-time project. It's ... beautiful. I can't think of any way to describe it. It. Just. Works.

    And ruby is a really nice scripting language. You should check it out.

    1. Re:ROR rocks! by pepicek · · Score: 3, Interesting

      The best way to describe ruby and rails for me it's that you are writting programs for you to understand them, not for computer. It's really changing the way you think when you are programing. You have time to focus on bussiness problem rather than computer's. Even if you have Mac OSX and really love it :-).

    2. Re:ROR rocks! by Anonymous Coward · · Score: 1, Interesting

      Hi, I'd like to learn some new stuff. I've decided that Ruby is my new project. I'm coming from the point-of-view that I haven't really programmed at all in a long time (not since I took some classes in school, other than programming some excel macros in vba). Any suggestions where I should start with Ruby. Initially I've been taking the random approach; I've got Ruby (and Tcl) installed, and I'm just looking at tutorials and adding text boxes, and stuff like that. Any suggested easy first projects that really help someone learn Ruby? I want to find a project that will be (a) easy at start, but can grow more challenging, and (b) that I will find useful (I figure that'll keep me focused)... Any suggestions?

      Thanks,
      -dan

    3. Re:ROR rocks! by Pfhreakaz0id · · Score: 1

      Dan: hmmm, I'd find an itch to scratch. You can start by install rails and go thru the "todo list" tutorial web site. That's what I did. Maybe that will fire some ideas. Want to write a blog? write your own little blog site. It would be pretty trivial to do in rails.... I dunno.

    4. Re:ROR rocks! by Anonymous Coward · · Score: 0

      Get back to us in 6 months when you've really done something substantial with it and give us a glowing review then.

      All too often the first two weeks with anything is an exciting time, but then you start getting to the meat of it and it then becomes RARE that it still holds up to the shine it has when you first look at it.

    5. Re:ROR rocks! by Anonymous Coward · · Score: 0

      You think my best bet is to begin with rails, or by starting from just learning ruby?

  12. http://www.bellybutton.de/ by Anonymous Coward · · Score: 0

    http://www.bellybutton.de/

  13. hmmm...maybe not by Anonymous Coward · · Score: 0, Troll

    While I'm not one to cast doubt needlessly on new, different ideas, I must admit that while the Ruby on Rails tutorial was spectacularly simple and fast, the fact is that when I decided to move from toy to trying to implement it, I encountered a number of problems.
    First, the database that I hooked this framework to was not empty originally. After hooking the framework to that db, the data disappeared...I should repeat that, my data disappeared without my explicit instruction to destroy the data!.
    Second, getting this running on linux was problematic because the tutorial was strictly for Windows and thus missed a few bits about linux (not really the author's fault since he admitted that linux takes more work).
    I should be honest and say that after I discovered that RoR was truncating my database every time I tried to use it (without notifying me of that fact), I ran away in horror. I now use Zope and won't go back to RoR.

    1. Re:hmmm...maybe not by Anonymous Coward · · Score: 0

      It does say to create a new database, no?

    2. Re:hmmm...maybe not by Anonymous Coward · · Score: 0

      Well that's a bunch of BS.

      Rails isn't doing to drop your entire database. ActiveRecord reflects over the existing structure to provide a convenient object interface to your database. It doesn't modify the database schema.

      In fact, I know of no place in the entire code that issues a DROP TABLE or the like. It's certainly possible to do smething like MyModelClassName.find_all.destroy, but that's to be expected. It's just doing what you tell it (similar to rm -r /).

      If you don't believe me, you're welcome to examine the source.

      I haven't read slashdot for a couple years now, and now I remember why. It's a sandpit of innaccurate claims.

    3. Re:hmmm...maybe not by Anonymous Coward · · Score: 0

      Wanna Bet? Have you actually attempted to invalidate my claim? No, you haven't, and hence you shouldn't assume I'm making this up.
      I *never* claimed that ActiveRecord ever dropped my database, I claimed that it truncated all my data. Before you say, "well, you probably told it to do that," then you should remember that I was following the tutorial almost word for word. Even if I'm too ignorant to understand what's going on behind the scenes in RoR, I don't think that the equivalent of rm -rf / should *ever* be automatically executed because of some other operation that I tried to perform. No, I *did not* "do something like MyModelClassName.find_all.destroy" and therefore, I *did not* expect that to just occur.
      Why don't you try it yourself and tell me what your results are?

    4. Re:hmmm...maybe not by Anonymous Coward · · Score: 0

      my data disappeared without my explicit instruction to destroy the data!.

      Ruby Rails blew my arm off! Clean off, no messy veins hanging out or anything. Completely gone like that. Should've known, there is no approved UL symbol on the box.

    5. Re:hmmm...maybe not by Anonymous Coward · · Score: 0

      so, now I'm a troll because I posted my experience with RoR?
      I *hate* when people defend a product simply because they plaster open source on the box. Be honest to yourself and be honest to everyone else. All products are bound to have shortcomings and I'm simply posting a shortcoming that I encountered.
      That doesn't make me a troll, it makes me honest.

  14. What rubbish. by Anonymous Coward · · Score: 0

    This line from the tutorial says it all

    "Hmmm. Now that's different. The MyTest part of the URL maps to the newly created controller. Now it seems that Rails tried to find an action named index in this controller but couldn't."

    I've tried using it and it's rubbish.

  15. Agile Web Development With Rails by Ridgelift · · Score: 4, Informative

    Dave Thomas' new book "Agile Web Development With Rails" is due out in July. It's really, really good so far (I'm one of the lucky ones who is helping review it). My perspective is a person who knows very little about databases, web application development and no previous knowledge of Ruby, the language that Rails is built on.

    One of the big problems with Ruby on Rails is that it is well documented, but a lot of it is API's and reference documentation. Dave's new book has an excellent tutorial which is the best thing I've seen written so far about RoR for newbies, and promises to go into the depth and detail similar to his Pickaxe book.

    If you've previously looked at RoR and were disillusioned because you just weren't "getting it " or didn't want to slug through the technical documentation, I encourage you to keep an open mind and wait until Dave's book is released. I'm finally getting over the hump with RoR and I now see what all the fervour is about.

    (Oh, don't ask me to post or send copies of his drafts, 'cause I ain't gonna!)

    1. Re:Agile Web Development With Rails by __Maad__ · · Score: 1

      One concern that I have about this is: How long has this book been in the works? Rails has gone through leaps and bounds and fairly huge changes( sometimes on a week-to-week basis) even in the few months I've been working with it. Will the book be up-to-date when it comes out?

      --
      -- Maciek
    2. Re:Agile Web Development With Rails by Ridgelift · · Score: 1

      One concern that I have about this is: How long has this book been in the works? Rails has gone through leaps and bounds and fairly huge changes( sometimes on a week-to-week basis) even in the few months I've been working with it. Will the book be up-to-date when it comes out?

      It's current up to 0.10, the latest version. David Heinemeier Hansson, the author of Rails, is also on the review team and seems to be good friends with Dave Thomas. So I think it's fair to say the book will be faily up to date, but like all technical books on new products it will date quickly.

    3. Re:Agile Web Development With Rails by Anonymous Coward · · Score: 0

      Am I the only one concerned that the reviewer for a book on web development using ruby admits he knows next to nothing about web development, databases, or ruby?

    4. Re:Agile Web Development With Rails by Ridgelift · · Score: 3, Informative

      Am I the only one concerned that the reviewer for a book on web development using ruby admits he knows next to nothing about web development, databases, or ruby?
      I'm one reviewer amongst 22. I would say all the rest of the reviewers are much further along than I am, including DHH who wrote Rails.

      Dave Thomas is looking to write a book that will help people learn Rails. My big contribution other than grammatical and spelling errors is "Hey Dave, I don't understand this section you say is easy".

      To me, it's smart to let the uninitiated in so he can see if he's reaching part of his target audience: the ignorant :-)

    5. Re:Agile Web Development With Rails by E_elven · · Score: 1

      Yeah, gee, wonder why a tutorial would need to be read by an uninitiated person to ensure it actually teaches something. What a sham.

      --
      Marxist evolution is just N generations away!
    6. Re:Agile Web Development With Rails by JamesOfTheDesert · · Score: 1
      If you've previously looked at RoR and were disillusioned because you just weren't "getting it " or didn't want to slug through the technical documentation, I encourage you to keep an open mind and wait until Dave's book is released.

      Ah; sounds like this is getting closer to Struts land: Great tool, but to really understand it you need to buy a book.

      Or no?

      --

      Java is the blue pill
      Choose the red pill
  16. Comparing RoR with Java solutions by MarkWatson · · Score: 4, Interesting

    I have worked through the RoR tutorial and re-implemented a simple admin web app that I originally wrote for a customer using JSPs and Tomcat. I must say that what took me 4 hours to write using JSPs and JDBC took about 30 minutes using RoR.

    A big advantage that Ruby and Python have over Java is that they are dynamic languages that makes it not too difficult to write a database wrapper class that dynamically looks at database/tables meta data and generates access methods on the fly. Java Tails (using XDoclet market tags) can't really compete.

    I really love the full J2EE stack for developing large scalable web applications but I am now looking at alternatives for creating smaller systems much more quickly.

    BTW, I really like RoR's templating scheme: much like JSPs in syntax (JSP non-XML syntax, that is) but do to Ruby's much terser notation for enumerating collections, the the templates tend to look a little cleaner.

    For Python, I really like the light weight CherryPy web application framework. I plan on checking out Python Subway also when I have some time.

    -Mark

    1. Re:Comparing RoR with Java solutions by dDrum · · Score: 4, Interesting

      There is a version of rails in java.
      It's called Trails and it uses spring, hibernate and tapestry.

      Site - http://trails.dev.java.net
      Tutorial - https://trails.dev.java.net/tutorial/"
      Trails in action - https://trails.dev.java.net/media/trails_withnarra tion.mov

      It's still beta but you can try it.

    2. Re:Comparing RoR with Java solutions by jimm · · Score: 2, Informative

      When you watch the "Trails in action" movie be aware that each time he does a redeploy, the ant task takes about 37 seconds. With Rails, it's about one second.

      --
      Transcript show: self sigs atRandom.
    3. Re:Comparing RoR with Java solutions by Paradox · · Score: 2, Interesting

      Compare the Trails video with any of the Rails videos. It's kind of sad really. The trails video does less than what the Rails video does, and it takes much longer, is more complex, and relies on an IDE. Bummer for Java.

      I'm not sure that Java can be used to replicate Rails. It might be possible, but it would probably mean abandoning a lot of existing infrastructure. Ruby does a lot of very clever/strange things, like dynamically adding methods to classes based off database schemas. The best we've seen Java do thus far is do this kind of thing statically via code generation and hints garnered from the source file comments.

      Trails is a neat idea and it does bring some great things to the table when it comes to Rapid Web Application Development, but it isn't fair (for Trails) to compare it to Rails... at least as of yet, anyways.

      --
      Slashdot. It's Not For Common Sense
    4. Re:Comparing RoR with Java solutions by Tobias+Luetke · · Score: 1

      Please note that the movie pauses for the recompilation which happens after every change to the views and lasts 47seconds.
      They also try to replace Rail's ActiveRecord with hibernate which actually generates the OR code before compiling and not during run time meaning recompilation for every database change.

      Just to put trails into perspective.

      Rails picks up all changes to files immediately as long as you are in the development environment.

      Trails is just flattering itself with comparing itself to rails.

    5. Re:Comparing RoR with Java solutions by Anonymous Coward · · Score: 0

      yes, but then Java is 8 times as fast as Ruby.

  17. Re:Ah, Ruby... by Anonymous Coward · · Score: 0

    Yes. Considering they're exactly the same language, with just one of them being more popular. Oh wait. They're not. Troll.

  18. Or for Perl... by stu42j · · Score: 1

    There is Catalyst

  19. Its worse than that. by Anonymous Coward · · Score: 0

    If you want to do any testing, rails expects you to have the ability to drop and create databases. And all the development is mysql based, so if you actually try to do anything non-trivial using another database, you end up with it spewing errors instead of working.

  20. Rails got me curious about Ruby by MSBob · · Score: 2, Interesting

    The Rails is such a great showcase of Ruby it really got me interested in the langauge itself. In particular looking at their Object Relational mapping tool it's very impressive how easy it is express your mappings with very little effort. Have a look at this example and compare it to a typical set of java classes with Hibernate tags. Then in case of Hibernate you have the extra build steps with Ant to generate the hbm files and so on. Don't get me wrong I like Hibernate and use it every day but Hibernate must operate within Java's syntactic limitations. With Ruby there is so much more flexibility that helps Rails achieve much more simplicity and expresiveness.

    --
    Your pizza just the way you ought to have it.
    1. Re:Rails got me curious about Ruby by Anonymous Coward · · Score: 0

      set of java classes with Hibernate tags. Then in case of Hibernate you have the extra build steps with Ant to generate the hbm files and so on.

      The hibernate tag issue is a one time event: you make them and that's it. You can even make Eclipse generate simple ones for you when you make the getters and setters for fields. Granted you'll have to edit them in the case of collections.

      As for ant you put that task of generating the hbm files in your general deployment task. Also you only have to do it when you change your business object definitions as they relate to the database.

    2. Re:Rails got me curious about Ruby by MSBob · · Score: 1

      And that's still much too much legwork for most developers' tastes. I have worked with Hibernate for the past two years and know the library and the supporting tools inside out... and I still cringe every time I have to create this complicated setup just to have my OR working.

      --
      Your pizza just the way you ought to have it.
  21. They don't have to be exactly the same. by Anonymous Coward · · Score: 0

    The point is ruby is just perl with a less logical, but easier to read syntax. There's nothing you can do in one that you can't do in the other.

  22. 34 different packages by metamatic · · Score: 2, Interesting

    Debian does the same thing to Perl, except there are substantially more than 34 packages. I'm not sure what the point is, as Perl has its own package management via the CPAN module. I wish Debian would let Perl do its own package management, like Gentoo does.

    The entire Ruby system isn't 3MB, either, if you're calling those 34 packages the system. The log4r package alone is 1.1MB, libqt-ruby is another 1.3MB, and libxmlparser-ruby is 0.8MB.

    And Debian does have Ruby 1.8.2, I run Debian unstable and I've been using 1.8.2 for a while now.

    --
    GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    1. Re:34 different packages by cpeterso · · Score: 1


      And Debian does have Ruby 1.8.2, I run Debian unstable and I've been using 1.8.2 for a while now.

      Try telling that to my web host. They (sanely) use Debian Stable on their servers. Debian Stable only includes Ruby 1.6.7. Why should they use Debian Unstable on production servers?

    2. Re:34 different packages by metamatic · · Score: 1

      So that they can offer a more competitive selection of web applications, and attract more customers. Duh.

      Of course, they may not realize that. Similarly, it seems to be tough to find a web host that offers ordinary people J2EE...

      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    3. Re:34 different packages by MostlyHarmless · · Score: 1

      With Perl, at least, there's a good reason: Perl is required by the base system, and it is important to keep the base small. IIRC, the way they do it with Perl now is the way the parent was saying would happen soon (erm, eventually :-p) with Ruby: there is a minimal package for the base system, but if you install the package called "perl", it will install much more.

      --
      Friends don't let friends misuse the subjunctive.
  23. Personal Testimonial by orion024 · · Score: 1

    A few years back I created a dynamic MySQL backed website in PHP. When I first started learning Ruby, I converted this site to Ruby (ala eRuby and mod_ruby). I easily cut my code in half, *plus* it became a whole lot easier to read (and I was a ruby-newbie!). I am now migrating the site to use Rails, which, from what I can tell so far, is cutting that code down in half *again*.

    If Rails had been around when I first started the site, I would have saved hours upon hours of development time. Rails is an amazing framework. It's cut down my development time, and my code is easy to read. It's made web-development *fun* again.

    Their most recent release (0.10) provided support for writing (and using!) web services. I've already written one and put it into production with a VisualStudio C# app. Great stuff.

    1. Re:Personal Testimonial by Anonymous Coward · · Score: 0

      You cut it in half and then half again? That doesn't give me much encouragement with YOUR coding skills.

  24. This is an amazing technology by badboy_tw2002 · · Score: 2, Informative

    I don't normally write cheerleading testimonials, but its also rare I find something this cool that I want to gush about it.

    The first tutorial (I saw it right here on Slashdot!) got me curious about RoR. I went home and installed it that night. A couple weeks later (total of maybe 10 hours invested) I had completely converted my community website over to rails (from a servlets site), and am launching it fairly soon. The funny thing is, the actual code to drive this thing is really small. No boring, repetative database code, automatic validation, lots of helpful classes (authentication is downloading a new package and running a make script). Things in the tutorial make it look like you're limited to standard naming conventions, but I assure you that you can override everything if you've got an existing database that doesn't match the RoR naming scheme.

    I've found the community very helpful. Hosting is a bit limited now, but I'm getting a textdrive.com account soon to get my new site up and running.

    This is definately worth an install and the 20 minutes it takes to do the tutorial, check it out!

    1. Re:This is an amazing technology by ErikZ · · Score: 1

      I've been curious about Ruby, and I'm probably going to try using RoR to fix up my PHP/MySQL site. So I've got a quick question:

      How much did you know about OO before you started? I've never had to touch it before.

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
  25. I've tried RoR by Anonymous Coward · · Score: 0

    And there were two main problems:

    1. It didn't install without a lot of effort (it took me 3 weeks on and off to get it working)
    2. After all that, It deleted all my data without telling me.

    This may sound funny at frist, but I accidently set it up on a production system, so it turned out not to be so funny.

    As a result I've gone back to the technologies used in the advertisment embedded in this story (Microsoft Visual studio.net) . Like the ad says: "Create high performance web applications, and watch your throughput go through the roof". Never a truer word spoken. And I doubt it'll wipe my production system clean of all it's data any time soon.

    The irony.

  26. Mod Parent +1 Sarcastic by MAdMaxOr · · Score: 1

    Um...yeah

  27. Ruby? by mikehunt · · Score: 1

    Anyone who wants to post reasons for why I need to learn yet another language?

    Like why I need to learn another set of editor commands...?

    Mike.

    1. Re:Ruby? by Paradox · · Score: 1

      Because if you don't learn Ruby, you can't use Rails. Rails is so compelling, you'll learn Ruby just to use it. Then you'll realize how incredibly cool Ruby is as a language, and how incredibly productive it is at the same time. And in the long run, you'll be better off for it.

      Yes, Ruby is that good. Rails is a very nice framework, and it does things that you couldn't do easily in other languages (and that includes Python).

      As for editor commands, didn't you know only Emacs users get into heaven? ;)

      --
      Slashdot. It's Not For Common Sense
    2. Re:Ruby? by mikehunt · · Score: 1

      Oh shit...I'm I vi user. On all platforms. Like I say, life is much too short for yet another editor!

      Ruby seems interesting, maybe once I've swallowed VB and Java, I'll get around to it.

      Mike.

    3. Re:Ruby? by Paradox · · Score: 1
      Ruby seems interesting, maybe once I've swallowed VB and Java, I'll get around to it.


      It might be best not to learn Ruby first. If you were to learn it first, learning Java afterwords would be incredibly painful. Nothing makes you realize how bad Java is like learning Ruby.

      VB isn't so bad, I guess, but I'd rather use Ruby and the FX toolkit for those kinds of simple script apps. But Ruby does have an amazign set of winapi bindings as part of the standard library. You might want to elevate it above VB.
      --
      Slashdot. It's Not For Common Sense
    4. Re:Ruby? by mikehunt · · Score: 1

      Hmm. I've done DOS and much earlier operating systems. Quit the PC world once Windows came along. Got into big UNIX systems.

      It's interesting to watch how languages progress. I cut my teeth on BASIC at 13, progressed to assembler and ended up doing that for a job. I've programmed many different architectures over the years, including some that most people do not see. My only conclusion from my assembler days is that there are lots of different achitectures and instruction sets. Most processors are equally easy to program.

      There again, I've also written huge transaction processing systems in C. Loads of crap in shell script. Now I can think C in my head.

      Nobody has managed to convince me about 'object oriented' vs 'functional' programming. I've seen just as much shit code in every language.

      Languages, methodologies, 'extreme programming'.

      Just get the job done!

      Mike.

    5. Re:Ruby? by Paradox · · Score: 1
      Nobody has managed to convince me about 'object oriented' vs 'functional' programming. I've seen just as much shit code in every language.
      One thing about Ruby, is that it is very pragmatic concering its feature set. It has very functional features but is still very OO.
      Just get the job done!
      Seriously man, you'd love Ruby. It's probably one of the most pragmatic languages I've ever used, and I've used most of them.
      --
      Slashdot. It's Not For Common Sense
    6. Re:Ruby? by mikehunt · · Score: 1

      Well, like I say, I'm more a functional fan. There again, I'm off on a 4 day Java course next week, so maybe it will spark my interest for OO languages.

      Java's basic design is great, I've looked through it many times. What I have not seen is really cool stuff in Java that did not need a long, intimate association with the language.

      But if Java fires me up, Ruby here I come!

      Mike.

    7. Re:Ruby? by Anonymous Coward · · Score: 0

      You'll love Ruby.

      Java is great and all, but the syntax mades it harder to just get the job done.

      How many lines of Java code does it take to accomplish this single line of Ruby code...
      [1,2,3].each { |elem| puts elem }

      Anyway, the more languages you try the better.

    8. Re:Ruby? by arkanes · · Score: 1

      If you love functional programming, you will hate Java and love Ruby. On the other hand, if you love functional programming but have been doing it in C, you may already be beyond help ;).

    9. Re:Ruby? by Anonymous Coward · · Score: 0

      If you say "pragmatic" one more time I am gonna hurl!

    10. Re:Ruby? by Anonymous Coward · · Score: 0

      Nobody has managed to convince me about 'object oriented' vs 'functional' programming. I've seen just as much shit code in every language.

      As a coleague rightly said,"What we are doing is not 'object' or 'functional' programming, it's 'ERROR oriented' programming, that's it!"

  28. Easy to install on a host that doesn't have it by inventric · · Score: 1

    My webhost (http://www.inventric.com/nicewebhost) didn't have it out of the box either. And many people think if their webhost doesn't have it they are out of luck.

    I wrote a tutorial on getting Rails installed without having root access. The tutorial has some specific stuff for my webhost, but it might give you some ideas on getting it installed for yourself.

    The tutorial is at: http://www.inventric.com/blog/2005/01/ruby-on-rail s.html

  29. Frameworks closely tied to languages, WHY by Tablizer · · Score: 2, Insightful

    Anyone who wants to post reasons for why I need to learn yet another language?

    Indeed. Why can't somebody make a fairly language-neutral framework? Why are all the UI frameworks so tightly bound to specific languages and why do people accept that?

    Things like data/field dictionaries, screen descriptions, UI widget attributes, and event handling frameworks don't need to be closely tied to specific languages because they are mostly declarative in nature, so why are they in practice?

    It just does not seem very efficient to reinvent the wheel for each and every language. There about 100 languages in popular use. If we reinvent a web/ui/gui framework for each and every one, then we have spent 100 times the effort than need be. (Well, adaptors and sharing for similar langs may make it more like 50.) It would seem wiser to make one standard and do that one really well instead of do it 50 times poorly for each lang. We managed to divorce database usage from being language-specific. Time for UI also.

    1. Re:Frameworks closely tied to languages, WHY by mikehunt · · Score: 1

      I'd rather like to reverse your analogy:

      It is not a good idea to reinvent a language for each new wheel.

      I guess it's only old farts like me that remember when the functionality was the issue instead of the language that you should implement the functionality with.

      Mike.

    2. Re:Frameworks closely tied to languages, WHY by swimmar132 · · Score: 1

      There are certain features in Ruby that make it exceptionally easy to implement something like Rails. Reflection, blocks, etc.

    3. Re:Frameworks closely tied to languages, WHY by Tablizer · · Score: 1

      There are certain features in Ruby that make it exceptionally easy to implement something like Rails. Reflection, blocks, etc.

      It appears to me that they often just don't like SQL, reinventing joins etc., not necessarily that it is objectively better than direct SQL. (I think SQL has flaws too, but still not worth reinventing collection-oriented idioms to escape them.)

      If have had long debates with FP proponents who suggest that closures and HOF greatly simplify code, but have yet to see direct evidence in my domain other than some who don't know how to use non-FP tools well.

      How about we not get into another language war today.

    4. Re:Frameworks closely tied to languages, WHY by matvei · · Score: 1
      We managed to divorce database usage from being language-specific. Time for UI also.

      That should be "Time for web application development also". You can write GUI apps with almost any popular language (c++, python, perl, ruby) using any of the popular widget sets (wxwidgets, gtk+, qt). For example, take a look at the impressive list of GTK+'s language bindings.

      Sure you can't mix and match bits and pieces written in different languages very easily, but it's possible. And it most certainly is not like you need to reinvent the GUI library for every language.

      I too wish we could say the same about developing web applications.. Just thinking about coding anything more complex than an online recipe database in PHP makes me shudder :-P

    5. Re:Frameworks closely tied to languages, WHY by Tablizer · · Score: 1

      I agree. The pre-web client/server tools made UI's a lot easier and flexible than HTML+JS+DOM. It is as if we took a step backward. I have been kicking around HTTP-friendly GUI approaches, and the hard part is defining what the server and what the client takes care of.

    6. Re:Frameworks closely tied to languages, WHY by arkanes · · Score: 1
      Hi top!

      In brief order: All widely used UI frameworks with the exception of the Windows API support declarative mechanisms, Windows to do so in the still-vaporware longhorn, all of them including Windows have bindings in enormous varieties of languages.

      We never divorced database usage from being language-specific - it's done exactly the same way GUI is, with language-specific wrappers, often over other generic wrappers. There's a common query language which is sadly not all that common after all.

      The "best" way to write web applications is still up in the air and being explored, Rails is one of those explorations.

  30. well.. by Run4yourlives · · Score: 1

    You could make the same comparision between perl and assembler if you wanted to.

    Point being your point is not very strong.

  31. Caveat by Paradox · · Score: 1
    Yeah, it does run under most basic webservers. Not too long ago, Rails needed apache's mod_rewrite to get the pretty URLs. But the addition of Rails Routes fixed that mostly.

    Your web server can run Rails if it does the following:

    1. Can invoke CGI somehow (duh)
    2. Can forward URLs like http://somesite/somename/blah/blah/blah to http://somesite/somename/dispatch.cgi?/blah/blah/b lah
    This is an awful lot of them, and Ruby runs on just about every platform used for web serving, so yeah. Rails could work most anywhere.

    If you can't do the URL forwarding, Rails still works. The URLS are just ugly as sin and you lose some nice URL autogeneration features in the API.

    --
    Slashdot. It's Not For Common Sense
  32. Shortcomings of Rails by sean23007 · · Score: 3, Insightful

    I considered using Ruby on Rails for a large project I was doing, and found that though it was extremely easy to get started and do simple applications, it fails on more complicated databases. It does everything for you automatically, and you can easily write functions in Ruby that do the work of the database, but this is best only when the database isn't doing a whole lot itself except for holding data.

    My database is in PostgreSQL, and uses a lot of dynamically named tables and schemas, as well as many trigger functions written in pl/pgsql. In order to get RoR to work, I found that I was going to have to edit the framework itself extensively, and would still be hampered by the slowness of Rails, which I found to be unforgivable.

    I ended up having to design my own framework in Python, which can handle the most complicated databases without any more trouble than the simplest. The construction of the pages now takes a little more time than it did in Rails, but pages that used to take over a second to load are now instantaneous.

    That said, I translated a small web app from Rails to my own framework, and the translation took less time than it did to write it in Rails in the first place and ran a lot faster, but that's because the design was done in Rails. I'd say that Rails is really good for prototyping small applications and getting them working really quickly, and then translating them to another framework for production becomes quite simple.

    For non-trivial web applications, Rails has the problem of being optimized for ease of use, not for complete control. Note that I'm not trolling, or saying Rails has no use. Just that I found that it wasn't sufficiently capable for what I was trying to do with it.

    --

    Lack of eloquence does not denote lack of intelligence, though they often coincide.
    1. Re:Shortcomings of Rails by swimmar132 · · Score: 2, Interesting

      The part of Rails that deals with the database and does the ORM is called ActiveRecord. You don't have to use AR with the other components of Rails.

      Also, AR has gone through some extensive changes in the last release, it may better suit your purposes now.

      Keep in mind that it's still a fairly new framework. It will only get better!

    2. Re:Shortcomings of Rails by sean23007 · · Score: 2, Informative

      I don't mean to say that Rails has no uses. It definitely seemed to be wonderful for a certain subset of applications. However, the amount of work it would have taken to rewrite ActiveRecord such that it would be compatible with my database was roughly equivalent to the amount of work it would take to completely implement my own solution. I simply decided to do the latter. Perhaps I should have written an AR replacement that would have been enough for my database, because that certainly would have advanced Rails greatly. If someone else does that, my biggest complaint about Rails simply disappears.

      Bear in mind, however, that it feels really good to implement an entire framework yourself. While developing my application, I feel like DHH must have while he was writing Basecamp. It's a great feeling.

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
    3. Re:Shortcomings of Rails by bunco · · Score: 1

      May I ask what packages you used for your python framework? I've been toying w/ CherryPy for awhile now. Me likes.

    4. Re:Shortcomings of Rails by sean23007 · · Score: 1

      I haven't looked at CherryPy at all, really, and the only packages I'm using but didn't write are cgi (comes with Python) and psycopg (for interaction with PGSQL). I wrote my own db class which creates objects that map to a table, with a dict variable where the keys are field names in the table and the values are the values of the corresponding field. I've written classes for each high level type of data, and am in the process of finalizing my sessions class. I doubt I'll be able to open the code, for business reasons, which is unfortunate. I'll be selling the entire codebase to a company which will in turn sell services based on the accompanying application (which the framework is designed from the ground up to serve perfectly).

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
    5. Re:Shortcomings of Rails by pico303 · · Score: 1

      "dynamically named tables and schemas!?!"

      You have got to be kidding me...you're naming database tables and schemas on the fly, from your application?

      My DBA just threw up.

    6. Re:Shortcomings of Rails by sean23007 · · Score: 2, Interesting

      Yes, most of the data in the database is held in tables that are dynamically created based on the data entered into the database. This kind of architecture was basically required for the size and speed requirements we were under during the design phase. And before you demonstrate your lack of knowledge on the subject, not only is the database design rated Type 3 Normal, it's been lauded by many people responsible for the design and implementation of the largest databases used in hospitals and other mission-critical fields across the country.

      Your DBA just realized he should read the Postgres manual a few more times.

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
    7. Re:Shortcomings of Rails by arkanes · · Score: 2, Interesting
      I'm going to sound like someone I know and really dislike here, but...

      If you're regularly dynamically creating and nameing tables, that sounds like you're abusing SQL to create trees and other arbitrarily nested hierarchies. Assuming Oracle and it's tree extensions isn't an option, maybe you should reconsider using an RDBMS for a tree-based back end? Or maybe you're doing something totally different, in which case just ignore me.

    8. Re:Shortcomings of Rails by sean23007 · · Score: 2, Interesting

      Basically Oracle isn't an option because we're trying to maximize cost-effectiveness, and thus are sticking with free, open source solutions. We chose Postgresql as the backend, and in a production setting it is competitive with Oracle, in features, stability, and speed. We used pl/pgsql to create the functions and triggers which create the tables. pl/pgsql is a clone of an Oracle language, and can basically be used in Oracle databases to achieve the same functionality.

      The design of the database drew high praise from the inhabitants of the Postgres listhost, and it was their advice that led me to the decision to write my own framework to handle it. The information we got from them says that only the most advanced databases out there are using these techniques this extensively (yet), and most frontends that they've heard of can't handle it.

      Performance-wise, the thing absolutely flies.

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
    9. Re:Shortcomings of Rails by pico303 · · Score: 1

      I've read the PostgreSQL manual, and I don't remember them every encouraging me to create tables in the manner in which you suggest.

      I'm no DBA, so I've never heard of a "Type 3 Normal" design. Neither has Google, so if you could point me at a reference online, I'd be interested in checking it out. Granted, I have no details on what your project goals are, or who your target customer is. Most importantly, I have no idea what the size of your database is or the user load on the application.

      That said, given that your choices were between Ruby and Python, I can't imagine that it's a massively scaled application, with database replication, server session replication, graceful failover, etc., etc. If you're willing to put your money where your mouth is, maybe you'll let us all know (a) your application, and (b) what person or persons "responsible for the design and implementation of the largest databases used in hospitals and other mission-critical fields across the country" like this design? I'd ask them if they'd ever take their huge Oracle databases and perform dynamic table or schema generation on the fly.

      Whenever anyone has come to me wanting to dynamically generate tables and schema, it's typically either been bad design, or trying to apply non-relational data storage requirements to a relational database. Everybody knows you're supposed to save all your data in a relational database, right? Doesn't matter what the format... I fight this battle with management all the time. Everybody and their brother has heard of Oracle, but sometimes just a plain text file does the job nicely.

      As an aside, I'm curious how you would generate reporting against your database? I'm guessing you just do a general search against user-supplied fields or something. How ever would you optimize those queries against indexes? Either they are very small tables, or your code must be doing most of the work a standard RDBMS would be doing, calculating possible SELECTs and generating indexes on the fly by interpolating user intent. Again, not knowing the details of your application, this is just a guess. Would definitely pose an interesting problem.

      Now, having said all this, if you're just generating tables based on a well-defined set of configuration information entered by the user at installation time, well, that's a different story. I could see how that would be a problem for Rails without being bad database design.

      My DBA is an Oracle DBA. Unless you've managed to cluster several hundred PostgreSQL servers, I'd say my DBA can beat up your DBA.

    10. Re:Shortcomings of Rails by ErikZ · · Score: 2, Interesting

      Considering how many eyebrows you're raising, maybe it would be a good idea to write up an article on it?

      Unless you enjoy having to explain yourself over and over. :)

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
    11. Re:Shortcomings of Rails by TheMysteriousFuture · · Score: 1

      As the sibling post mentioned, I'd love to see an article on what you've done. Maybe you could even get O'Reilly's onlamp site to publish it. Or just throw it up somewhere :).

      --
      .sig
    12. Re:Shortcomings of Rails by mabinogi · · Score: 1

      try looking for "Third Normal Form" or database normalisation instead, though that in itself has little to do with the dynamic table creation situation.

      There are some types of applications in which you cannot know at the time of writing the application what data is needed to be stored beyond a few common fields - say you're creating an inventory system and you need to be able to have it expand to contain information about new products and can't know in advance what special information you might need beyound the common stuff for those products.

      In that case you've got three options -
      1. create a table with the common fields and a fixed number of extra fields - extrainfo1, extrainfo2, extrainfo3...extrainfon
      2. use a generic database format where you create one table with the common fields and another that effective contains name value pairs and a foreign key reference back to the main table
      3. Create a separate table for each product type on the fly when the product is initialiy defined in your system, and use a product type to table name / definition mapping to locate which table to use.

      Each of those approaches is perfectly valid for certain jobs and each has its own set of advantages and disadvantages.

      1 allows you to avoid dynamic SQL and the complexity of extra joins but is the most limited in flexibility - you're stuck with the data definition you used at the time of writing and if a product type has more extra information than you allowed for or information of differing types or lengths then you're out of luck.

      2 is more flexible as it allows any number of extra fields for a product but it adds complexity to your queries (although that can be aleviated with a view - but if you know enough about your data to create a view then you know enough not to require this approach in the first place) it is also harder to enforce data integrity and still suffers from the problem of differing data types and lengths. There are also potential performance problems due to causing the creation of a table with a potentially huge number of records (number of products * average number of extra information records) However, I'm not sure how much of a difference that makes in practice. Effective indexing is also more troublesome, as you either have to index everything or nothing.

      3 is more complicated than 1 but simpler to write queries against than 2. It requires dynamic SQL but allows the enforcement of data integrity constraints, it allows you to use the appropriate data type for each field rather than storing everything as a varchar and lets you choose the right lengths and precisions for text and numeric fields. You also have the flexibility to choose how you index the table on a per field basis - exactly as if you'd hard coded the definition in advance.

      Of the three of them I think that 2 would be the most likely to make a DBA throw up.

      --
      Advanced users are users too!
    13. Re:Shortcomings of Rails by Anonymous Coward · · Score: 0

      I ended up having to design my own framework in Python, which can handle the most complicated databases without any more trouble than the simplest.

      Why don't design your own framework in Ruby?
      There's something special in the Python language that facilates your work (dinamically mapping classes to a DB/SQL layer)?

    14. Re:Shortcomings of Rails by sean23007 · · Score: 1

      A simple question! Pressed for time at the moment, I'll answer this one. I wrote my framework in Python because I'm much more fluent in Python than in Ruby. If I were as good with Ruby as I am with Python, I might have updated ActiveRecord to work with my database, or considered some other Ruby-based solution. As it is, Python is my language of choice.

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
  33. Rails has a very clear MVC separation. by Paradox · · Score: 1
    At any rate, you tend to define look and behavior in the same file in Rails,
    Excuse me? Uhh, the look is defined by the templates, and the controllers just do the setup and actions. Rails has a very clear separation of view and controller.

    You define look in the templates and behavior in the controller. Sometimes, the behavior is just loading a group of database items into a class variable for display. Sometimes, it's more complex, involving things like redirection and database manipulation.

    But you'd be hard pressed to say the separation isn't there at all.

    --
    Slashdot. It's Not For Common Sense
  34. Perl on Rails by Anonymous Coward · · Score: 0

    The Perl version is called Catalyst.
    They have a very nice Introduction too.

  35. MOD PARENT UP! by badboy_tw2002 · · Score: 1

    Wow, really cool stuff! I think I'm going to try that tonight, I might not have to switch web hosts after all! MOD PARENT UP!

  36. Re:If you think ruby is special, you are mistaken. by Anonymous Coward · · Score: 0

    Blow it out your ass, Java wanker. Sun blew it.

  37. What I really want... by fm6 · · Score: 1
    ... is a version of the tutorial that's not on PDF. Since the tutorial was authored on OpenOffice, it would have been just as easy to provide a web version.

    And how about a good tutorial on Ruby itself? Most of us have no idea what this language is about.

  38. Stored procedures? by Anonymous Coward · · Score: 0

    RoR stuff I've seen is CRUD straight out of the tables. I generally use stored procedures...does RoR still buy you a lot if you work that way? (eg., suppose I wanted to re-implement Slashdot...the CRUD paradigm probably ain't sufficient)

    1. Re:Stored procedures? by Pfhreakaz0id · · Score: 1

      stored procedures... um, I know you can implement custom "sql finders" for a class. I don't see why that couldn't work, but you'd lose a lot of the great stuff that way.

  39. The other side of the story by Anonymous Coward · · Score: 0

    Clearly some people like ruby and rails, and that's super for them. But to act as though it is universally the greatest thing ever is naive. I have tried rails. I was very excited about it. I was even willing to suffer with the hideous syntax of ruby because rails seemed so good.

    Then I tried to do actual work in it. And I realized it seems great when you play around, but when it really comes down to it, its not very helpful. I was more productive in java than I am in rails, and rails wasn't even able to work with oracle properly. Add the wrong column type to a table, rails blows up and spews errors. Report the bug, and get ignored because nobody cares about oracle, this is mysql-land.

    Although I hate java, I am still stuck using it because rails is simply broken, and nobody cares enough to fix it. The devlopers attitudes towards security ("its not our problem" and "we're not going to inconvenience people just for security") is even more reason to avoid rails. And of course, ruby is slow as hell, has issues with its fake threading implimentation blocking the entire process and requiring a restart of the app, and for those of us who like the clean, logical syntax of C style languages, its a horror to read.

  40. What ruby is about. by Anonymous Coward · · Score: 0

    Its about taking a nice language like smalltalk, and then ruining it with hidious perlisms so nobody in their right mind would want to use it. Apparently its also about using pretend threads instead of OS threads, so you can trade the performace, stability and scalability of OS threading, for the ability to run your pseudo threads on DOS. No, I am not making that up, I wish I was.

  41. Are you mentally and emotionally stable? by Anonymous Coward · · Score: 0

    I am going to guess not, and you might want to see someone about your condition. I don't know why so many rails advocates think that hatred of java, without even understanding it, will somehow help rails. It won't, you can stop.

    If you take the time to read again, you will notice I didn't say anything about java, I did mention that perl is nicer than ruby though. I didn't mention java because I don't use it. I did mention perl because I do use it. Odd isn't it?

    And yes, Sun did blow it. Java is completely useless to me, so it doesn't even get to rate against other languages, it simply doesn't exist. Unless I can easily use a language on whatever platform I want, without EULAs and patching and several hours of bullshit, then I am not using it. Its especially stupid since java never had any reason to be so closed and platform dependant.

  42. No, you can't make that comparison at all. by Anonymous Coward · · Score: 0

    Perl and assembler are not similar in any substantial way. Perl and ruby are very similar, if you know one you can easily pick up the other. Perl and assembler have very little in common, and knowing one will do very little to help you use the other.

    My point is just fine, however you are mildly retarded.

    1. Re:No, you can't make that comparison at all. by Run4yourlives · · Score: 1

      Before you want to call me retarded, have the guts to put your name behind your words, otherwise shut-up.

      Perl and ruby are very similar, if you know one you can easily pick up the other.

      No, they're actually not similar at all, and if you were familiar with ruby you would have a bit of a clue regarding this. It's closer to smalltalk than Perl, really.

    2. Re:No, you can't make that comparison at all. by Anonymous Coward · · Score: 0

      My name is Dan. If you don't want to be called retarded, then don't act retarded. If you were familiar with ruby and perl you would know that ruby the hideous love child of perl and smalltalk. Perl has fuckall to do with assembler. See how my comparison makes sense, and yours doesn't?

      The point is, ruby having a syntax that you like doesn't mean ruby is better than everything else. You can still do everything ruby does in perl, and some of us find it slightly less hideous.

    3. Re:No, you can't make that comparison at all. by Run4yourlives · · Score: 0, Flamebait

      Go back under the bridge Dan, feeding time is over.

  43. I'm not the original poster, but... by Anonymous Coward · · Score: 0

    OK, I built a new ruby on rails app againt an existing MySql database and didn't see any truncation. *shrug*

  44. 'Rails'? by Ed+Avis · · Score: 1

    Ruby on Rails - is this somehow related to The Little Engine That Could?

    --
    -- Ed Avis ed@membled.com
  45. Rails outside of Ruby? How about Aesthetics... by DoctoRoR · · Score: 1

    The way you answer reflects a rigid top-down mindset. After reading some of Paul Graham's essays, I began to question that way of thinking and asked myself if Rails could be built easily outside of Ruby, or alternatively, whether the types of problems that Rails addresses are more efficiently handled by your top-down list of components. Rails is more than a UI framework; it's being grown from the language up towards web app solutions. If you read some of Graham's essays in the light of Ruby on Rails, you might reconsider.

    Graham suggests new languages may be trending towards LISP, perhaps because LISP was initially a theoretical exercise by McCarthy, a gedankenexperiment not really designed to be shoehorned into 1958 computational constraints, but rather discovered "when you try to axiomatize computation." (See Graham's full postscript paper The Roots of Lisp .) FORTRAN and C, on the other hand, took a lot of cues from the hardware; they had to be fast. Over time, the lower-level languages have been relegated to handle algorithmically-simple, computationally-needy problems, while the scripting languages - PERL, PHP, Python, Ruby - have been getting fast and moving from simple glue to more complex processing tasks.

    Two decades have passed since I looked at LISP code, and I'm wondering if I like Ruby because it's as powerful as that language in my distant memory, yet more aesthetically pleasing syntax-wise since I'd been coding in C, C++, and PHP. It's refreshing to be using a true object-oriented (message-based) language that has strong (as in "walks like a duck") typing, closures, and seemingly dynamic everything (types, open classes). Although I'm relatively new to Ruby and Rails, I can see this is a language I'm going to enjoy using and figuring out.

    Graham talks about bottom-up design , changing the language to suit the problem. It suggests one reason why Rails looks so good compared to other web frameworks: Rails looks like souped-up Ruby and not just a bunch of classes, procedure calls, and bolted-on code.

    "In Lisp, you don't just write your program down toward the language, you also build the language up toward your program," Graham wrote. "Language and program evolve together... In the end your program will look as if the language had been designed for it. And when language and program fit one another well, you end up with code which is clear, small, and efficient." That's a pretty good description from 1993 on Rails development and points to a not-so-subtle difference between the web frameworks.

    Just as standard Ruby lets you use "attr_writer :some_attribute", Rails provides a formalism for defining data relationships like "has_many :data_thing". The Ruby Way seems to run deep. It'll be interesting to see if Rails manages to adhere to that philosophy as it expands.

    When answering the question "Could Rails be built without Ruby?", I think you have to address not only the functionality but the aesthetics as well. It's more than the simple lines-of-code metric. It's whether you've built a language up towards a Rails language that solves problems common in web development. As Graham points out, you could build Rails out of any language that's Turing-equivalent; the real question is in your quest to duplicate the aesthetics, whether you'd wind up doing a back-door implementation of a Ruby interpreter in the process. For Python users, the port might not be incredibly difficult. For C users, it might be easier to build a Ruby interpreter.

    One of the knocks against Zope 2, a leading Python app and backend server framework, was how un-Pythonic the framework appeared to some developers