Are you sure? It exists in 1.9.2-p0 and 1.9.2-p136 for me.
The gem requires fiddle if version > 1.9, and I have tried ruby 1.9.2p136 and 1.9.2p180. Is there a fiddle gem hiding out there somewhere?
require': no such file to load -- fiddle (LoadError)
- 点赞 评论 复制链接分享
Perhaps I am misunderstanding how I am supposed to have fiddle. Is it included with ruby or am I missing a gem? I did notice that the rbtrace gem installed ffi, but that doesn't seem to contain fiddle either. I'm running linux and "locate fiddle" gives me no love.
Thanks for any help, I'm excited to try rbtrace.点赞 评论 复制链接分享
~/code/rbtrace (master*) % rvm use 1.9.2-p0 Using .rvm/gems/ruby-1.9.2-p0 ~/code/rbtrace (master*) % gem which fiddle .rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/fiddle.rb ~/code/rbtrace (master*) % rvm use 1.9.2-p136 Using .rvm/gems/ruby-1.9.2-p136 ~/code/rbtrace (master*) % gem which fiddle .rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/fiddle.rb点赞 评论 复制链接分享
Yes, it is included with 1.9.点赞 评论 复制链接分享
What linux are you using, and how did you install 1.9?点赞 评论 复制链接分享
Thanks for the help.
I found the library in the ruby source in etc/fiddle, is there something I need to do to install the extension? I just installed ruby 1.9.2p180 from source (I don't use RVM).
Thanks, Evan点赞 评论 复制链接分享
I have no idea. I would imagine it just builds by default, but maybe it skips it if you don't have a required library.
I would recommend you just use RVM instead.
Alternatively, you can try this patch:
diff --git a/bin/rbtrace b/bin/rbtrace index cccaff2..abf70a4 100755 --- a/bin/rbtrace +++ b/bin/rbtrace @@ -43,7 +43,7 @@ module MsgQ end def self.recv_cmd(q, block=true) - MsgQ.enable_interrupt if RUBY_VERSION > '1.9' + MsgQ.enable_interrupt msg = EventMsg.new ret = MsgQ.msgrcv(q, msg, BUF_SIZE, 0, block ? 0 : IPC_NOWAIT) @@ -57,22 +57,26 @@ module MsgQ msg[:buf].to_ptr.read_string_length(BUF_SIZE) ensure - MsgQ.disable_interrupt if RUBY_VERSION > '1.9' + MsgQ.disable_interrupt end end if RUBY_VERSION > '1.9' - require 'fiddle' + begin + require 'fiddle' - handle = DL::Handle.new - = Fiddle::Function.new(handle['rb_enable_interrupt'], , DL::TYPE_VOID) - = Fiddle::Function.new(handle['rb_disable_interrupt'], , DL::TYPE_VOID) + handle = DL::Handle.new + = Fiddle::Function.new(handle['rb_enable_interrupt'], , DL::TYPE_VOID) + = Fiddle::Function.new(handle['rb_disable_interrupt'], , DL::TYPE_VOID) + rescue LoadError + STDERR.puts "*** unable to require('fiddle'). ctrl+c will not work, use `killall rbtrace` instead" + end def self.enable_interrupt - .call + .call if end def self.disable_interrupt - .call + .call if end end点赞 评论 复制链接分享
I'm using Ubuntu 10, and installed with the following
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p180.tar.gz tar xzvf ruby-1.9.2-p180.tar.gz cd ruby-1.9.2-p180 ./configure make sudo make install点赞 评论 复制链接分享
It is likely that fiddle just doesn't get built when libffi is not available on the system. Try install libffi and compiling ruby again.点赞 评论 复制链接分享
I found a way to get rid of the fiddle dependency altogether. Give me a few mins to push this patch.点赞 评论 复制链接分享
Here's the fix: 5cc654d6be705831fd4992d4cbd2ccc6410be251. I pushed a 0.3.8 gem that should be available shortly. Let me know if it works.点赞 评论 复制链接分享
Works great, thanks! Time to play :)点赞 评论 复制链接分享