Ruby on Rails - What's holding it back?

Story: Installing Ruby on Rails in LinuxTotal Replies: 35
Author Content
penguinist

Dec 05, 2008
6:29 PM EDT
First, let me say that I've been using Ruby and Rails for several years now. Of all the languages I know and use, I consider Ruby to be the most elegant. The language is really a joy to work with. Rails is a well structured web framework, and can be used to create small or large web sites quickly and easily. So far, I've used the Rails framework to deploy three web sites, and have used it to implement an internal office management system for a small business (all deployed on Linux platforms, of course).

So, why is Ruby/Rails not more popular with the Linux community?

The answer in a few words: Lack of good Apache support.

Most other popular web scripting languages are nicely supported with native Apache modules that work efficiently out of the box (e.g. - mod_php). It is true that Ruby/Rails provides the easy to use Mongrel as a convenient development environment, but when you get ready to deploy a highly trafficked web app, you need some power. Ruby/Rails users are forced to use various workarounds like fastcgi in order to deploy on Apache, or move away from Apache. A mod_ruby project was started a while back, but unsolved problems with it prevent its use in production environments.

Sander_Marechal

Dec 05, 2008
6:40 PM EDT
Aside from that, there are other problems as well.

- Many more people know PHP or Perl than know Ruby. It's not easy to pick up a new language. Especially if you make a living from your work.

- Ruby on Rails is a great development framework, but it's only good for a certain kind of applications. MVC/ActiveRecord type applications. It's not really good for a simple website that's mostly just flat HTML.
azerthoth

Dec 05, 2008
8:36 PM EDT
In other words, in an ocean of mediocrity it's just one more shipping container on the cargo ship full of 'solutions'.
tracyanne

Dec 05, 2008
9:49 PM EDT
I haven't managed to get Ruby on Rails to actually work.
dinotrac

Dec 05, 2008
11:11 PM EDT
Hmmmm.

Sounds like I'm the only here who likes Ruby on Rails. Truth is, I like it a lot, though I wish the apache integration were cleaner.

As to being good for only one kind of application...ummmm....huh?

It's true that Rails is geared towards database-enabled web applications, but... that sure does cover a lot of ground...and...the scaffolding really does simplify the task of creating them.

It's also true that you don't get nearly the benefit of Rails if you don't create a database-enabled web app, but...ummm...what is unique about that?

I've done perl/cgi,php and zope and NONE of them generates much advantage if you are doing a simple html site.

So what? Driving a car isn't much advantage for going next door. Doesn't mean the car's a bad idea, just that it's overkill for such a short trip.











jezuch

Dec 06, 2008
6:57 AM EDT
Looks like it's time for a rant from the other side of the coin ;)

"Wouter Verhelst: Rails? Stay the f* away from my system." http://www.grep.be/blog/en/computer/cluebat/rails_stay_away
Sander_Marechal

Dec 06, 2008
7:41 AM EDT
Quoting:It's true that Rails is geared towards database-enabled web applications, but... that sure does cover a lot of ground


Rails isn't suited for all kinds of database-enabled web applications. It's suited towards web applications that have a number of different objects and many instances of those objects. Things like blogs, CRM systems, planning software (Basecamp / Backpack) are good fits for RoR. Simple websites like Ken's HeliOS Solutions are not.

As you said, in many cases the RoR framework is simply overkill.

Personally I'm just partial to PHP. I have built quite a few websites and I haven't done anyone yet that wold benefit from such an MVC/ActiveRecord framework. If I do, I want to seize the opportunity to play with CakePHP which is like RoR for PHP.
penguinist

Dec 06, 2008
11:23 AM EDT
@jezuch: I agree with your comments about packaging. The ruby camp has chosen a different path by setting up gems. This has added some confusion and created a barrier to integration into the various Linux distributions. However, I think this problem has a solution, someone in the Ruby camp just needs to focus some energy on Linux packaging and configuration management strategy.

