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

  • SEARCH
  • Home
  • 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 7865135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:59:42+00:00 2026-06-02T23:59:42+00:00

I am newbie in Ruby. I installed by following this tutorial: http://udooz.net/blog/2011/02/facebook-app-using-rails-koala/ Now, when

  • 0

I am newbie in Ruby. I installed by following this tutorial: http://udooz.net/blog/2011/02/facebook-app-using-rails-koala/

Now, when I do this: rails generate controller

rails generate controller home index

I get this error:

/home/hiccup-pro/Documents/qstack/config/environment.rb:8:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
from /home/hiccup-pro/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.3/lib/rails/application.rb:103:in `require'
from /home/hiccup-pro/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.3/lib/rails/application.rb:103:in `require_environment!'
from /home/hiccup-pro/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.3/lib/rails/commands.rb:25:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

I fixed it. Atleast that bug, but now I’ve a different bug and that is: uninitialized constant LoginController. I googled a bit and found out that I should not mention config.* in the environment.rb.
Anyway,
this is my environment.rb

# Load the rails application
require File.expand_path('../application', __FILE__)

# Initialize the rails application
Qack::Application.initialize!
config.action_controller.allow_forgery_protection = false

So, why do I get this uninitialized constant LoginController error?

  • 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-02T23:59:43+00:00Added an answer on June 2, 2026 at 11:59 pm

    Without seeing your environment.rb is hard to say, but my best shoot is that you put the code

    config.action_controller.allow_forgery_protection = false
    config.gem "koala"
    

    Outside of the block

    Rails::Initializer.run do |config|
      ....
    end
    

    That is inside of environment.rb. If there is no such a block add it like this:

    Rails::Initializer.run do |config|
      config.action_controller.allow_forgery_protection = false
      config.gem "koala"
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ruby newbie here. I'm following the Rails Tutorial and got stuck around 5.3 re:
I'm a newbie following the RailsTutorial.org program and have installed/setup rvm, ruby 1.9.2,rails, curl,
I am facing Following problem, since i m a newbie to ruby on rails
I'm a newbie ruby on rails programmer, so forgive me if this is a
Newbie to ruby this is my first project I am using the FasterCSV Gem
I'm Ruby/Rails newbie and trying to get the laika tool ( http://github.com/CCHIT/laika/tree/master ) running
I am a newbie to Ruby on Rails . I have started working on
I am a Ruby newbie. How can I write better for this function? can
I'm definitely a newbie to ruby (and using 1.9.1), so any help is appreciated.
I a newbie trying to write a [Ruby ON Rails] spec to make sure

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.