Troubles with using gems in Rails

Witold,

That is an enhancement of the latest rubygems. The 'gem' method does not trigger auto-require as 'require_gem' used to. The 'acts_as_taggable' gem has autorequire set to 'taggable', which activates all that stuff you expect. But since it is not called when you use 'gem', you need to require 'taggable' explicitly after that. Notice, that there is no need to specify the full path in require.

Hope it helps, Val

$ irb -rrubygems

gem 'acts_as_taggable'

=> true

require 'taggable'

=> true

ActiveRecord::Acts::Taggable

=> ActiveRecord::Acts::Taggable

Witold Rugowski wrote:

Val wrote:

That is an enhancement of the latest rubygems. The 'gem' method does not trigger auto-require as 'require_gem' used to. The 'acts_as_taggable' gem has autorequire set to 'taggable', which activates all that stuff you expect. But since it is not called when you use 'gem', you need to require 'taggable' explicitly after that.

Thank You for clarifications.

Is there some way to enable old behavior? Well, I see this as something lowering code readability. Thanks to disabled auto require feature I need to execute two commands, and require often would need different name for include (like in this example: acts_as_taggable and taggable)

gem "somegem" is - if I understand correctly - only needed if you need a special version

require "somegem" will require the latest "somegem"

irb(main):001:0> require "rubygems" => true irb(main):002:0> require "trollop" => true irb(main):003:0> Trollop::VERSION => "1.6"