Ruby's autoload not working in 1.8.7 or Ruby Enterprise?

Posted by webren on Stack Overflow See other posts from Stack Overflow or by webren
Published on 2011-06-29T18:44:33Z Indexed on 2011/06/30 8:22 UTC
Read the original article Hit count: 292

Filed under:
|
|

I've written a gem and within a file I am doing this to autoload my main gem logic:

$:.push File.expand_path('lib', __FILE__)

require "oa-casport/version"
require 'omniauth/core'

module OmniAuth
  module Strategies
    autoload :Casport, 'omniauth/strategies/casport'
  end
end

For Ruby versions 1.8.7 and ree, it prints out "no such file to load - omniauth/strategies/casport'
But it doesn't print out this message on version 1.9.2. Is there something off with the location of calling autoload?

The repo for the gem is located at https://github.com/stevenhaddox/oa-casport

© Stack Overflow or respective owner

Related posts about ruby

Related posts about gem