Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubuntu and ncurses #7

Open
robbiemu opened this issue Oct 28, 2011 · 35 comments
Open

ubuntu and ncurses #7

robbiemu opened this issue Oct 28, 2011 · 35 comments

Comments

@robbiemu
Copy link

I'm not sure if this is your issue or if I should really pass this on to FFI. Ubuntu packages ncurses in a way that ruby is not loading:

$ ruby test.rb
...
/home/robbiemu/bin/lib/ruby/gems/1.9.1/gems/ffi-1.0.10/lib/ffi/library.rb:121:in `block in ffi_lib': Could not open library 'ncursesw': ncursesw: cannot open shared object file: No such file or directory. (LoadError)
...
Could not open library 'libncurses.so': /usr/lib/libncurses.so: file too short.
Could not open library 'libcurses': libcurses: cannot open shared object file: No such file or directory.
Could not open library 'libcurses.so': /usr/lib/libcurses.so: file too short
...
$ cat /usr/lib/libncurses.so
INPUT(libncurses.so.5 -ltinfo)

@robbiemu
Copy link
Author

after carefully reading the error log (and the obvious reference to "ffi_lib"), I realized this is certainly a problem with FFI and not your implementation. closing my own issue.

@seanohalpin seanohalpin reopened this Oct 28, 2011
@seanohalpin
Copy link
Owner

Hi,

That doesn't look like an ffi-ncurses or an ffi error. /usr/lib/libncurses.so should be a binary file - you shouldn't see anything like that when you cat it. It looks like your libncurses has been corrupted or overwritten by something. The "file too short" error message is the clue.

Regards,
Sean

@robbiemu
Copy link
Author

I'm positive this is not a file corruption, and that the library was installed from a vanilla ubuntu installation. the INPUT directive must be part of the ld specification or something :) either that or I just stumbled on a bug that should halt other programs that I use dead in their tracks... but it mysteriously isnt. :) in any case, it certainly isn't your bug -- sorry about reporting it here. Thanks for the help

@keshavkuruva
Copy link

Facing the same issue with ubuntu 11.10.

Did anyone get a workaround or solution for this?

I am trying to fix this since 2 days and it still exists?

Thanks for the help in advance,
Keshav

@seanohalpin
Copy link
Owner

Could you post the exact error message you get?

In the meantime, you could try:

$ sudo apt-get install libncursesw5

to ensure that you have ncursesw installed on your system.

@keshavkuruva
Copy link

run warbler
warble aborted!
Could not open library 'ncursesw' : ncursesw: cannot open shared object file: No such file or directory. Could not open library 'libncursesw.so' : /usr/lib/i386-linux-gnu/libncursesw.so: file too short. Could not open library 'ncurses' : ncurses: cannot open shared object file: No such file or directory. Could not open library 'libncurses.so' : /usr/lib/i386-linux-gnu/libncurses.so: file too short

The above error message is the one I am seeing when I trying to deploy my application.

Thanks for the help Sean.
Keshav.

@seanohalpin
Copy link
Owner

Hi,

This looks to me like your ncurses installation is borked, possibly that the target of your libncurses.so symlinks have been moved or deleted. Try this - you should get similar results (this is on Ubuntu):

$ ls -la /usr/lib/libncurses*
-rw-r--r-- 1 root root 364924 2010-08-24 09:21 /usr/lib/libncurses.a
-rw-r--r-- 1 root root 126912 2010-08-24 09:21 /usr/lib/libncurses++.a
lrwxrwxrwx 1 root root 20 2010-08-30 23:30 /usr/lib/libncurses.so -> /lib/libncurses.so.5
lrwxrwxrwx 1 root root 13 2010-01-17 14:25 /usr/lib/libncurses.so.5 -> libtermcap.so
-rw-r--r-- 1 root root 126912 2010-08-24 09:21 /usr/lib/libncurses++w.a
-rw-r--r-- 1 root root 435712 2010-08-24 09:21 /usr/lib/libncursesw.a
lrwxrwxrwx 1 root root 21 2010-08-30 23:30 /usr/lib/libncursesw.so -> /lib/libncursesw.so.5

Also, try this:

$ file /usr/lib/libncursesw.so

You should get something like this:

/usr/lib/libncursesw.so: symbolic link to `/lib/libncursesw.so.5'

If the target is missing, you'll get something like this:

/usr/lib/libncursesw.so: broken symbolic link to `/lib/libncursesw.so.5'

Also, what OS/distro are you on? If you're on RedHat/Centos then you may be the victim of this bug: https://bugzilla.redhat.com/show_bug.cgi?id=228891

Their suggestion is:

"Please remove the /usr/lib64/libncurses.so.5 symlink and everything will work
again."

Adjusting for whether you're on a 32 or 64 bit platform.

Regards,
Sean

@keshavkuruva
Copy link

this is what I am getting when I tried locating libncursesw

keshav@keshav-laptop:/$ locate libncursesw
/lib/i386-linux-gnu/libncursesw.so.5
/lib/i386-linux-gnu/libncursesw.so.5.9
/usr/lib/i386-linux-gnu/libncursesw.a
/usr/lib/i386-linux-gnu/libncursesw.so
/usr/share/doc/libncursesw5
/usr/share/doc/libncursesw5-dev
/usr/share/doc/libncursesw5/changelog.Debian.gz
/usr/share/doc/libncursesw5/copyright
/usr/share/doc/libncursesw5-dev/changelog.Debian.gz
/usr/share/doc/libncursesw5-dev/copyright
/var/cache/apt/archives/libncursesw5-dev_5.9-4_i386.deb
/var/cache/apt/archives/libncursesw5_5.9-4_i386.deb
/var/lib/dpkg/info/libncursesw5-dev.list
/var/lib/dpkg/info/libncursesw5-dev.md5sums
/var/lib/dpkg/info/libncursesw5:i386.list
/var/lib/dpkg/info/libncursesw5:i386.md5sums
/var/lib/dpkg/info/libncursesw5:i386.postinst
/var/lib/dpkg/info/libncursesw5:i386.postrm
/var/lib/dpkg/info/libncursesw5:i386.shlibs
/var/lib/dpkg/info/libncursesw5:i386.symbols

keshav@keshav-laptop:/$ sudo apt-get install libncursesw5
Reading package lists... Done
Building dependency tree
Reading state information... Done
libncursesw5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

and this is what results when I try below:

keshav@keshav-laptop:/$ file /usr/lib/libncursesw.so
/usr/lib/libncursesw.so: ERROR: cannot open `/usr/lib/libncursesw.so' (No such file or directory)

It says it is installed but it is not under /usr/lib/?

Keshav.

@keshavkuruva
Copy link

keshav@keshav-laptop:/lib/i386-linux-gnu$ ls -al /lib/i386-linux-gnu/libncursesw.so.5
lrwxrwxrwx 1 root root 18 Nov 18 18:46 /lib/i386-linux-gnu/libncursesw.so.5 -> libncursesw.so.5.9

@seanohalpin
Copy link
Owner

Looks like ffi is not searching in /usr/lib/i386-linux. As a workaround, you could try explicitly setting the library that ffi-ncurses looks for:

export RUBY_FFI_NCURSES_LIB=/usr/lib/i386-linux-gnu/libncursesw.so

before calling your program.

@keshavkuruva
Copy link

Did the same as you told before running my program and the new error is :

warble aborted!
Could not open library '/usr/lib/i386-linux-gnu/libncursesw.so' : /usr/lib/i386-linux-gnu/libncursesw.so: file too short

Keshav.

@manojiitkgp09
Copy link

Try reinstalling the library:

  1. sudo apt-get install --reinstall -f libncursesw5
  2. Reinstall ruby also if it still shows error

Let me know the results so that I can put the error and the solution on my blog for future use :)

@keshavkuruva
Copy link

keshav@keshav-laptop:~/ehr_bellagio$ sudo apt-get install --reinstall -f libncursesw5
[sudo] password for keshav:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libgnatvsn4.6 gnat-4.6-base libgnatprj4.6 libgnat-4.6
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1 not upgraded.
Need to get 0 B/145 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 252680 files and directories currently installed.)
Preparing to replace libncursesw5 5.9-4 (using .../libncursesw5_5.9-4_i386.deb) ...
Unpacking replacement libncursesw5 ...
Setting up libncursesw5 (5.9-4) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Error org.freedesktop.DBus.Error.TimedOut: Activation of org.freedesktop.PackageKit timed out

