SitePoint Sponsor

User Tag List

Results 1 to 14 of 14

Hybrid View

  1. #1
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Ruby without Rails

    I am warming up to Ruby. However, I am not overly keen on Rails as for right now, but mabye in the future.

    How could I setup Ruby (only) test setup where I could run some web stuff written in Ruby?
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    mod_ruby
    ERB

    Or if you want to try an alternative Ruby framework, Nitro

  3. #3
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Any place to get a build of Modruby?
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by The New Guy
    Any place to get a build of Modruby?
    mod_ruby.so from here is the only place I can seem to find it

    You might also want to try Mongrel, but I've never used it and have no idea how to set it up, with or without Rails.

  5. #5
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could also look at Camping.

  6. #6
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Honestly, I don't want a framework at all. I really want to play with the language as is.
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  7. #7
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by The New Guy
    Honestly, I don't want a framework at all. I really want to play with the language as is.
    In that case you should probably just use plain old WEBrick and WEBrick servlets. It should be fine for testing and tinkering.

  8. #8
    SitePoint Zealot
    Join Date
    Jul 2005
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try eruby, it will allow you to use Ruby in a PHP like way. You can read the installation instructions here under the "Installing eruby in Apache" heading. Hope it helps.

  9. #9
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    FWIW, if you just want to use Ruby embedded in web pages without any kind of framework, you are probably better of just using PHP. A better way of learning Ruby would be to try and write some non-web based scripts in my opinion.

    In fact, an even better way to learn Ruby is using Test::Unit.

    http://clarkware.com/cgi/blosxom/2005/03/18

  10. #10
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by The New Guy
    I am warming up to Ruby. However, I am not overly keen on Rails as for right now, but mabye in the future.

    How could I setup Ruby (only) test setup where I could run some web stuff written in Ruby?
    I'd start with plain old CGI. For just playing with the language it's more than sufficent. The setup is extremely easy:

    1. Install apache
    2. Install ruby
    3. In apache's CGI directory (usually htdocs/cgi-bin) create the test.rb file as follows
    Code:
    #!path/to/the/ruby/binary
    require 'CGI'
    print "Content-type:text/html\n\n"
    
    print "hello web"
    4. Browse to http://localhost/cgi-bin/test.rb.
    5. If doesn't work, check apache error.log
    6. If works, try adding more code (after line 3, first three are required).

  11. #11
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by stereofrog
    I'd start with plain old CGI. For just playing with the language it's more than sufficent. The setup is extremely easy:

    1. Install apache
    2. Install ruby
    3. In apache's CGI directory (usually htdocs/cgi-bin) create the test.rb file as follows
    Code:
     #!path/to/the/ruby/binary
     require 'CGI'
     print "Content-type:text/html\n\n"
     
     print "hello web"
    4. Browse to http://localhost/cgi-bin/test.rb.
    5. If doesn't work, check apache error.log
    6. If works, try adding more code (after line 3, first three are required).
    AH! Finally. I was just about to chuck ruby in the trash. Thanks.

    On a related note, I should be using rubyw.exe rather then ruby.exe right?
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  12. #12
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    rubyw.exe doesn't create a console window, ruby.exe does. rubyw.exe is for gui applications when you don't want a visible console.

  13. #13
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    So, is that a yes?
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  14. #14
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you should use the console version (regular ruby.exe), but maybe it doesn't matter.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •