Rspec Textmate bundle errors

Hello all,

Having a problem with the Rspec textmate bundle and having quizzed
the guys in #textmate to no success about the errors, I’ve been
suggested to try you guys!

When I run the “Run Behaviour Description” command, I get the
following errors:

/Users/alastair/Library/Application Support/TextMate/Bundles/
RSpec.tmbundle/Support/lib/spec/…/spec/mate/runner.rb:34:in run': undefined method parse’ for Spec::runner::OptionParser:Class
(NoMethodError) from /Users/alastair/Library/Application Support/
TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/…/spec/mate/
runner.rb:33:in chdir' from /Users/alastair/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/ runner.rb:33:in run’ from /Users/alastair/Library/Application
Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/…/spec/mate/
runner.rb:12:in `run_file’ from /tmp/temp_textmate.YtFHjY:4

Would anyone have any ideas what the problem might be? All the paths
are correct as I can run ruby scripts from within textmate.

Cheers in advance!

Alastair


Alastair M.
Freelance web design, development and consultancy

t. 07983 983945
e. [email protected]
w. http://www.kozmo.co.uk
skype. alastair_kozmo

On 10/10/07, Alastair M. [email protected] wrote:

RSpec.tmbundle/Support/lib/spec/…/spec/mate/runner.rb:34:in `run’:
are correct as I can run ruby scripts from within textmate.
We’ve been making some changes in trunk, so if you’re using trunk make
sure that you have the same revision of rspec and the textmate bundle.
Seems like your textmate bundle is newer than your version of rspec.

On 10/10/07, Alastair M. [email protected] wrote:

from trunk and built a new rspec gem (rspec-1.0.9 r2715) and
Application Support/TextMate/Pristine Copy/Bundles/RSpec.tmbundle/
Support/lib/spec/mate.rb:4 from /tmp/temp_textmate.jLcyE7:3:in
`require’ from /tmp/temp_textmate.jLcyE7:3

Any ideas what might be up with this? At least there are less errors!

That line looks like this:

rspec_rails_plugin =
File.join(ENV[‘TM_PROJECT_DIRECTORY’],‘vendor’,‘plugins’,‘rspec’,‘lib’)

I’m guessing that ENV[‘TM_PROJECT_DIRECTORY’] is coming up nil, so I’m
guessing that you’re opening a single file, yes? Try opening up a
directory with your file in it and running it from a project window.

On 11 Oct 2007, at 01:03, David C. wrote:

We’ve been making some changes in trunk, so if you’re using trunk make
sure that you have the same revision of rspec and the textmate bundle.
Seems like your textmate bundle is newer than your version of rspec.

Hi David,

Thanks for your reply. I’ve uninstalled my rspec gem, checked out
from trunk and built a new rspec gem (rspec-1.0.9 r2715) and
installed this. I noticed that an rspec bundle was also downloaded
from trunk and so I removed the rspec bundle from textmate and
installed this one.

Opening a simple spec file and running the run behaviour description,
I get a new error:

/Users/alastair/Library/Application Support/TextMate/Pristine Copy/
Bundles/RSpec.tmbundle/Support/lib/spec/mate.rb:4:in join': can't convert nil into String (TypeError) from /Users/alastair/Library/ Application Support/TextMate/Pristine Copy/Bundles/RSpec.tmbundle/ Support/lib/spec/mate.rb:4 from /tmp/temp_textmate.jLcyE7:3:inrequire’ from /tmp/temp_textmate.jLcyE7:3

Any ideas what might be up with this? At least there are less errors!

Thanks in advance,

Alastair

On Oct 10, 2007, at 9:20 PM, David C. wrote:

Hi David,
/Users/alastair/Library/Application Support/TextMate/Pristine Copy/
rspec_rails_plugin =
File.join(ENV
[‘TM_PROJECT_DIRECTORY’],‘vendor’,‘plugins’,‘rspec’,‘lib’)

I’m guessing that ENV[‘TM_PROJECT_DIRECTORY’] is coming up nil, so I’m
guessing that you’re opening a single file, yes? Try opening up a
directory with your file in it and running it from a project window.

I can also confirm issues with the RSpec TextMate bundle as of this
week. The error I’m getting is different though:

RubyMate r6354 running Ruby r1.8.6 (/opt/local/bin/ruby)

workspaces_controller_spec.rb

/Applications/TextMate.app/Contents/SharedSupport/Support/lib/
builder.rb:86:in blank_slate_method_added': stack level too deep (SystemStackError) from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/ builder.rb:86:inblank_slate_method_added’
from /opt/local/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/
blankslate.rb:84:in method_added' from /opt/local/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/ blankslate.rb:104 from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 27:ingem_original_require’
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in require' from /opt/local/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/ blankslate.rb:11 from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 32:ingem_original_require’
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
32:in require' ... 17 levels... from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 27:inrequire’
from /Users/brandon/projects/dealerflow/spec/controllers/…/
spec_helper.rb:5
from /Users/brandon/projects/dealerflow/spec/controllers/
workspaces_controller_spec.rb:1:in require' from /Users/brandon/projects/dealerflow/spec/controllers/ workspaces_controller_spec.rb:1 /Applications/TextMate.app/Contents/SharedSupport/Support/lib/ builder.rb:86:inblank_slate_method_added’: stack level too deep
(SystemStackError)
from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/
builder.rb:86:in blank_slate_method_added' from /opt/local/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/ blankslate.rb:84:inmethod_added’
from /opt/local/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/
blankslate.rb:104
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in gem_original_require' from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 27:inrequire’
from /opt/local/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/
blankslate.rb:11
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
32:in gem_original_require' from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 32:inrequire’
… 17 levels…
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in require' from /Users/brandon/projects/dealerflow/spec/controllers/../ spec_helper.rb:5 from /Users/brandon/projects/dealerflow/spec/controllers/ workspaces_controller_spec.rb:1:inrequire’
from /Users/brandon/projects/dealerflow/spec/controllers/
workspaces_controller_spec.rb:1

I am using rspec trunk and have updated the textmate bundle to the
latest revision. I haven’t investigated this, but I know edge rails
is now bundling it’s own version of Builder, in which it renamed the
BlankSlate class to BasicObject. Given the stack trace, I’m guessing
that might have something to do with it.

Brandon

David C. wrote:

On 10/11/07, Brandon K. [email protected] wrote:

bundle.
Opening a simple spec file and running the run behaviour description,

I can also confirm issues with the RSpec TextMate bundle as of this
from /opt/local/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/
32:in gem_original_require' workspaces_controller_spec.rb:1 27:in gem_original_require’
27:in `require’
latest revision. I haven’t investigated this, but I know edge rails
is now bundling it’s own version of Builder, in which it renamed the
BlankSlate class to BasicObject. Given the stack trace, I’m guessing
that might have something to do with it.

Also - I don’t see ‘RSpec’ or ‘rspec’ anywhere in that stack trace.
It’s all SharedSupport, rails and the app.

Unfortunately, I’m not able to duplicate this. Anybody else having a
similar problem?

I’m having the same problem:

/Users/davidcurrin/Library/Application Support/TextMate/Pristine
Copy/Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:2:in require': No such file to load -- rubygems (LoadError) from /Users/davidcurrin/Library/Application Support/TextMate/Pristine Copy/Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:2 from /tmp/temp_textmate.OqOjcI:3:in require’ from
/tmp/temp_textmate.OqOjcI:3

On 10/11/07, Brandon K. [email protected] wrote:

bundle.
Opening a simple spec file and running the run behaviour description,

I can also confirm issues with the RSpec TextMate bundle as of this
from /opt/local/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/
32:in gem_original_require' workspaces_controller_spec.rb:1 27:in gem_original_require’
27:in `require’
latest revision. I haven’t investigated this, but I know edge rails
is now bundling it’s own version of Builder, in which it renamed the
BlankSlate class to BasicObject. Given the stack trace, I’m guessing
that might have something to do with it.

Also - I don’t see ‘RSpec’ or ‘rspec’ anywhere in that stack trace.
It’s all SharedSupport, rails and the app.

Unfortunately, I’m not able to duplicate this. Anybody else having a
similar problem?

Hey David,

This is what worked for me (just did this last night):

  1. I removed everything rspec to have a clean slate:
  • gem uninstall rspec
  • rm -fr vendor/plugins/rpec
  • rm -fr vendor/plugins/rpec_on_rails
  • using BundleEditor, removed RSpec Bundle
  1. I then installed the rspec plugins according to the website:
  • script/plugin install svn://…/tags/CURRENT/rspec
  • script/plugin install svn://…/tags/CURRENT/rspec_on_rails
  • script/generate spec
  • i then created a model rspec and ran ‘rake spec’
  1. I then installed the RSpec Bundle with the following SVN URL:
  • svn co …/tags/CURRENT/RSpec.tmbundle
  • Reloaded the Bundles
  • ran the same model spec from within TM.

You’ll need to verify the instructions and get the correct svn URLs
since
I’m doing this from memory.

HTH

Mel

I am having the same problem with the lastest version 4.2.3 (and most of
the other 4.2’s on windows) version 3 installs fine.

Mel R. wrote:

This is what worked for me (just did this last night):

  1. I removed everything rspec to have a clean slate:
  • gem uninstall rspec
  • rm -fr vendor/plugins/rpec
  • rm -fr vendor/plugins/rpec_on_rails
  • using BundleEditor, removed RSpec Bundle
  1. I then installed the rspec plugins according to the website:
  • script/plugin install svn://…/tags/CURRENT/rspec
  • script/plugin install svn://…/tags/CURRENT/rspec_on_rails
  • script/generate spec
  • i then created a model rspec and ran ‘rake spec’
  1. I then installed the RSpec Bundle with the following SVN URL:
  • svn co …/tags/CURRENT/RSpec.tmbundle
  • Reloaded the Bundles
  • ran the same model spec from within TM.

Digging up an old thread here.

I’ve done the above (and am at r3317). But getting a strange error when
I run the example with the TextMate bundle (from within a project
directory in TM):

System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require': no such file to load -- image_science (MissingSourceFile) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:inrequire’ from
/myapp/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:496:in
require' from /myapp/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:innew_constants_in’ from
/myapp/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:496:in
require' from /myapp/app/models/custom.rb:1 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:ingem_original_require’ from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
require' from /myapp/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:inrequire’ … 14 levels… from /Users/user/Library/Application
Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/…/spec/mate/runner.rb:31:in
chdir' from /Users/user/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/runner.rb:31:inrun’ from /Users/user/Library/Application
Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/…/spec/mate/runner.rb:14:in
`run_file’ from /tmp/temp_textmate.eFFxZt:4

The line generating that error is a simple: require ‘image_science’.
Doing gem which image_science returns the correct value and running
the spec from the command line works fine too.

Strange?
Dave