Getting this error when trying to reinstall libncursesw5

even re-installed ruby, but no luck

Keshav.

@pedroteixeira
Copy link

creating the symlink worked for me: sudo ln -s /lib/libncurses.so.5 /usr/lib/libncurses.so this is duplicated with the ffi/ffi#168

@keshavkuruva
Copy link

tried the above .. didn't help either...

warble aborted!
Could not open library 'ncursesw' : ncursesw: cannot open shared object file: No such file or directory. Could not open library 'libncursesw.so' : /usr/lib/i386-linux-gnu/libncursesw.so: file too short. Could not open library 'ncurses' : ncurses: cannot open shared object file: No such file or directory. Could not open library 'libncurses.so' : /usr/lib/i386-linux-gnu/libncurses.so: file too short

Keshav.

@keshavkuruva
Copy link

keshav@keshav-laptop:~/myapp$ warble war --trace
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
warble aborted!
Could not open library 'ncursesw' : ncursesw: cannot open shared object file: No such file or directory. Could not open library 'libncursesw.so' : /usr/lib/i386-linux-gnu/libncursesw.so: file too short. Could not open library 'ncurses' : ncurses: cannot open shared object file: No such file or directory. Could not open library 'libncurses.so' : /usr/lib/i386-linux-gnu/libncurses.so: file too short
/home/keshav/.rvm/rubies/jruby-1.5.6/lib/ruby/site_ruby/shared/ffi/library.rb:28:in ffi_lib' /home/keshav/.rvm/rubies/jruby-1.5.6/lib/ruby/site_ruby/shared/ffi/library.rb:10:inmap'
/home/keshav/.rvm/rubies/jruby-1.5.6/lib/ruby/site_ruby/shared/ffi/library.rb:10:in ffi_lib' /home/keshav/.rvm/gems/jruby-1.5.6@global/gems/ffi-ncurses-0.3.3/lib/ffi-ncurses.rb:32 /home/keshav/.rvm/gems/jruby-1.5.6@global/gems/ffi-ncurses-0.3.3/lib/ffi-ncurses.rb:68:inrequire'
/home/keshav/.rvm/gems/jruby-1.5.6@global/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in require' /home/keshav/.rvm/gems/jruby-1.5.6@global/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:ineach'
/home/keshav/.rvm/gems/jruby-1.5.6@global/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in require' /home/keshav/.rvm/gems/jruby-1.5.6@global/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:ineach'
/home/keshav/.rvm/gems/jruby-1.5.6@global/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in require' /home/keshav/.rvm/gems/jruby-1.5.6@global/gems/bundler-1.0.18/lib/bundler.rb:120:inrequire'
./config/boot.rb:117:in load_gems' ./config/../vendor/rails/railties/lib/initializer.rb:164:inprocess'
./config/../vendor/rails/railties/lib/initializer.rb:113:in run' /home/keshav/myapp/config/environment.rb:16 /home/keshav/myapp/config/environment.rb:182:inrequire'
/home/keshav/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in require' /home/keshav/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:547:innew_constants_in'
/home/keshav/myapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in require' /home/keshav/myapp/vendor/rails/railties/lib/tasks/misc.rake:4 /home/keshav/.rvm/gems/jruby-1.5.6@global/gems/rake-0.9.2/lib/rake/task.rb:205:incall'
/home/keshav/.rvm/gems/jruby-1.5.6@global/gems/rake-0.9.2/lib/rake/task.rb:205:in execute' /home/keshav/.rvm/gems/jruby-1.5.6@global/gems/rake-0.9.2/lib/rake/task.rb:200:ineach'
/home/keshav/.rvm/gems/jruby-1.5.6@global/gems/rake-0.9.2/lib/rake/task.rb:200:in execute' /home/keshav/.rvm/gems/jruby-1.5.6@global/gems/rake-0.9.2/lib/rake/task.rb:158:ininvoke_with_call_chain'
/home/keshav/.rvm/rubies/jruby-1.5.6/lib/ruby/1.8/monitor.rb:191:in mon_synchronize' /home/keshav/.rvm/gems/jruby-1.5.6@global/gems/rake-0.9.2/lib/rake/task.rb:151:ininvoke_with_call_chain'
/home/keshav/.rvm/gems/jruby-1.5.6@global/gems/rake-0.9.2/lib/rake/task.rb:144:in invoke' /home/keshav/.rvm/gems/jruby-1.5.6@global/gems/warbler-1.3.2/lib/warbler/traits/rails.rb:29:inbefore_configure'
/home/keshav/.rvm/gems/jruby-1.5.6@global/gems/warbler-1.3.2/lib/warbler/traits.rb:28:in each' /home/keshav/.rvm/gems/jruby-1.5.6@global/gems/warbler-1.3.2/lib/warbler/traits.rb:28:inbefore_configure'
/home/keshav/.rvm/gems/jruby-1.5.6@global/gems/warbler-1.3.2/lib/warbler/config.rb:170:in initialize' (eval):5:innew'
(eval):5:in `initialize'
Tasks: TOP => environment

@keshavkuruva
Copy link

config.war_name deprecated; replace with config.jar_name
warble aborted!
undefined method gems' for #<Rails::VendorGemSourceIndex:0x6c58d3> /home/keshav/.rvm/gems/jruby-1.5.6@global/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:270:inall_specs'

@seanohalpin
Copy link
Owner

I can't reproduce your problem on my systems. What version of Ubuntu are you running?

Please try this and let me know if it works:

export RUBY_FFI_NCURSES_LIB=/lib/i386-linux-gnu/libncursesw.so.5.9

then run your program. If that doesn't work, then please find where the real binary of ncurses (not the softlinks) is on your system and set RUBY_FFI_NCURSES_LIB to point to it then try again. And please let me know the outcome.

@seanohalpin seanohalpin reopened this Dec 20, 2011
@keshavkuruva
Copy link

sean,

I was using Ubuntu 12.10, but I have downgraded my ubuntu back to 10.10 and reinstalled jruby via rvm. Now when I do a bundle install... this is the error I am seeing.

keshav@keshav-laptop-1015:~/ehr_bellagio$ bundle install
Fetching source index for http://gems.github.com/
Fetching source index for http://gemcutter.org/
Using rake (0.9.2)
Using abstract (1.0.0)
Using activesupport (2.3.10)
Using rack (1.1.0)
Using actionpack (2.3.10)
Using actionmailer (2.3.10)
Using activerecord (2.3.10)
Using activerecord-oracle_enhanced-adapter (1.3.2) from source at vendor/gems/activerecord-oracle_enhanced-adapter-1.3.2
Using activeresource (2.3.10)
Using alchemist (0.1.2)
Using annotate (2.4.0)
Using authlogic (2.1.5)
Using awesome_print (1.0.1)
Using builder (3.0.0)
Using mime-types (1.17.2)
Using xml-simple (1.1.1)
Using aws-s3 (0.6.2)
Using bouncy-castle-java (1.5.0146.1)
Using browser (0.1.2)
Using cancan (1.6.5)
Using closure-compiler (0.3.3)
Using columnize (0.3.6)
Using haml (3.0.24)
Using compass (0.10.6)
Using erubis (2.6.6)
Using factory_girl (1.2.4)
Using faker (0.3.1)
Using fastercsv (1.5.3)

Java::JavaLang::ArrayIndexOutOfBoundsException: An error occured while installing ffi (1.0.11), and Bundler cannot continue.
Make sure that gem install ffi -v '1.0.11' succeeds before bundling.

And running the gem install ffi -v 1.0.11 command is throwing back the ArrayOutofIndex System.lang.java exception ..

This was working before with ubuntu 10.10, jruby 1.5.6 .. but now it;s not

Keshav.

@seanohalpin
Copy link
Owner

The problem you've posted above is with installing the ffi gem using jruby. It's not a problem with ffi-ncurses. It would be more appropriate to raise it with the ffi team.

You say you're using Ubuntu 12.10 - do you mean 11.10 or 12.04?

@viking
Copy link

viking commented Jan 11, 2012

On Ubuntu 11.10 (64-bit), the libncurses5-dev package installs /usr/lib/libncurses.so, which is a text file with the contents "INPUT(libncurses.so.5 -ltinfo)".

@viking
Copy link

viking commented Jan 11, 2012

Likewise, the libncursesw5-dev package installs /usr/lib/libncursesw.so, which is a text file with the contents "INPUT(libncursesw.so.5 -ltinfo)".

@robbiemu
Copy link
Author

I want to thank everyone for pitching in, I have to confess I dont have administrative access on my box and could not do a lot fo the work that viking, et al, have done.

That said I have the ncursesw lib installed and if you look at the default so it gives the filename of the actual file: that file does exist and aught to work just fine.

@avinmathew
Copy link

On a fresh Ubuntu 12.04 VM, setting RUBY_FFI_NCURSES_LIB to /lib/i386-linux-gnu/libncursesw.so.5.9 progressed me to another error about not finding libpanel. On my environment, this was located at /usr/lib/i386-linux-gnu/libpanelw.so.5.9.

Modifying ffi-ncurses.rb to also look for a RUBY_FFI_PANEL_LIB variable worked. Perhaps a user settable panel location might be worthwhile?

@astjohn
Copy link

astjohn commented Aug 7, 2012

I'm using Ubuntu 12.04. I also set RUBY_FFI_NCURSES_LIB as suggested, but that resulted in the following error:

Could not open library '/lib/i386-linux-gnu/libncurses.so.5.9' : /lib/i386-linux-gnu/libncurses.so.5.9: wrong ELF class: ELFCLASS32

Note that I have also purged and re-installed libncursesw5

@BrandonMathis
Copy link

Try this command to find the locations of ncurses

sudo find / -name 'libncurses*'

@astjohn
Copy link

astjohn commented Aug 14, 2012

@KeysetTS, On Ubuntu 12.04, my output is:

/lib/x86_64-linux-gnu/libncursesw.so.5
/lib/x86_64-linux-gnu/libncurses.so.5
/lib/x86_64-linux-gnu/libncurses.so.5.9
/lib/x86_64-linux-gnu/libncursesw.so.5.9
/lib/i386-linux-gnu/libncursesw.so.5
/lib/i386-linux-gnu/libncurses.so.5
/lib/i386-linux-gnu/libncurses.so.5.9
/lib/i386-linux-gnu/libncursesw.so.5.9
/var/lib/dpkg/info/libncursesw5:i386.list
/var/lib/dpkg/info/libncursesw5:i386.shlibs
/var/lib/dpkg/info/libncursesw5-dev.list
/var/lib/dpkg/info/libncursesw5:amd64.shlibs
/var/lib/dpkg/info/libncurses5:i386.md5sums
/var/lib/dpkg/info/libncursesw5:amd64.list
/var/lib/dpkg/info/libncurses-ruby1.9.1.md5sums
/var/lib/dpkg/info/libncursesw5:i386.postrm
/var/lib/dpkg/info/libncursesw5:amd64.postrm
/var/lib/dpkg/info/libncurses5-dev.list
/var/lib/dpkg/info/libncurses-ruby1.9.1.list
/var/lib/dpkg/info/libncursesw5:amd64.md5sums
/var/lib/dpkg/info/libncurses5:amd64.list
/var/lib/dpkg/info/libncursesw5-dev.md5sums
/var/lib/dpkg/info/libncursesw5:i386.postinst
/var/lib/dpkg/info/libncursesw5:amd64.symbols
/var/lib/dpkg/info/libncurses5:amd64.shlibs
/var/lib/dpkg/info/libncurses5:amd64.postinst
/var/lib/dpkg/info/libncurses5:amd64.postrm
/var/lib/dpkg/info/libncursesw5:i386.symbols
/var/lib/dpkg/info/libncursesw5:i386.md5sums
/var/lib/dpkg/info/libncurses5:i386.symbols
/var/lib/dpkg/info/libncursesw5:amd64.postinst
/var/lib/dpkg/info/libncurses5:i386.postrm
/var/lib/dpkg/info/libncurses5:amd64.symbols
/var/lib/dpkg/info/libncurses5:i386.shlibs
/var/lib/dpkg/info/libncurses5:i386.postinst
/var/lib/dpkg/info/libncurses5:amd64.md5sums
/var/lib/dpkg/info/libncurses5:i386.list
/var/lib/dpkg/info/libncurses5-dev.md5sums
/usr/lib/x86_64-linux-gnu/libncurses++.a
/usr/lib/x86_64-linux-gnu/libncursesw.a
/usr/lib/x86_64-linux-gnu/libncursesw.so
/usr/lib/x86_64-linux-gnu/libncurses.a
/usr/lib/x86_64-linux-gnu/libncurses.so
/usr/lib/x86_64-linux-gnu/libncurses++w.a
/usr/share/doc/libncursesw5-dev
/usr/share/doc/libncurses5-dev
/usr/share/doc/libncursesw5
/usr/share/doc/libncurses-ruby1.9.1
/usr/share/doc/libncurses5

@BrandonMathis
Copy link

looks like you have versions for both 32 and 64 bit installed (hence the x86_64 and i386) you will need to determine what kind of machine (64 or 32 bit) you have before proceeding.

x86_64 = 64 bit
i386 = 32 bit

That should help you determine which libncurses.so.5.9 you will need to set your RUBY_FFI_NCURSES_LIB to

@astjohn
Copy link

astjohn commented Aug 14, 2012

@KeysetTS, Yeah, you're right - which surprised me as I have pretty much a clean install of Ubuntu.

@mmustala
Copy link

I had this issue also. Happy to find good information here. The issue got fixed with command:
"export RUBY_FFI_NCURSES_LIB=/lib/x86_64-linux-gnu/libncursesw.so.5"

I'm using ubuntu 12.04 installed a week ago, so it shouldn't be that wasted yet.

@karl-ravn
Copy link

Or, if you don't want to put this env all the time, just do like this:

root@server01:/usr/lib/x86_64-linux-gnu# rm libncursesw.so && ln -s /lib/x86_64-linux-gnu/libncursesw.so.5 libncursesw.so

@lumpidu
Copy link

lumpidu commented Dec 25, 2012

yupp, that fixed it for me as well!

@FooBaer
Copy link

FooBaer commented Feb 18, 2013

I had the same problem and could fix it by creating a symlink into the usr/lib directory.
But now i get another error:
/var/lib/gems/1.9.1/gems/ffi-1.4.0/lib/ffi/library.rb:123:in `block in ffi_lib': Could not open library 'panelw': panelw: cannot open shared object file: No such file or directory. (LoadError)

