Installation Trouble

Hey all,

I’m new to BDD and rspec, but I am very intrigued.

I tried installing rspec and rspec_on_rails into my Rails app, but I am
having some trouble.

I chose to install both as plugins, as the documentation suggests. I
checked out the CURRENT tag from svn, and copied the rspec and
rspec_on_rails directories into my app’s vendor/plugins directory. Then
I ran script/generate rspec, which created its files. Everything seemed
ok, so I wrote up a little model spec, put it in spec/models, and ran
rake spec. I did put require “File.dirname(FILE) +
‘/…/spec_helper.rb’” at the top of my spec file.

The message and call stack I get back is:

==
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in
load_missing_constant': uninitialized constant Spec::Rails (NameError) from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:inconst_missing’
from
C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb:14

   from

c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
from
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in
require' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:innew_constants_in’
from
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in
`require’
from
C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions.rb:5

    ... 18 levels...
   from

C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:13:in
load_files' from C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/options.rb:83:inrun_examples’
from
C:/src/Aptana/ir/vendor/plugins/rspec/lib/spec/runner/command_line.rb:19:in
`run’
from C:/src/Aptana/ir/vendor/plugins/rspec/bin/spec:3
rake aborted!
Command ruby -I"C:/src/Aptana/ir/vendor/plugins/rspec/lib"
“C:/src/Aptana/ir/ven
dor/plugins/rspec/bin/spec” “spec/models/image_spec.rb” --options
“C:/src/Aptana
/ir/config/…/spec/spec.opts” failed

As you can see, I am running Windows.

Does anyone have any idea what I am doing wrong?

Thanks,
Ben

On Dec 19, 2007 7:31 AM, Ben G. [email protected]
wrote:

checked out the CURRENT tag from svn, and copied the rspec and
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in
from
… 18 levels…
rake aborted!
Command ruby -I"C:/src/Aptana/ir/vendor/plugins/rspec/lib"
“C:/src/Aptana/ir/ven
dor/plugins/rspec/bin/spec” “spec/models/image_spec.rb” --options
“C:/src/Aptana
/ir/config/…/spec/spec.opts” failed

As you can see, I am running Windows.

Does anyone have any idea what I am doing wrong?

Are you running this from Aptana or from the command line?

David C. wrote:

checked out the CURRENT tag from svn, and copied the rspec and
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in
from
… 18 levels…
rake aborted!

Are you running this from Aptana or from the command line?

Thanks for the quick reply.

I am running from the command line, in my RAILS_ROOT.

On Dec 19, 2007 8:46 AM, Ben G. [email protected]
wrote:

C:/src/Aptana/ir/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb:14
from
`run_examples’

I am running from the command line, in my RAILS_ROOT.

And you’ve got the following near the top of spec/spec_helper.rb?

require ‘spec’
require ‘spec/rails’

Also, could you post the spec if possible?

  • Chad

Chad H. wrote:

require ‘spec/rails’


rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

My spec/spec_helper.rb does contain those lines. I did not modify it
after it was generated.

The one spec I have is spec/models/image_spec.rb. The contents are:

require File.dirname(FILE) + ‘/…/spec_helper.rb’

describe Image, “brand new” do
before(:each) do
@image = Image.new
end

it “should be in the review bucket” do
@image.bucket.should equal(Bucket.review)
end

end

Thanks,
Ben