pry include gem to debug
% irb -Ilib -rhola
irb(main):001:0> Hola.hi("english")
=> "hello world"
irb(main):002:0> Hola.hi("spanish")
=> "hola mundo"
-I指把lib目录加入load_path,-r表示require这个文件
vagrant@precise64:~/data$ pry -Iinclude -r1
[1] pry(main)> Hold.test
lala
=> nil
[2] pry(main)> exit
vagrant@precise64:~/data$ ls -al include/
total 13
drwxrwxrwx 1 vagrant vagrant 0 Jun 15 14:42 .
drwxrwxrwx 1 vagrant vagrant 12288 Jun 15 14:41 ..
-rwxrwxrwx 1 vagrant vagrant 106 Jun 15 14:43 1.rb
class Hold
def self.test
A.lala
end
end
class Hold::A
def self.lala
puts "lala"
end
end
rubygems/specification.rb:2158:in `method_missing': undefined method `this' for #<Gem::Specification
升级rubygems
gem update --system
Author And Source
この問題について(pry include gem to debug), 我々は、より多くの情報をここで見つけました https://qiita.com/chen7897499/items/ca11199b1cd4451a4c61著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .