[rspec-devel] [ rspec-Bugs-7754 ] Command-R fails to run spec in TextMate

noreply at rubyforge.org noreply at rubyforge.org
Fri Jan 19 09:42:00 EST 2007


Bugs item #7754, was opened at 2007-01-11 07:19
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7754&group_id=797

Category: RSpec.tmbundle
Group: None
Status: Closed
Resolution: Accepted
Priority: 3
Submitted By: Brian Yamabe (byamabe)
Assigned to: Aslak Hellesøy (aslak_hellesoy)
Summary: Command-R fails to run spec in TextMate

Initial Comment:
When trying to run a spec from TextMate using command-r, I get:
/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:1:in `require': No such file to load -- rubygems (LoadError) from /Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:1 from /tmp/temp_textmate.EMYXc6:3:in `require' from /tmp/temp_textmate.EMYXc6:3

TM_RUBY is set properly (/opt/local/bin/ruby)

Tried the following at Aslak suggestion and it ran without errors.

1) Create a file called foo.rb
2) Add one line to it: require 'rubygems'
3) Open it in TextMate
4) Run it from TextMate (Cmd-R - Run)

----------------------------------------------------------------------

>Comment By: Brian Yamabe (byamabe)
Date: 2007-01-19 06:42

Message:
This helped, but now I get:

/opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/expectations/
sugar.rb:13:in `call': undefined method `controller_name' for # 
(NoMethodError) from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/
spec/expectations/sugar.rb:13:in `_method_missing' from /opt/local/lib/
ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/expectations/sugar.rb:9:in 
`method_missing' from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/
lib/spec/runner/context_eval.rb:46:in `method_missing' from ./
home_controller_spec.rb:5 from /opt/local/lib/ruby/gems/1.8/gems/
rspec-0.7.5/lib/spec/runner/context.rb:14:in `class_eval' from /opt/local/
lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/runner/context.rb:14:in 
`initialize' from /Users/byamabe/joyfulgames/work/trivia/config/../vendor/
plugins/rspec_on_rails/lib/spec/rails/context_factory.rb:18:in `new' from /
Users/byamabe/joyfulgames/work/trivia/config/../vendor/plugins/
rspec_on_rails/lib/spec/rails/context_factory.rb:18:in `create' from /Users/
byamabe/joyfulgames/work/trivia/vendor/plugins/rspec_on_rails/lib/spec/
rails/extensions/kernel.rb:4:in `context' from ./home_controller_spec.rb:4 
from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/runner/
command_line.rb:21:in `load' from /opt/local/lib/ruby/gems/1.8/gems/
rspec-0.7.5/lib/spec/runner/command_line.rb:21:in `run' from /opt/local/
lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/runner/command_line.rb:
15:in `each' from /opt/local/lib/ruby/gems/1.8/gems/rspec-0.7.5/lib/spec/
runner/command_line.rb:15:in `run' from /Library/Application Support/
TextMate/Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:31:in `run' 
from /Library/Application Support/TextMate/Bundles/RSpec.tmbundle/
Support/lib/spec_mate.rb:9:in `run_file' from /tmp/temp_textmate.6oaSVX:4

----------------------------------------------------------------------

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-01-19 01:44

Message:
Instructions added to docs in r1401

----------------------------------------------------------------------

Comment By: Luke Redpath (lukeredpath)
Date: 2007-01-11 07:29

Message:
I had this problem too - the reason is that files with a shebang line (like the 
RSpec command in textmate) do not run the Textmate init script that picks up 
the system path it needs to find rubygems.

To fix this problem, you also need to add the path to your ~/.MacOSX/
environment.plist file - here is mine:

<key>PATH</key>
<string>/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/Users/luke/
bin:/opt/local/bin:/usr/local/mysql/bin</string>

Modify as necessary - you'll need to log out and log back in again for this to 
take effect.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7754&group_id=797


More information about the rspec-devel mailing list