Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8348869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:49:05+00:00 2026-06-09T07:49:05+00:00

I have a class in the lib directory: lib/static.rb Inside that I have: class

  • 0

I have a class in the lib directory:

lib/static.rb

Inside that I have:

class Static
  def self.boo
    return 'what'
  end
end

I have a controller:

class PensionsController < ApplicationController
  layout 'page'
  def guides
    render :text => Static.boo
  end
end

And i’m getting this error:

undefined method `boo' for Static:Class

Any ideas what i’m doing wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:49:07+00:00Added an answer on June 9, 2026 at 7:49 am

    Are you using Rails 2 or 3? In Rails 3 classes in the lib directory aren’t loaded by default.

    I have this line at the bottom of config/application.rb to enable that behavior:

    config.autoload_paths += %W(#{config.root}/lib)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this code inside my lib/ folder: class GlobalConfig::SetHelper def self.yes_no_input(configuration) value
Hey we have a library class (lib/Mixpanel) that calls delayed job as follows: class
I have a module in lib directory with the name Transpo.rb: module Transpo class
I have a .jar file that i've placed in my D:\Coldfusion8\wwwroot\web-inf\lib\ directory. The file
I have a small library, say widget_utils.rb, that lives in the lib/ directory of
I have a class with a static method that looks roughly like: class X
Lets say I have this class in foobar-shared.lib: class FooBar { std::string m_helloWorld; }
Suppose I have three projects in my sln. (1) xyz.a{Class Lib}{no reference added} (2)
I have a class Test which is in lib folder and I want to
Assume I have a singleton class in an external lib to my application. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.