Martin GÃ¼tlein wrote:
My ruby cannot find a class from the actionpack gem:
Rails questions are best asked on a Rails mailing list. This list is for
Ruby (the programming language). A smart question would also say what
exact version of Rails you are using, and on what platform.
But I would make the following comment: require ‘foo’ doesn’t
necessarily load everything inside the ‘foo’ package. It loads exactly
what foo.rb tells it to load. You will need to look at the source of
foo.rb to see if it loads what you want, and if it doesn’t, you’ll need
to load what you want yourself.
NameError: uninitialized constant ActionController
[This is with rails-2.3.2 under Ubuntu Hardy with ruby-1.8.6p111
compiled from source]
And you can see why easily:
$ cat /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/actionpack.rb
$ cat /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_pack.rb
<< snip copyright message >>
module ActionPack #:nodoc:
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
TINY = 2
STRING = [MAJOR, MINOR, TINY].join('.')
So if you require ‘actionpack’, that’s exactly all you will get.