Search code examples
jrubyjrubyonrailsnetbeans-6.9

Why can't my NetBeans JRuby on Rails project see the ssl_requirement module?


I am using the NetBeans IDE 6.9.1 for working on a JRuby on Rails application I inherited. Due to security requirements, I am attempting to force SSL for the entire application. Following the recommendation in "Agile Web Development with Rails", I have included the ssl_requirement gem in my project. I can right-click on Libraries in the Projects tab and verify that ssl_requirement is included.

As recommended, I have included the module in my base controller as follows:

class ApplicationController < ActionController::Base
  include SslRequirement
  # ...
end

However, whenever I try to start the application, I always get this error message

uninitialized constant ApplicationController::SslRequirement

I have searched all over the web, and cannot find any guidance as to what I might have done wrong here, other than to "restart the server." Believe me, I've tried that.


Solution

  • My failure was unfamiliarity with how gems are included in code. The book failed to mention that I needed to also put

    require 'ssl_requirement'
    

    in the code file, presumably because ruby developers usually know to do that.