rails - loading lib folder files

Hi All,

In my project I'm using some custom liquid tags and I have created a folder called 'Liquid' inside my 'lib' directory and there I have a liquid module called helpers,

    module Liquid::Helpers

    end

So the project tree is as follows

Root

    --> lib

          --> Liquid

And I'm trying to register my tags in my environment.rb file

    Liquid::Template.register_filter(Liquid::Helpers)

To load my lib files when the server starts, I'm trying this in application.rb

    config.autoload_paths << File.join(Rails.root.to_s, "lib")

But I'm getting the following error

I'm on Rails3 with Ubuntu. Following is my full error code

    `<top (required)>': uninitialized constant Liquid::Helpers (NameError)       from <project path>/config.ru:3:in `require'       from <project path>/config.ru:3:in `block in <main>'       from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'       from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'       from <project path>/config.ru:1:in `new'       from <project path>/config.ru:1:in `<main>'       from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'       from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'       from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'       from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'       from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'       from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands/server.rb:65:in `start'       from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:30:in `block in <top (required)>'       from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:27:in `tap'       from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:27:in `<top (required)>'       from script/rails:6:in `require'       from script/rails:6:in `<main>'

What am i missing here, can someone help me, thanks in advance

cheers

sameera

Sameera Gayan wrote in post #967713:

Hi All,

In my project I'm using some custom liquid tags and I have created a folder called 'Liquid' inside my 'lib' directory and there I have a liquid module called helpers,

    module Liquid::Helpers

    end

So the project tree is as follows

Root

    --> lib

          --> Liquid

And I'm trying to register my tags in my environment.rb file

    Liquid::Template.register_filter(Liquid::Helpers)

To load my lib files when the server starts, I'm trying this in application.rb

    config.autoload_paths << File.join(Rails.root.to_s, "lib")

But I'm getting the following error

I'm on Rails3 with Ubuntu. Following is my full error code

    `<top (required)>': uninitialized constant Liquid::Helpers

[...]

Of course. Autoload expects lowercase filenames.

Best,