SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error starting ruby console

    Hi,

    I just installed ruby 1.8.7 on ubuntu and get the following error when launching the console :

    $ ruby script/console
    Loading development environment (Rails 2.1.0)
    /home/roger/rails/shovell/config/../vendor/rails/railties/lib/initializer.rb:225:in `require_frameworks':RuntimeError: no such file to load -- builder
    /home/roger/rails/shovell/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:93:NoMethodError: undefined method `cattr_accessor' for ActionController:ispatcher:Class
    /home/roger/rails/shovell/app/controllers/application.rb:4:NameError: uninitialized constant ActionController::Base
    Any idea what this could mean ?

  2. #2
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After some digging i found that it was related to the version of Ruby. Removing 1.8.7 and installing 1.8.6 solved the problem.
    Installing RoR is a painful process....

    However, when starting the ruby console i now get the message
    ruby script/console
    Loading development environment (Rails 2.3.2)
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant':NameError: uninitialized constant ApplicationController
    I suppose there is still another incompatibility between the different modules...

  3. #3
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just for those who might be interested. After re-installing ruby 1.8.6 and rails 2.0.2 (like in simply rails book, by explicitly specifying the version in gem) the problems are gone.
    It seems that RoR is very sensitive to mixes of versions.
    I installed RoR from the sources like specified in the 'Simply Rails' book. Is this the recommended way on Debian/Ubuntu linux or is there a shorter way to install RoR ?

  4. #4
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rails is changing rapidly this year; expect most printed books to be hopelessly out of date by fall, if not before.

    Yes, some builds of 1.8.7 were buggy; what's the build number (after the p). Current is 1.9.x (1, I think) but 1.9, while spectacularly faster, breaks a whole lot of things, and needs Rails 2.1 or better.

    When working with a book, it's best to work with the versions they use. You can have multiple versions of Rails in use at the same time. in config/environment.rb is a line setting RAILS_GEM_VERSION. Set that to the version you want to use in that project and you're good to go.

    You can look at multiruby as a tool to help you work with multiple versions of ruby as well.

  5. #5
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx for the info Arlen.
    For those who use the 'Simply Rails' book, i've put a working installation procedure on my blog at www(dot)pragmindz(dot)org (srry, for the strange notation, but forced by the spam filter :-))
    It follows the procedure in the book but specifies the 2.0.2 version of rails. This combination works for me on an Ubuntu platform. HTH.


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
  •