Hello, I am new to ruby and trying to refactor some ruby code that just
consists of a few files containing a couple of small classes and am
running rspec on a specification file like "rspec collector_specs.rb"
and am getting the following error output and have been working on
fixing this for hours and am stumped, I am guessing I am making some
newbie mistake:
···
********************************************************************
C:/Ruby191/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_view/helpers/tag_helper.rb:10:in
`<module:TagHelper>': u
ninitialized constant ActionView::Helpers::TagHelper::ERB (NameError)
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_view/helpers/tag_helper.rb:9:in
`<module:He
'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_view/helpers/tag_helper.rb:6:in
`<module:Ac
'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_view/helpers/tag_helper.rb:4:in
`<top (requ
ired)>'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_view/helpers/javascript_helper.rb:1:in
`req
uire'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_view/helpers/javascript_helper.rb:1:in
`<to
p (required)>'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_view/helpers/url_helper.rb:1:in
`require'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_view/helpers/url_helper.rb:1:in
`<top (requ
ired)>'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_view/helpers/asset_tag_helper.rb:3:in
`requ
ire'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/actionpack-3.0.3/lib/action_view/helpers/asset_tag_helper.rb:3:in
`<top
(required)>'
from C:/refactored/app/collector.rb:2:in `require'
from C:/refactored/app/collector.rb:2:in `<top (required)>'
from C:/refactored/app/collector_specs.rb:8:in `require'
from C:/refactored/app/collector_specs.rb:8:in `<top
(required)>'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in
`load'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in
`block in load_
spec_files'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in
`map'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in
`load_spec_file
s'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/rspec-core-2.4.0/lib/rspec/core/command_line.rb:18:in
`run'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/rspec-core-2.4.0/lib/rspec/core/runner.rb:55:in
`run_in_process'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/rspec-core-2.4.0/lib/rspec/core/runner.rb:46:in
`run'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/rspec-core-2.4.0/lib/rspec/core/runner.rb:10:in
`block in autorun'
********************************************************************
Does anyone know what is causing this error and how I can eliminate it?
The code referencing actionview modules is:
********************************************************************
require 'rubygems'
require 'action_view/helpers/asset_tag_helper'
require 'action_view/helpers/tag_helper'
require 'erb'
class Collector
include ActionView::Helpers::TagHelper
include ActionView::Helpers::AssetTagHelper
def self.foo
"foo"
end
def display(profile, size, html = {}, options = {}, link = true)
... unrelated code here ...
return image_tag("default.png")
end
end
********************************************************************
I am just starting out with ruby programming and have a lot to learn, so
any and all help and input is most appreciated.
--
Posted via http://www.ruby-forum.com/\.