Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Working with Ruby

  1. #1
    Join Date
    Mar 2007
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Working with Ruby

    I have recently been dabbling in Ruby and I've found I like it quite a bit but being the first actual language I've learned I don't know much about getting these files on the web. How would you run a ruby file in a web browser is basically what I'm asking. I know you can build blogs and photo galleries with it but I have no idea how that works.

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    You may want to check out a webhost with Ruby/Rails capabilites.

    http://wiki.rubyonrails.org/rails/pages/RailsWebHosts

    I am trying to get one of my servers to support it, but still running in the test phases right now.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Mar 2007
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well my host does support it, but I don't have any clue of how to do anything of that magnitude. I probably should have mentioned I am absolutely new to Ruby. I downloaded it yesterday an played around and made a very simple program. Would you directly link to the .rb file? Or is there some sort of way to include the file within a PHP page? Also, are there any good tutorials on using databases with Ruby, I have never used a database before and I'm not getting the hang of those either.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    No, you need to use a framework such as Rails. You can run a Ruby file directly as a CGI script, but this is much less useful than using a framework. Ruby is not a Web-oriented language like PHP is, so you really need a framework to provide the necessary functions. You can make do with CGI, but it's ugly and much more difficult than using Rails, and you'll probably end up regretting it.

    I suggest you become a lot more familiar with Ruby before you dive into interacting with a complex framework. The same goes for databases, probably, although databases are more-or-less the same no matter what language you use.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Mar 2007
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried to install Rails but it was not working for some reason. What can I do to get practice and get used to Ruby? I read a tutorial that walked through the basics of it but how could I take that knowledge to the next level, how would you make an actual program that does not run in the command prompt?

    I hate to be such a nuisance, but again, I know absolutely nothing about programming.
    Last edited by lord_havoc; 10-28-2007 at 10:17 PM.

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    What makes you think that something with a text-based interface isn't an "actual program?"
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Mar 2007
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah, true. Let me restate that, it came out wrong. How could I take that knowledge and apply it to making a program that runs with a GUI, (as I said, one that does not run in the command prompt) such as a photo viewer, blog, or game.
    Last edited by lord_havoc; 10-30-2007 at 01:22 AM.

  8. #8
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    The first thing you need to do is figure out what you want to do. What type of program do you want to make?

    Then use what you already know and start coding. After that find solutions to the errors you get, one by one. Making mistakes in coding is what helps you learn the language.

    To install rails on your computer you can follow this pretty simple tutorial

    Then you just need guidance:

    http://rubylearning.com/

    http://poignantguide.net/ruby/

    http://learnruby.com/

    There is a PDF file "the ruby bible" or something like that which I will find and post here as well, it is rather good reading.

    <EDIT>
    Found the book, and a quick refernce guide...

    the book

    The cheat sheet

    </EDIT>
    Last edited by BLiZZaRD; 10-30-2007 at 02:40 PM.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    How could I take that knowledge and apply it to making a program that runs with a GUI, (as I said, one that does not run in the command prompt) such as a photo viewer, blog, or game.
    You need a GUI toolkit and Ruby bindings for it. I suggest FOX and FXRuby for applications that must be very lightweight (fast to run/small program size), and Ruby/Qt otherwise, since Qt has a huge selection of widgets.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Mar 2007
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Here's another question. Explain what a framework is exactly? What's different about writing ruby code with and without rails? What exactly does rails allow me to do that I couldn't before it was installed?

    Okay, so that was actually three, but I just wanted to be clear and get the answer I'm looking for.

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
  •