Finaly! got a RubyOnRails test app working!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Finaly! got a RubyOnRails test app working!

    Steps to happiness:
    Install Rails using CPanel
    swtich theme to x3
    look under Software / Services
    click on RubyGems
    type "rails" in the second field and click "Install Now"

    create a cron job to run the following commands
    (don't forget to delete it when it's done)

    cd /home/<your-home-directory>/ruby
    gems/bin/rails testapp
    cd testapp
    /usr/bin/ruby script/generate controller main welcome

    use CPanel to create a new subdomain, set the document root to ruby/testapp/public

    point your browser at http://<your-subdomain>.<your-domain>/ - you should get the standard rails startup screen.

    now try http://<your-subdomain>.<your-domain>/main/welcome - you should see
    Main#welcome

    Find me in app/views/main/welcome.rhtml

    now you can add this line to ruby/testapp/config/routes.db - make sure you put it before all other "map.connect" lines.
    map.connect '', :controller => 'main', :action => 'welcome'
    and delete or rename the file ruby/teatapp/public/index.html

    now you can leave off the /main/welcome from the url and still see your app


    you can see the proof at http://ruby.noelwalters.co.uk/

    The rest - as they say - is up to you...

    (please note I typed all this from memory - if you get stuck let me know.)

    I'll be building on this a little more as I take my first steps into Ruby on Rails so check back from time to time if you're interested.

    Right now I'm going to enjoy a well earned break - maybe open a bottle of something - getting this to work has taken many hours and stressed me out somewhat!

    Noel.

    #2
    Thanks for that little guide Noel - I am going to try it as I am really interested in learning Ruby.

    I'm sure this will also be very helpful to many others as setting up and getting a test app running has been quite frustrating recently for some of the forum community!
    David Smith
    Managing Director
    DPS Computing Limited

    - Massive update! (September 2011) - It's now not neglected!!
    - New Site (10/2009)

    Comment


      #3
      I would like to watch a video tutorial preferably, I am not sure if there any such video tutorial for ROR?

      Comment


        #4
        Originally posted by paul View Post
        I would like to watch a video tutorial preferably, I am not sure if there any such video tutorial for ROR?
        I haven't seen any yet but if I do find one then I will post a link to it here .
        David Smith
        Managing Director
        DPS Computing Limited

        - Massive update! (September 2011) - It's now not neglected!!
        - New Site (10/2009)

        Comment


          #5
          I couldn't find anything like that. I had a good look around.

          The main things are installing rails and setting the document root of your domain (or sub domain) to the ruby application's public directory. After that everything else just works.

          Using CRON jobs to run ruby commands is a bit of a pain, but you could always develop your app off line and then upload it.

          Comment


            #6
            I had a first bash at making my test app return some data from a mySQL database.

            The only problem I came across was that any database you create trough CPanel gets your account name prefixed to the database name. This means that you can't use the default database name and you have to edit the database names in testapp/config/database.yml.
            You also need to edit this file to specify the username and password for each database.

            Once again I had to use a cron job to run script/generate to create my model.

            I quickly go bored of adding test records so there are only two names in my contact book at the moment.

            Comment


              #7
              Set up a form and i'll add some test records for you .
              David Smith
              Managing Director
              DPS Computing Limited

              - Massive update! (September 2011) - It's now not neglected!!
              - New Site (10/2009)

              Comment


                #8
                That's the idea. But I'm away for a few days

                Comment


                  #9
                  Originally posted by Noel View Post
                  That's the idea. But I'm away for a few days
                  Oh well - if you do get time to do the form in the end just tell me and I'll be happy to help .
                  David Smith
                  Managing Director
                  DPS Computing Limited

                  - Massive update! (September 2011) - It's now not neglected!!
                  - New Site (10/2009)

                  Comment

                  Working...
                  X