#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    3
    Rep Power
    0

    Google doesn't have all the answers...


    Well I think I looked every where and this is as close as I have been able to get.

    I learned about Ruby and tried it out in an online LIVE tutorial, and absolutely love it.

    Here's the thing. I am not a fan of Rails. So the big question is, can Ruby be used as easily as PHP? What I mean by this, is that I can easily create a development environment by downloading XAMPP onto a Windows machine and begin developing.

    I have yet to find a way to create we apps/pages using Ruby in this way.

    As a side note, I am not a fan of CakePHP either. Perhaps it's just the implementation of the MVC design pattern they use that does suit me.

    Any insight would be helpful.

    Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Location
    Constant Limbo
    Posts
    989
    Rep Power
    363
    You can get ruby for apache here. You will have to look at how to get that working with XAMPP as I am unfamiliar with how XAMPP works.

    Then you can either use rails, which it sounds like you are against, or you can use straight Ruby.

    There are two ways to use ruby in a web page: you can have a executable that generates the html as its output, or you can use Ruby's built-in templating system (ERB) to have ruby code execute in-line with html much as you would do with PHP.

    There is overhead for the ERB approach in that you have to get apache to be ERB-aware (searches should include RHTML). Again, I have no XAMPP experience so you will have to revert to google - but a focused search should turn something up reasonably soon.
    True happiness is not getting what you want, it's wanting what you've already got.

    My Blog
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    3
    Rep Power
    0

    Drupalize my Ruby


    Thanks L7Sqr!

    I had found that, but it says the project is discontinued, and to use "INSTANTRAILS". As you can see by the name, it infers the usage of rails.

    Perhaps I am approaching this wrong.

    Perhaps i should be asking for good reference materials that explain how, when and where ruby executes. Books, blogs and/or articles that give some deep understanding of how ruby works.

    Not interested in coding "how-to's", but basically the stack and execution of code on Apache etc.

    Why?

    I happen to be a champion (relatively speaking) of the Drupal model versus the Rails (CakePHP) model. So I am interested in understanding the inner workings of Ruby to begin efforts in building a "Hook" system for Ruby.

    I have seen some conversations which support this concept, but none of them discuss the environment necessary or the mechanics which allow for someone to begin.

    I hope that is as clear as mud.

    Thanks for the info on the executable, rhtml and the ERB.

    Bill
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Location
    Constant Limbo
    Posts
    989
    Rep Power
    363
    This may be entirely unhelpful to you, but I have the following setup at home. I say that it may be unhelpful since it is a linux system using apache2 - maybe some of this will translate.

    In /etc/apache2/ there are several directories.
    Code:
    $ pwd 
    /etc/apache2/
    $ ls -l
    -rw-r--r-- 1 root root 10250 2010-02-10 11:38 apache2.conf
    drwxr-xr-x 2 root root  1024 2010-02-10 11:45 conf.d
    -rw-r--r-- 1 root root   378 2009-11-14 16:01 envvars
    -rw-r--r-- 1 root root     0 2010-02-05 20:55 httpd.conf
    drwxr-xr-x 2 root root  5120 2010-03-02 21:32 mods-available
    drwxr-xr-x 2 root root  1024 2010-02-11 14:10 mods-enabled
    -rw-r--r-- 1 root root   513 2009-11-14 16:01 ports.conf
    drwxr-xr-x 2 root root  1024 2010-02-11 13:07 sites-available
    drwxr-xr-x 2 root root  1024 2010-02-05 20:55 sites-enabled
    In mods-enabled I have the following
    Code:
    $ ls mods-enabled
    ...
    ruby.load
    ...
    $ cat mods-enabled/ruby.load
    LoadModule ruby_module /usr/lib/apache2/modules/mod_ruby.so
    So I have mod_ruby (much like how mod_php works) which allows for ruby files to be executed. To enable rhtml (erb) I would need to add a ruby.conf that detailed how to handle files that end in .rhtml.

    Like I said, I know nothing about windows so you may find that none of what I said helps. Hopefully that is not entirely true.
    True happiness is not getting what you want, it's wanting what you've already got.

    My Blog
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    3
    Rep Power
    0

    Lost in translation


    Thanks L7Sqr!

    I think I can make the translation from Linux to Windows, as I know just enough about both to be dangerous...


    Thanks for the help!
    Bill
  10. #6
  11. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Location
    Bangle of India
    Posts
    52
    Rep Power
    5
    Hi, I am not a PHP or Java programmer and so it is not easy for me to comment in concretely, I have have simple idea about Ruby, among other things, is how expressive it is -- expressive in the technical sense that a small amount of code can do a great deal. In my experience, the more you work on a Ruby program, the more code disappears from the screen. Moreover, as the code gets smaller, it gets clearer, not more cryptic. Ruby is the only language a system like Rails could be written in. So it is very useful to me.

IMN logo majestic logo threadwatch logo seochat tools logo