Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Ruby on Rails setup problem

Options
  • 19-09-2009 3:57pm
    #1
    Registered Users Posts: 2,265 ✭✭✭


    I'm following a tutorial from IBM; have downloaded RoR and the gems I need.
    I've created a new project and then I run the command "ruby script/server". This appears to run fine. However, when I enter "http://localhost:3000/" into my browser it can't find the page.
    I've tried googling around but no one else seems to have gotten this problem. I tried one solution attempt of reseting winsock but it didn't do anything. When I ran the server first I told the firewall to unblock it and I've tried running it with the firewall off.
    It's probably something extremely obvious but I'm at a loss. Any ideas?


Comments

  • Registered Users Posts: 2,265 ✭✭✭Seifer


    Got an answer else where.
    "http://127.0.0.1:3000" works in case anyone is curious.


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    localhost should have worked too. Strange that.


  • Registered Users Posts: 2,265 ✭✭✭Seifer


    So I've left the IBM tutorial I was trying alone for the moment. The sample solution it provides seems to run fine but when I follow the instructions to create it myself it doesn't work.
    So I'm trying the hello world type exercise here. When I get to step 3.4 "rake db:create" I get a pop-up saying "This application has failed to start because sqlite3.dll was not found. Re-installing the application may fix this problem".
    So sqlite3 is definitely installed. And I removed and reinstalled and no change.

    The IBM sample code seems to use sqlite and runs fine but I get the same error when following the steps it outlines to recreate it.

    I'm working in Windows Vista.

    Any ideas?


  • Registered Users Posts: 216 ✭✭KJF


    You will need to download the sqlite3 dll and place it in your path so windows can find it.

    Take a look here: http://www.skorks.com/2009/08/installing-and-using-sqlite-with-ruby-on-windows/


  • Registered Users Posts: 2,265 ✭✭✭Seifer


    KJF wrote: »
    You will need to download the sqlite3 dll and place it in your path so windows can find it.

    Take a look here: http://www.skorks.com/2009/08/installing-and-using-sqlite-with-ruby-on-windows/
    Thank you very much for that. What was throwing me was that the IBM sample code was working without the dll. Once I downloaded it both projects I created worked :D


  • Advertisement
  • Registered Users Posts: 956 ✭✭✭Mike...


    did you rake db:migrate
    ruby script/server

    I use Instant rails for all my stuff
    try 0.0.0.0:3000


  • Registered Users Posts: 2,265 ✭✭✭Seifer


    Mike... wrote: »
    did you rake db:migrate
    ruby script/server

    I use Instant rails for all my stuff
    try 0.0.0.0:3000
    All my problems have been solved for the moment :)

    But from my limited understanding, I don't think it would be possible to migrate a db before creating it.
    And no 0.0.0.0 doesn't work for me, only 127.0.0.1


  • Registered Users Posts: 956 ✭✭✭Mike...


    strange that,
    but then again i use scaffolding to create my fields


  • Registered Users Posts: 2,265 ✭✭✭Seifer


    So I've gone back to the IBM tutorial linked to in my previous post.
    Just running the sample code they provide. When I click on the "generate using rexml" link I get what's in the attached image.
    So assuming they provide a working solution, any ideas on what I'm missing to make this work?
    As far as I know rexml comes preloaded with ruby and I can't see it in the gem list.

    Here's the offending method:
    (line 70 highlighted with ***, they're not in the code)
      def generate_rexml
        doc = REXML::Document.new
        root = doc.add_element( "Food" )
        DISHES.each{ |element_data|
          
          dish_element = root.add_element( "Dish" )
          
          ***dish_element.add_attribute( "rating", element_data[:rating] )***
          dish_element.add_attribute( "category", element_data[:category] )
          
          dish_name_element = dish_element.add_element( "DishName" )
          dish_name_element.add_text( element_data[:dish_name] )
    
          where_to_buy_element = dish_element.add_element( "WhereToBuy" )      
          where_to_buy_element.add_text( element_data[:where_to_buy] )
        }
        doc.write( out_string = "", 2 )
        return out_string
      end
    


  • Registered Users Posts: 2,265 ✭✭✭Seifer


    Always helps to step away from these things for awhile.
    While I haven't fixed it, I have narrowed it down by trying the other link which uses Builder to generate the xml instead of rexml and it works fine. So the problem is definitely to do with rexml.
    Whether it's not installed correctly or the code is using some deprecated method calls, I don't know.


  • Advertisement
  • Closed Accounts Posts: 1,015 ✭✭✭Epic Tissue


    That tutorial is over 2 years old. I was doing an old tutorial for ror and ran into lots of problems. Changed to a different one and was smooth sailing from there.


  • Registered Users Posts: 2,265 ✭✭✭Seifer


    That tutorial is over 2 years old. I was doing an old tutorial for ror and ran into lots of problems. Changed to a different one and was smooth sailing from there.
    Fair enough.
    I'm gonna see how far I can get just using the Builder side of it for now anyway.


Advertisement