When creating a new Rails 3.0 project and including firewatir and commonwatir in the list of gems an error is thrown when accessing a controller. Here are the repro steps:
gem install rails
gem install firewatir
gem install commonwatir
> rails new testrails
> cd testrails
> echo 'gem "commonwatir"' >> Gemfile
> echo 'gem "firewatir"' >> Gemfile
> bundle install --deployment
> rails generate controller Pages home
> rails server
From a web browser request the page http://localhost.local:3000/pages/home
The following error is thrown: NoMethodError: undefined method `cache' for :active_support:Symbol
I tracked this down to this file:
commonwatir-1.8.0/lib/watir/core_ext.rb
def underscore
gsub(/\B[A-Z][^A-Z]/, '\&').downcase.gsub(' ', '')
end
The underscore method is added/redefined in the core String class, which Rails also redefines using ActiveSupport::Inflector, but the underscore methods are incompatible. If that method is commented out, the above error is no longer thrown. I'm not sure of a good solution to this. Either rename the method and refactor all the watir code or depend ActiveSupport.
Adding ActiveSupport dependency is definitely not a solution. We just got rid of it