The error is created by the ruby Gem (ffi-ncurses).
I hope someone can help me with this

-e-
i fixed the error by creating another symlink (libpanelw.so) in "/usr/lib/x86_64-linux-gnu" to libpanelw.so.5 in "/usr/lib/x86_64-linux-gnu"

don't know why but it works now

@kgx
Copy link

kgx commented Mar 3, 2013

Apparently FFI knows to look in the correct place, which for me is /usr/lib/i386-linux-gnu in Ubuntu 12.04 LTS, but it is not following the version suffix naming convention.

It looks for libncursesw.so instead of libncursesw.so.5, and libpanelw.so instead of libpanelw.so.5. Note that these files are in different locations in my install.

sudo ln -s /lib/i386-linux-gnu/libncursesw.so.5 /lib/i386-linux-gnu/libncursesw.so
sudo ln -s /usr/lib/i386-linux-gnu/libpanelw.so.5 /usr/lib/i386-linux-gnu/libpanelw.so

I feel like this is partly Ubuntu's issue for not creating symlinks, but if FFI does distro-specific stuff why not just look for the so.5 files?

@ghost
Copy link

ghost commented Mar 18, 2013

An easy fix for this is to add 'libncurses.so.5' to the end of the ffi_lib array.
e.g. instead

ffi_lib(['ncursesw', 'libncursesw', 'ncurses', 'libcurses'])

use

ffi_lib(['ncursesw', 'libncursesw', 'ncurses', 'libcurses', 'libncurses.so.5.9'])

And the same for the other libs used.

Ruby-FFI does not make any attempt to guess that e.g. 'ncurses' means libncurses.so.5.9 on linux, because that would mean searching known locations for libraries - which on mixed 32/64 platforms like linux is very fragile.

So, in the end it is far more consistent to just hardcode the linux support in the library wrapper itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests