-
Notifications
You must be signed in to change notification settings - Fork 21
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
Comments
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. |
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, |
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 |
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, |
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. |
run warbler The above error message is the one I am seeing when I trying to deploy my application. Thanks for the help Sean. |
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* 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 Adjusting for whether you're on a 32 or 64 bit platform. Regards, |
this is what I am getting when I tried locating libncursesw keshav@keshav-laptop:/$ locate libncursesw keshav@keshav-laptop:/$ sudo apt-get install libncursesw5 and this is what results when I try below: keshav@keshav-laptop:/$ file /usr/lib/libncursesw.so It says it is installed but it is not under /usr/lib/? Keshav. |
keshav@keshav-laptop:/lib/i386-linux-gnu$ ls -al /lib/i386-linux-gnu/libncursesw.so.5 |
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. |
Did the same as you told before running my program and the new error is : warble aborted! Keshav. |
Try reinstalling the library:
Let me know the results so that I can put the error and the solution on my blog for future use :) |
keshav@keshav-laptop:~/ehr_bellagio$ sudo apt-get install --reinstall -f libncursesw5 Getting this error when trying to reinstall libncursesw5 even re-installed ruby, but no luck Keshav. |
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 |
tried the above .. didn't help either... warble aborted! Keshav. |
keshav@keshav-laptop:~/myapp$ warble war --trace |
config.war_name deprecated; replace with config.jar_name |
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. |
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 Java::JavaLang::ArrayIndexOutOfBoundsException: An error occured while installing ffi (1.0.11), and Bundler cannot continue. 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. |
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? |
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)". |
Likewise, the libncursesw5-dev package installs /usr/lib/libncursesw.so, which is a text file with the contents "INPUT(libncursesw.so.5 -ltinfo)". |
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. |
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? |
I'm using Ubuntu 12.04. I also set
Note that I have also purged and re-installed |
Try this command to find the locations of ncurses
|
@KeysetTS, On Ubuntu 12.04, my output is:
|
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 That should help you determine which libncurses.so.5.9 you will need to set your |
@KeysetTS, Yeah, you're right - which surprised me as I have pretty much a clean install of Ubuntu. |
I had this issue also. Happy to find good information here. The issue got fixed with command: I'm using ubuntu 12.04 installed a week ago, so it shouldn't be that wasted yet. |
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 |
yupp, that fixed it for me as well! |
I had the same problem and could fix it by creating a symlink into the usr/lib directory. The error is created by the ruby Gem (ffi-ncurses). -e- don't know why but it works now |
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.
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? |
An easy fix for this is to add 'libncurses.so.5' to the end of the ffi_lib array.
use
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. |
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)
The text was updated successfully, but these errors were encountered: