RubyGems Load Error Problem -- Any Ideas?

Discussion in 'Ruby' started by Anthony Baker (ThinkBigIdeas), Feb 9, 2005.

  1. Hey Folks,

    Am new to Ruby and Rails and am currently (finally) getting started
    following a long install process on OS X 10.3.5.

    All I've done so far is to create an empty controller called MyTest
    using the following command:

    ruby script/generate controller MyTest

    Which generated the file my_test_controller.rb in the app/controllers
    directory.

    This is following the "Rolling with Ruby on Rails" article from Curt
    Hibbs at O'Reilly. What I get is the following error and I can't seem
    to figure out why this is occurring.


    Processing Base#index (for 127.0.0.1 at Tue Feb 08 18:50:02 PST 2005)
    Parameters: {"action"=>"index", "controller"=>"MyTest"}

    LoadError (No such file to load -- mytest_controller.rb):

    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/
    action_controller/support/dependencies.rb:38:in `load'

    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/
    action_controller/support/dependencies.rb:38:in `require_or_load'

    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/
    action_controller/support/dependencies.rb:46:in `require_or_load'

    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/
    action_controller/support/dependencies.rb:46:in `require_or_load'

    /usr/local/lib/ruby/gems/1.8/gems/rails-0.9.5/lib/dispatcher.rb:38:in
    `dispatch'
    /Users/bigo/www/rails/cookbook/public/dispatch.cgi:10

    Rendering
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.4.0/lib/
    action_controller/templates/rescues/layout.rhtml (500 Internal Error)


    If anyone has any pointers or solutions, I'd much appreciate it.


    Thanks,

    Anthony
     
    Anthony Baker (ThinkBigIdeas), Feb 9, 2005
    #1
    1. Advertising

  2. Anthony Baker (ThinkBigIdeas)

    smoon Guest

    I know that if I did the url:

    http://localhost:3000/mytest

    Things would blow up, but with the url:

    http://localhost:3000/MyTest

    everything was fine. I don't fully understand the logic of how
    everything works but it appears to be case sensitive.

    MyTest will map to my_test_controller.rb and mytest will map to
    mytest_controller.rb

    Hope that helps. I'm just learning ruby and rails right now myself...
     
    smoon, Feb 9, 2005
    #2
    1. Advertising

  3. Anthony Baker (ThinkBigIdeas)

    Andre Nathan Guest

    Hi Anthony

    Anthony Baker said:
    > ruby script/generate controller MyTest
    >
    > Which generated the file my_test_controller.rb in the app/controllers
    > directory.


    [snip]

    > LoadError (No such file to load -- mytest_controller.rb):


    I believe the problem is related to your controller name. Rails
    creates the controller file using the controller name +
    "_controller.rb" as its name. On file creation, it's adding an extra
    underscore due to the lowercase-to-uppercase shift in MyTest, but it
    doesn't do the same when trying to load the file -- it's trying to
    find mytest_controller.rb.

    This looks like a bug, although I'm not sure if CamelCase controller
    names are supported (I'm guessing they should be). If you do it with a
    controller named "Test" it'll probably work.

    HTH
    Andre
     
    Andre Nathan, Feb 9, 2005
    #3
  4. Anthony Baker (ThinkBigIdeas)

    AnthonyBaker Guest

    Yay!

    Nixing CamelCase works.

    Hmm... the MyTest example was one used in the OnLamp article and --
    there at least -- it seemed to work. They did their work on Windows,
    however.

    Anyone know how to get CamelCase working on Rails? It would be a
    nice-to-have, though I'm sure including it in URLs might cause grief to
    some users who try to type things in by hand...

    Thanks, Andre!

    /Anthony
     
    AnthonyBaker, Feb 9, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. robert walker
    Replies:
    2
    Views:
    514
    John C. Bollinger
    Aug 4, 2003
  2. Trevor
    Replies:
    5
    Views:
    601
    Bill Kelly
    Jan 29, 2005
  3. Erik Veenstra
    Replies:
    4
    Views:
    892
    Austin Ziegler
    Feb 4, 2005
  4. Bennett, Patrick
    Replies:
    1
    Views:
    126
    Assaph Mehr
    Jul 18, 2005
  5. Eric Roscher
    Replies:
    3
    Views:
    391
    Eric Roscher
    Nov 24, 2009
Loading...

Share This Page