@Sander: I agree with you that setting up a full Rails framework just so that you can add a date field to your otherwise pure html web site is overkill. But, take a closer look at erb. My original point was that we lack good built-in Apache support. If you had it, you could do what you want directly in ruby/erb and reserve the full Rails framework for larger (database backed) tasks.

in html/php you might say:

Today's date is <?php echo date("Y-m-d")?>

in html/ruby (erb) you might say:

Today's date is <%= Time.now.strftime("%Y-%m-%d") %>

So, ruby or php can both get you there, one as easily as the other. The issue is that a production-worthy mod_erb for Apache does not exist.
Sander_Marechal

Dec 06, 2008
11:35 AM EDT
Well, there's no mod_ruby or mod_erb, but there's mod_rails a.k.a. Passenger. See the comments attached to my blog post about installing Tracks (a RoR application) on Apache: http://www.jejik.com/articles/2008/09/how_to_install_tracks_...

It's supposed to work well, but the way that the Debian package has been compiled conflicts with mod_php and mod_python, so you need to build it from source.
penguinist

Dec 06, 2008
12:17 PM EDT
Yes, fastcgi and mod_fcgi are what I've been using to deploy RoR in Apache. This is the best way as of today, imho. But this solution is not as clean for production sites as is mod_php on the php side. And, as you correctly point out, the packaging/installation process is not too clean either.
tuxtom

Dec 06, 2008
1:08 PM EDT
Quoting:What's holding it back?
Ruby
dinotrac

Dec 06, 2008
3:51 PM EDT
tuxtom --

????????????

I heart perl, but I heart Ruby, too.

I don't heart python, though I probably let my Zope years color that, and I REALLY don't heart PHP, but mostly because most of the PHP stuff I've seen is an ugly nast hodgepodge of code and PHP folks seem to think that regression testing is something statisticians do.
tuxtom

Dec 06, 2008
8:59 PM EDT
Well, maybe in a decade Ruby will have the traction those languages have, but I wouldn't bet on it.

What David did with Rails was introduce an exceptionally well thought out architecture using best practices, and he happened to do that using Ruby. It was a shining introduction on the eve of Web 2.0. Thing is I was rolling my own MVC in the late 90's in Java before Struts was even released, so I wasn't necessarily awed with the Gen-Y perception the RoR had 'invented' MVC. Granted, Rails does it very eloquently, but that can and has been done in a plethora of other languages.

Those other languages do a lot more real work in the world, more people know them, big projects are using them and they aren't going away. They didn't get introduced to the ball in Ruby's shiny dress, but that doesn't mean they can be used just as beautifully. What it really comes down to is practices.

If anything I would expect Python to be the next rising star. Google seems to think so.
dinotrac

Dec 06, 2008
11:25 PM EDT
tuxtom -

Rubyfolk certainly can be annoying, and you were hardly the only person rolling your own MVC.

David didn't "just happen to" do Rails in Ruby. Ruby happens to be a very nice language for doing rails.

Google notwithstanding, Python has been the next rising star for the last 10 years. It is a very nice language for very smart people who want nothing to do with the rest of us.

Ruby is more akin to perl -- even though it is also very different. Ruby seeks to make programming a joy (which, arguably, is one objective of perl and its "you can do it any way you'd like philosophy).

For me, being older than the hills, and having learned programming many years before the current crop of "you mean there is such a thing as programming without objects?" programmers, Ruby makes OO much easier than Python. There is just something about a language where even the integers are objects that leads you to write OO in spite of yourself. I never Python to be that way.



tuxtom

Dec 07, 2008
3:23 AM EDT
I didn't mean to imply that I was the only one rolling MVC by any means. In fact, I was a late bloomer. Still, we had to think it through. It wasn't conveniently packaged into nice frameworks like it is today, which is a godsend no matter the language.

But back to the point. As cute as Ruby is, it ain't never gonna become president. As imperfect as it is, PHP still rules the world. It's gonna be a long, long, long, long, long time before that changes. The prettiest language out there, and the one which is the one brings me the most joy, is the one that is prints the checks that get deposited into my bank account. Real joy comes from the fruits of programming, not from the programming itself. It ain't called work for nothing. When I want joy I go sailing.

penguinist

Dec 07, 2008
11:11 AM EDT
Quoting:David didn't "just happen to" do Rails in Ruby. Ruby happens to be a very nice language for doing rails.
If you look at the history, you can see why MVC and Ruby are so nicely matched. MVC originated with the Smalltalk project and was first described in 1979 http://heim.ifi.uio.no/~trygver/themes/mvc/mvc-index.html . The Ruby language was strongly influenced by Smalltalk, from which it inherits much of its design philosophy, so Ruby was a nice match for Rails.

Quoting:but I heart Ruby, too
Everything is an object. Objects take methods. Methods return objects.

The world is round, and life is good. (Now, if I only had good Apache integration....)
dinotrac

Dec 07, 2008
12:31 PM EDT
>As imperfect as it is, PHP still rules the world. It's gonna be a long, long, long, long, long time before that changes.

Hardly. There's still plenty of perl out there, note to mention python and java and .Net. PHP is very popular for sure, but there's room for Ruby.

As an aside... When it comes to job hunting, RoR seems to be a very good thing. There may be more PHP openings, but demand v. supply is much more favorable in Rails country.
jdixon

Dec 07, 2008
12:52 PM EDT
> The prettiest language out there, and the one which is the one brings me the most joy, is the one that is prints the checks that get deposited into my bank account.

So your a closet Cobol lover then. :)
dinotrac

Dec 07, 2008
1:46 PM EDT
penguinist --

Have you tried passenger (aka mod_rails)? It wasn't around back when I was Rails-ing, but looks like it could solve the mod_ruby problem.
penguinist

Dec 08, 2008
1:32 AM EDT
... off reading the modrails.com site ...

Ok, I see that I jumped to a conclusion. Sander mentioned passenger, but on reading his blog it looked like fastcgi/mod_fcgi which is what I have been using. But, I see now that passenger is something new, taking the fastcgi approach but fixing some of the problems along the way. Looks like I have some homework to do... Thanks dinotrac and Sander for the tip.
tuxchick

Dec 08, 2008
2:18 AM EDT
So the consensus is that PHP is the Windows of interpreted languages: kludgy spaghetti, insecure, nasty in a thousand and one different ways, and yet, and inexplicably, overwhelmingly popular. Because it takes what, thirty minutes to learn some PHP basics, and 60 minutes to learn Ruby, Perl, or Python basics?

/me despairs of humanity. Again.
Sander_Marechal

Dec 08, 2008
2:45 AM EDT
@TC: I resent that statement. PHP can be a very powerful tool in the hands of a skilled developer. PHP isn't kludgy, insecure spaghetti, but an unskilled developer can write that way. But it's also possible to write bad code in Perl, Python and even Ruby.

If PHP has one problem then it is that there are too many people who know too little about it. There are millions of people that know PHP but most are not skilled developers.
jezuch

Dec 08, 2008
3:04 AM EDT
Quoting:but an unskilled developer can write that way


And how many PHP developers are (un)skilled?

I'd say that a language should not make it easy to do stupid things. Especially a language that is supposed to be used by "the masses".
Sander_Marechal

Dec 08, 2008
3:40 AM EDT
Quoting:I'd say that a language should not make it easy to do stupid things.


Then we would never have had C or C++ :-)
dinotrac

Dec 08, 2008
7:22 AM EDT
>PHP isn't kludgy, insecure spaghetti, but an unskilled developer can write that way.

I do find it remarkable, however, that so much of the PHP code I've seen is nasty, ugly stuff. You're right, of course, that it's wrong to blame the language for the developers it attracts. I have no doubt that Visual Basic could be written in truly elegant ways, but...

