在netbeans6.7中使用rspec1.2.7

将开发工具换成了netbeans6.7,rspec的版本,也变成了1.2.7,使用的过程中,发现一直无法跑起来,幸好netbeans forum上面已经有人发现并解决了:
[quote]
Just thought I'd let people know that rpsec-1.2.7 seems to have changed the way you get the line number from a spec file.

As a result, netbeans 6.7 won't run specs if you have 1.2.7 installed. The fix I've implemented (ymmv) is to change nb_rspec_mediator.rb. This lives in /usr/local/netbeans-6.7/ruby2/nb_rspec_mediator.rb on my linux machine.

Line 204 defines NbSpecParser, but it extends a class that no longer exists.

Change that line to:

class NbSpecParser < Spec::Runner::LineNumberQuery

and all should be well again :). You now won't be able to run with rspec < 1.2.7, so if that's required, you might need some conditional logic around the class definition.
Anyway, I hope this helps someone.
[/quote]
解决也非常简单:将/netbeans-6.7/ruby2/nb_rspec_mediator.rb中的第204行换成
class NbSpecParser < Spec::Runner::LineNumberQuery
下面就按照rspec wiki上面的步骤操作:

ruby script/plugin install git://github.com/dchelimsky/rspec.git -r 'refs/tags/1.2.7'
ruby script/plugin install git://github.com/dchelimsky/rspec-rails.git -r 'refs/tags/1.2.7.1'
ruby script/generate rspec


接下来就可以在netbeans下使用rspec相应的generator了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值