Error running Heckle? `current_code': undefine

2020-02-26 10:47发布

问题:

I'm trying to run Heckle, and I keep getting an error:

> spec spec/controllers/my_controller_spec.rb --heckle MyController

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! exception= has a thick skin. There's nothing to heckle.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

(Runs through several mutations...)

/home/developer/.gem/ruby/1.8/gems/heckle-1.4.3/lib/heckle.rb:603:in `current_code': undefined method `translate' for Ruby2Ruby:Class (NoMethodError)

Any thoughts?

EDIT: I forgot the gem versions:

heckle (1.4.3)
ruby2ruby (1.2.3)
rails (2.3.2, 2.2.2)
rspec (1.2.6)
rspec-rails(1.2.6, 1.1.12)

回答1:

Install ruby2ruby 1.2.2. There seems to be an API change in 1.2.3.

Just generated the docs for 1.2.2 and 1.2.3

Looks like the class method 'translate' has been totally removed, although the docs don't reflect this