There is another problem, however, and I think it's worse than the application developers using it. PHP itself -- the language -- has not been developed in a best practices way.

It can be very entertaining to discover exactly which versions of PHP will or will not work with a PHP application. Wish I could remember how much time I wasted trying to get Joomla 1.5 to work properly only to discover that I had the one and only version of PHP 5 that wouldn't work with it. Sigh.

And... I seem to recall a spell there when PHP developers were very happily churning out bugs for the platform. I could be wrong, though. Old and all that, you know.

Sander_Marechal

Dec 08, 2008
5:21 PM EDT
Quoting:I do find it remarkable, however, that so much of the PHP code I've seen is nasty, ugly stuff.


Don't ever look at the inside of SugarCRM then. It's even worse than the old PHP-Nuke. But there is quite some beautiful and well-written PHP code out there. PEAR hosts quite a few great libraries. The OpenID library is beautiful. And what do you think of my code? http://svn.jejik.com/viewvc.cgi/webkit/

Quoting:PHP itself -- the language -- has not been developed in a best practices way.


True, but it's also true for many other languages. Perl has some nasty stuff (especially concerning objects). Python is haunted by deprecated libraries once part of the standard. Even C's standard library has so many problems that people grab either Boost or glibc by default.

PHP is definitely getting better though. There is some nice stuff coming in PHP6. I just hope that at some point they break backwards compatibility on some of the more inconsistent functions (is it needle-array or array-needle on a search function?). It would also be nice if they dropped error_reporting all together and switched to exceptions only, like Pyton.
tuxtom

Dec 09, 2008
2:50 AM EDT
PHP runs LXer, which is kludgy spaghetti, insecure, nasty in a thousand and one different ways, and yet understandably, overwhelmingly popular.

Quoting:So your a closet Cobol lover then. :)
No, PL/1...but then I found Perl, though neither print my checks.
jezuch

Dec 09, 2008
2:53 AM EDT
Quoting:Even C's standard library has so many problems that people grab either Boost or glibc by default.


As I see it, C was a language designed when we were still learning; PHP is a demonstration that we haven't learned much ;)
Sander_Marechal

Dec 09, 2008
2:54 AM EDT
Hehehe :-)
jdixon

Dec 09, 2008
9:45 AM EDT
> No, PL/1...but then I found Perl, though neither print my checks.

If your checks go through multiple financial institutions, then there's almost certainly a Cobol program involved in there somewhere. But in your specific case, there may not be.
dinotrac

Dec 09, 2008
10:13 AM EDT
And we got through all of this without anybody mentioning that Java is the new Cobol.

Are we slipping?
Sander_Marechal

Dec 09, 2008
10:21 AM EDT
java? I recently read that Perl is in danger of becoming the next Cobol: http://use.perl.org/~Ovid/journal/38010

Note on that article: The TIOBE numbers are total cow manure, but read the comments to find out why Perl is becoming the next Cobol.
dinotrac

Dec 09, 2008
10:48 AM EDT
Sander -

Nah.

That just shows perl is slipping away to almost die, kept alive only by its utility.

Java is the real COBOL as evidenced by it's place at the top of the list and heavy enterprise use.

It fails the COBOL comparison in that COBOL could generate very efficient code when written by good programmers, whereas Java is, ahem, java.
Sander_Marechal

Dec 09, 2008
11:08 AM EDT
The flip side is of course that Java is still being used to implement many new and big projects, whereas Perl.... not so.
dinotrac

Dec 09, 2008
11:34 AM EDT
>The flip side is of course that Java is still being used to implement many new and big projects

Yup...for now.
number6x

Dec 09, 2008
12:49 PM EDT
it is very difficult to do a small J2EE project in the corporate world.

Posting in this forum is limited to members of the group: [ForumMods, SITEADMINS, MEMBERS.]

Becoming a member of LXer is easy and free. Join Us!