Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

"Failed to load readline_line_buffer extension" #3

Closed
timcharper opened this Issue · 17 comments

2 participants

Tim Harper Gabriel Horner
Tim Harper

Bond looks neat. I'd like to try it out with emacs.

This is what I get when I try to load Bond:

gem install bond
Successfully installed bond-0.2.1
1 gem installed
timcharper@timcharper:~ $ irb
.irbrc completed
irb(main):001:0> require 'bond'
=> true
irb(main):006:0> Bond.start
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completion.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/activerecord.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/array.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/bond.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/hash.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/kernel.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/module.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/object.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/struct.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline

It happens with both ruby 1.8.6 (system), 1.8.7 (rvm). It also shows a variant of this error message (as completion text) in the inf-ruby-bond.el emacs integration extension.

Tim Harper

It works on ruby 1.9.2 though!

Gabriel Horner
Owner

For Ruby <= 1.9.1, Bond depends on a Readline C extension. It seems that your 1.8.x gems aren't building that C extension. Here's what you should see when it builds and installs successfully:

  $ gem install bond
  Building native extensions.  This could take a while...
  Successfully installed bond-0.2.1

What OS are you using? What happens when you do a local install of bond? :

$ git clone git://github.com/cldwalker/bond.git
$ cd bond
$ sudo rake install
Tim Harper

I am quite certain I'm using readline, as I much prefer it over libedit and specifically have built it (even wrote a blog post about how to recompile readline for ruby if its linked against libedit.

Anyways... I'll give it another run and post a video

Gabriel Horner
Owner

By readline c extension I meant bond's own readline c extension. Judging from your install messages, it seems your install doesn't build bond's readline c extension. If you had, you wouldn't be having this problem for 1.8.x. Have you tried a local install?

Tim Harper
timcharper@timcharper:~ $ gem install bond
Building native extensions.  This could take a while...
Successfully installed bond-0.2.1
1 gem installed
timcharper@timcharper:~ $ irb
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completion.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/activerecord.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/array.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/bond.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/hash.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/kernel.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/module.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/object.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/struct.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
.irbrc completed
irb(main):002:0> Readline::VERSION
=> "6.0"

Here's the dump for readline.bundle, it shows that I am in fact using Readline 6.0

timcharper@timcharper:~/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/i686-darwin9.8.0 $ otool -l readline.bundle 
readline.bundle:
Load command 0
      cmd LC_SEGMENT
  cmdsize 192
  segname __TEXT
   vmaddr 0x00000000
   vmsize 0x00003000
  fileoff 0
 filesize 12288
  maxprot 0x00000007
 initprot 0x00000005
   nsects 2
    flags 0x0
Section
  sectname __text
   segname __TEXT
      addr 0x000012d0
      size 0x00001a7d
    offset 4816
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __cstring
   segname __TEXT
      addr 0x00002d50
      size 0x000002a1
    offset 11600
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000002
 reserved1 0
 reserved2 0
Load command 1
      cmd LC_SEGMENT
  cmdsize 260
  segname __DATA
   vmaddr 0x00003000
   vmsize 0x00001000
  fileoff 12288
 filesize 4096
  maxprot 0x00000007
 initprot 0x00000003
   nsects 3
    flags 0x0
Section
  sectname __data
   segname __DATA
      addr 0x00003000
      size 0x00000004
    offset 12288
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __dyld
   segname __DATA
      addr 0x00003004
      size 0x00000008
    offset 12292
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __bss
   segname __DATA
      addr 0x0000300c
      size 0x00000020
    offset 0
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000001
 reserved1 0
 reserved2 0
Load command 2
      cmd LC_SEGMENT
  cmdsize 192
  segname __IMPORT
   vmaddr 0x00004000
   vmsize 0x00001000
  fileoff 16384
 filesize 4096
  maxprot 0x00000007
 initprot 0x00000007
   nsects 2
    flags 0x0
Section
  sectname __pointers
   segname __IMPORT
      addr 0x00004000
      size 0x00000068
    offset 16384
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000006
 reserved1 0 (index into indirect symbol table)
 reserved2 0
Section
  sectname __jump_table
   segname __IMPORT
      addr 0x00004080
      size 0x0000012c
    offset 16512
     align 2^6 (64)
    reloff 0
    nreloc 0
     flags 0x04000008
 reserved1 26 (index into indirect symbol table)
 reserved2 5 (size of stubs)
Load command 3
      cmd LC_SEGMENT
  cmdsize 56
  segname __LINKEDIT
   vmaddr 0x00005000
   vmsize 0x00002000
  fileoff 20480
 filesize 7992
  maxprot 0x00000007
 initprot 0x00000001
   nsects 0
    flags 0x0
Load command 4
     cmd LC_UUID
 cmdsize 24
   uuid 0xd4 0x1e 0xb2 0x32 0xc5 0x2a 0x22 0x95
        0xd9 0x6b 0xc5 0xfb 0x3f 0xd2 0xff 0x37
Load command 5
     cmd LC_SYMTAB
 cmdsize 24
  symoff 20488
   nsyms 288
  stroff 24288
 strsize 4184
Load command 6
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 205
     iextdefsym 205
     nextdefsym 1
      iundefsym 206
      nundefsym 82
         tocoff 0
           ntoc 0
      modtaboff 0
        nmodtab 0
   extrefsymoff 0
    nextrefsyms 0
 indirectsymoff 23944
  nindirectsyms 86
      extreloff 0
        nextrel 0
      locreloff 20480
        nlocrel 1
Load command 7
          cmd LC_LOAD_DYLIB
      cmdsize 92
         name /usr/local/homebrew/Cellar/readline/6.0/lib/libreadline.6.0.dylib (offset 24)
   time stamp 2 Wed Dec 31 17:00:02 1969
      current version 6.0.0
compatibility version 6.0.0
Load command 8
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libncurses.5.4.dylib (offset 24)
   time stamp 2 Wed Dec 31 17:00:02 1969
      current version 5.4.0
compatibility version 5.4.0
Load command 9
          cmd LC_LOAD_DYLIB
      cmdsize 52
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Wed Dec 31 17:00:02 1969
      current version 111.1.5
compatibility version 1.0.0
Load command 10
          cmd LC_LOAD_DYLIB
      cmdsize 52
         name /usr/lib/libobjc.A.dylib (offset 24)
   time stamp 2 Wed Dec 31 17:00:02 1969
      current version 227.0.0
compatibility version 1.0.0
Load command 11
          cmd LC_LOAD_DYLIB
      cmdsize 52
         name /usr/lib/libgcc_s.1.dylib (offset 24)
   time stamp 2 Wed Dec 31 17:00:02 1969
      current version 1.0.0
compatibility version 1.0.0

Here's the dump of the compiled readline_line_buffer.bundle:
timcharper@timcharper:~/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/gems/1.8/gems/bond-0.2.1/ext/readline_line_buffer $ otool -l readline_line_buffer.bundle
readline_line_buffer.bundle:
Load command 0
cmd LC_SEGMENT
cmdsize 124
segname __TEXT
vmaddr 0x00000000
vmsize 0x00001000
fileoff 0
filesize 4096
maxprot 0x00000007
initprot 0x00000005
nsects 1
flags 0x0
Section
sectname __text
segname __TEXT
addr 0x00000fdc
size 0x00000022
offset 4060
align 2^2 (4)
reloff 0
nreloc 0
flags 0x80000400
reserved1 0
reserved2 0
Load command 1
cmd LC_SEGMENT
cmdsize 192
segname __DATA
vmaddr 0x00001000
vmsize 0x00001000
fileoff 4096
filesize 4096
maxprot 0x00000007
initprot 0x00000003
nsects 2
flags 0x0
Section
sectname __data
segname __DATA
addr 0x00001000
size 0x00000004
offset 4096
align 2^2 (4)
reloff 0
nreloc 0
flags 0x00000000
reserved1 0
reserved2 0
Section
sectname __dyld
segname __DATA
addr 0x00001004
size 0x00000008
offset 4100
align 2^2 (4)
reloff 0
nreloc 0
flags 0x00000000
reserved1 0
reserved2 0
Load command 2
cmd LC_SEGMENT
cmdsize 56
segname __LINKEDIT
vmaddr 0x00002000
vmsize 0x00001000
fileoff 8192
filesize 140
maxprot 0x00000007
initprot 0x00000001
nsects 0
flags 0x0
Load command 3
cmd LC_UUID
cmdsize 24
uuid 0x38 0xc2 0x92 0x1d 0x9f 0x37 0xae 0x5b
0x16 0x2e 0x9e 0xfa 0x68 0x47 0x56 0xd3
Load command 4
cmd LC_SYMTAB
cmdsize 24
symoff 8200
nsyms 4
stroff 8248
strsize 84
Load command 5
cmd LC_DYSYMTAB
cmdsize 80
ilocalsym 0
nlocalsym 4
iextdefsym 4
nextdefsym 0
iundefsym 4
nundefsym 0
tocoff 0
ntoc 0
modtaboff 0
nmodtab 0
extrefsymoff 0
nextrefsyms 0
indirectsymoff 8248
nindirectsyms 0
extreloff 0
nextrel 0
locreloff 8192
nlocrel 1
Load command 6
cmd LC_LOAD_DYLIB
cmdsize 52
name /usr/lib/libSystem.B.dylib (offset 24)
time stamp 2 Wed Dec 31 17:00:02 1969
current version 111.1.5
compatibility version 1.0.0
Load command 7
cmd LC_LOAD_DYLIB
cmdsize 52
name /usr/lib/libobjc.A.dylib (offset 24)
time stamp 2 Wed Dec 31 17:00:02 1969
current version 227.0.0
compatibility version 1.0.0
Load command 8
cmd LC_LOAD_DYLIB
cmdsize 52
name /usr/lib/libgcc_s.1.dylib (offset 24)
time stamp 2 Wed Dec 31 17:00:02 1969
current version 1.0.0
compatibility version 1.0.0

Worth noting: I did have to recompile my readline using the --with-readline=/usr/local/homebrew/Cellar/readline/6.0 flag. Is there some way to provide that option to bond?

I don't know why it worked with ruby 1.9.2, I recompiled and reinstalled readline.bundle the same way (after rvm went ahead and compiled ruby)

I'll try a native local install

Tim Harper

Oh, I know I it worked on Ruby 192, because it doesn't require the read line extension, as you made a point of earlier :-) doh.

Tim Harper

local install results:

timcharper@timcharper:~/projects/bond master$ rake install
(in /Users/timcharper/projects/bond)
gem build gemspec
  Successfully built RubyGem
  Name: bond
  Version: 0.2.1
  File: bond-0.2.1.gem
gem install pkg/bond-0.2.1
Building native extensions.  This could take a while...
Successfully installed bond-0.2.1
1 gem installed
timcharper@timcharper:~/projects/bond master$ irb
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completion.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/activerecord.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/array.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/bond.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/hash.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/kernel.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/module.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/object.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/struct.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
.irbrc completed
irb(main):001:0> 
Gabriel Horner
Owner

The "Failed to load readline_line_buffer extension" error occurs when require 'readline_line_buffer' fails. I saw in one of your shell sessions that readline_line_buffer.bundle is located in ~/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/gems/1.8/gems/bond-0.2.1/ext/readline_line_buffer. Copying it over ~/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/gems/1.8/gems/bond-0.2.1/lib/ should do the trick.

I'm not sure why it ended up in ext/. Did you build it by hand? Perhaps an rvm or rubygems bug? The extconf.rb bond uses is pretty simple...

Tim Harper

It looks like it is in lib:

/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/CHANGELOG.rdoc
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/ext
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/ext/readline_line_buffer
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/ext/readline_line_buffer/extconf.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/ext/readline_line_buffer/Makefile
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/ext/readline_line_buffer/mkmf.log
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/ext/readline_line_buffer/readline_line_buffer.bundle
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/ext/readline_line_buffer/readline_line_buffer.c
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/ext/readline_line_buffer/readline_line_buffer.o
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/gemspec
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/agent.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completion.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/activerecord.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/array.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/bond.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/hash.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/kernel.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/module.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/object.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/struct.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/input.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/m.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/mission.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/missions
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/missions/anywhere_mission.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/missions/default_mission.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/missions/method_mission.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/missions/object_mission.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/missions/operator_method_mission.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/rawline.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/rc.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/readline.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/search.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/version.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/yard.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/readline_line_buffer.bundle
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/LICENSE.txt
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/Rakefile
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/README.rdoc
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/agent_test.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/anywhere_mission_test.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/bacon_extensions.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/bond_test.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/completion_test.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/completions_test.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/method_mission_test.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/mission_test.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/object_mission_test.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/operator_method_mission_test.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/search_test.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/test_helper.rb
/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/test/yard_test.rb

Both installing it via rake install and gem install bond yield the same directory structure. (lib/readline_line_buffer.bundle exists with both).

Tim Harper

This is interesting, however:

timcharper@timcharper:~/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1 $ irb
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completion.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/activerecord.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/array.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/bond.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/hash.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/kernel.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/module.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/object.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
Bond Error: Failed to load readline_line_buffer extension. Falling back on RubyInline extension.
Bond Error: Completion file '/Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/bond/completions/struct.rb' failed to load with:
/Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- inline
.irbrc completed
irb(main):001:0> require 'readline_line_buffer'
LoadError: dlsym(0x5d5be0, Init_readline_line_buffer): symbol not found - /Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/readline_line_buffer.bundle
        from /Users/timcharper/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/lib/readline_line_buffer.bundle
        from /Users/timcharper/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from (irb):1

Does (should?) readline_line_buffer.bundle link directly against Readline?

Tim Harper
timcharper@timcharper:~/.rvm/gems/ruby-1.8.7-p249/gems/bond-0.2.1/ext/readline_line_buffer $ ruby extconf.rb 
checking for readline/readline.h... no
creating Makefile
Tim Harper

Ok, that was enough to lead to a fix. Please see my patch:

http://github.com/timcharper/bond

I'm questioning if should fail in ruby-1.9.2 envs, since bond doesn't require the extension in such conditions? Is the c extension even required?

Gabriel Horner
Owner

Nice fix! You wouldn't need to build the extension for ruby 1.9.2 starting from this commit. I can handle this case. I'm guessing it works now?

Tim Harper

Oh, ok.

Yes it works now :) (I've run into another issue I'm composing right now, for which I also have a workaround, will post details in a thread).

So, it seems that the logic should be, if you run extconf.rb, then you should fail if it can't find readline. In ruby 1.9.2, it seems it should not even attempt to build the extension, correct?

Tim

Tim Harper

(currently, it attempts to build the extensions when installing the gem via ruby-1.9.2)

Tim Harper

Ah, I see the problem. This line:

http://github.com/cldwalker/bond/blob/v0.2.1/gemspec#L20

Gets pre-evaluated during gem packaging time and the resulting value is packaged, not the condition itself. Since I packaged the gem via ruby 1.8.7, and then consequently installed said package with ruby 1.9.2, it took ruby 1.8.7's value, which was to build the extension.

For further evidence, see this file: ~/.rvm/rubies/ruby-1.9.2-preview3/lib/ruby/gems/1.9/specifications/bond-0.2.1.gemspec

# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
  s.name = %q{bond}
  s.version = "0.2.1"

  s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version=
  s.authors = ["Gabriel Horner"]
  s.date = %q{2010-07-06}
  s.description = %q{Bond is on a mission to improve irb’s autocompletion. Aside from doing everything irb’s can do and fixing its quirks, Bond can autocomplete argument(s) to methods, uniquely completing per module, per method and per argument. Bond brings irb’s completion closer to bash/zsh as it provides a configuration system and a DSL for creating custom completions and completion rules. With this configuration system, users can customize their irb autocompletions and share it with others. Bond can also generate completions from yard documentation and load completions that ship with gems. Bond is able to offer more than irb’s completion since it uses a Readline C extension to get the full line of input when completing as opposed to irb’s last-word approach.}
  s.email = %q{gabriel.horner@gmail.com}
  s.extensions = ["ext/readline_line_buffer/extconf.rb"]
  s.extra_rdoc_files = ["README.rdoc", "LICENSE.txt"]
  s.files = ["lib/bond/agent.rb", "lib/bond/completion.rb", "lib/bond/completions/activerecord.rb", "lib/bond/completions/array.rb", "lib/bond/completions/bond.rb", "lib/bond/completions/hash.rb", "lib/bond/completions/kernel.rb", "lib/bond/completions/module.rb", "lib/bond/completions/object.rb", "lib/bond/completions/struct.rb", "lib/bond/input.rb", "lib/bond/m.rb", "lib/bond/mission.rb", "lib/bond/missions/anywhere_mission.rb", "lib/bond/missions/default_mission.rb", "lib/bond/missions/method_mission.rb", "lib/bond/missions/object_mission.rb", "lib/bond/missions/operator_method_mission.rb", "lib/bond/rawline.rb", "lib/bond/rc.rb", "lib/bond/readline.rb", "lib/bond/search.rb", "lib/bond/version.rb", "lib/bond/yard.rb", "lib/bond.rb", "test/agent_test.rb", "test/anywhere_mission_test.rb", "test/bacon_extensions.rb", "test/bond_test.rb", "test/completion_test.rb", "test/completions_test.rb", "test/method_mission_test.rb", "test/mission_test.rb", "test/object_mission_test.rb", "test/operator_method_mission_test.rb", "test/search_test.rb", "test/test_helper.rb", "test/yard_test.rb", "LICENSE.txt", "CHANGELOG.rdoc", "README.rdoc", "ext/readline_line_buffer/extconf.rb", "ext/readline_line_buffer/readline_line_buffer.c", "Rakefile", "gemspec"]
  s.homepage = %q{http://tagaholic.me/bond/}
  s.require_paths = ["lib"]
  s.rubyforge_project = %q{tagaholic}
  s.rubygems_version = %q{1.3.7}
  s.summary = %q{Mission: Easy custom autocompletion for arguments, methods and beyond. Accomplished for irb and any other readline-like console environments.}

  if s.respond_to? :specification_version then
    current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
    s.specification_version = 3

    if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
      s.add_development_dependency(%q<bacon>, [">= 0"])
      s.add_development_dependency(%q<mocha>, [">= 0"])
      s.add_development_dependency(%q<mocha-on-bacon>, [">= 0"])
    else
      s.add_dependency(%q<bacon>, [">= 0"])
      s.add_dependency(%q<mocha>, [">= 0"])
      s.add_dependency(%q<mocha-on-bacon>, [">= 0"])
    end
  else
    s.add_dependency(%q<bacon>, [">= 0"])
    s.add_dependency(%q<mocha>, [">= 0"])
    s.add_dependency(%q<mocha-on-bacon>, [">= 0"])
  end
end

Do you see the s.extensions line?

Now... how to conditionally build the extension... perhaps an approach like I took for spork may work?

http://github.com/timcharper/spork/blob/master/ext/mkrf_conf.rb

Gabriel Horner
Owner

Tweaks to tim's patch. Closed by 5f64e69

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.