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

Mac OS X 13.2.0 ncursesw-ruby build issue: cannot find libncurses #317

Closed
0xErnie opened this issue Jul 2, 2014 · 26 comments
Closed

Mac OS X 13.2.0 ncursesw-ruby build issue: cannot find libncurses #317

0xErnie opened this issue Jul 2, 2014 · 26 comments
Labels

Comments

@0xErnie
Copy link

0xErnie commented Jul 2, 2014

Hello,

I got a Mac at work, most of the time I was using Linux. Installing sup does not seem to be that easy.

I followed https://github.com/sup-heliotrope/sup/wiki/Mac-OSX , installed rvm, the older ruby and a newer version of ncurses, but gem install sup seems to ignore it.

ncureses is linked via brew link nurses

$ ncurses5-config --version
5.9.20110404

It seems to be quite similar to #69.

$ ruby extconf.rb
checking for unistd.h... yes
checking for locale.h... yes
checking for ncursesw/curses.h... no
checking for ncurses.h... yes
checking for wmove() in -lncursesw... no
checking for wmove() in -lpdcurses... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/akauerz/.rvm/rubies/ruby-1.9.3-p547/bin/ruby
    --with-ncurseswlib
    --without-ncurseswlib
    --with-pdcurseslib
    --without-pdcurseslib
extconf.rb:48:in `<main>': ncurses library not found (RuntimeError)
@gauteh
Copy link
Member

gauteh commented Jul 2, 2014

You might need to do a hard/force link using brew as described in the
wiki (I think), did you try that? Also doing brew doctor before
installing might help.

gaute

On Wed Jul 2 11:56:55 2014, 0xErnie wrote:

Hello,

I got a Mac at work, most of the time I was using Linux. Installing
sup does not seem to be that easy.

I followed https://github.com/sup-heliotrope/sup/wiki/Mac-OSX ,
installed rvm, the older ruby and a newer version of ncurses, but |gem
install sup| seems to ignore it.

ncureses is linked via |brew link nurses|

|$ ncurses5-config --version
5.9.20110404
|

It seems to be quite similar to #69
#69.

|$ ruby extconf.rb
checking for unistd.h... yes
checking for locale.h... yes
checking for ncursesw/curses.h... no
checking for ncurses.h... yes
checking for wmove() in -lncursesw... no
checking for wmove() in -lpdcurses... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/akauerz/.rvm/rubies/ruby-1.9.3-p547/bin/ruby
--with-ncurseswlib
--without-ncurseswlib
--with-pdcurseslib
--without-pdcurseslib
extconf.rb:48:in `

': ncurses library not found (RuntimeError)
|


Reply to this email directly or view it on GitHub
#317.

@0xErnie
Copy link
Author

0xErnie commented Jul 2, 2014

Installed ncureses with brew link ncurses --force and executed brew doctorseverals times, current output follows, I don't know why ncurses is mentioned twice.

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Your file-system on [["/"]] appears to be CaSe SeNsItIvE.
Homebrew is less tested with that - don't worry but please report issues.

Warning: Some keg-only formula are linked into the Cellar.
Linking a keg-only formula, such as gettext, into the cellar with
`brew link <formula>` will cause other formulae to detect them during
the `./configure` step. This may cause problems when compiling those
other formulae.

Binaries provided by keg-only formulae may override system binaries
with other strange results.

You may wish to `brew unlink` these brews:

    ncurses

Warning: Some keg-only formula are linked into the Cellar.
Linking a keg-only formula, such as gettext, into the cellar with
`brew link <formula>` will cause other formulae to detect them during
the `./configure` step. This may cause problems when compiling those
other formulae.

Binaries provided by keg-only formulae may override system binaries
with other strange results.

You may wish to `brew unlink` these brews:

    ncurses

@gauteh
Copy link
Member

gauteh commented Jul 2, 2014

Did you check that you don't have any other system ncurses gem installed?

@0xErnie
Copy link
Author

0xErnie commented Jul 2, 2014

Is the output of gem list sufficient or are there other places where rvm may hide gems?

$ gem list

*** LOCAL GEMS ***

bigdecimal (1.1.0)
bundler (1.6.3)
bundler-unload (1.0.2)
executable-hooks (1.3.2)
gem-wrappers (1.2.5)
io-console (0.3)
json (1.5.5)
minitest (2.5.1)
rake (0.9.2.2)
rdoc (3.9.5)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
xapian-ruby (1.2.17)

@gauteh
Copy link
Member

gauteh commented Jul 2, 2014

You could have installed it outside RVM in case you tried to install
sup or its ncurses dependency before installing RVM, you can set up rvm
to use the system set and see if anything shows up.

On Wed Jul 2 12:10:34 2014, 0xErnie wrote:

Is the output of |gem list| sufficient or are there other places where
rvm may hide gems?

|$ gem list

*** LOCAL GEMS ***

bigdecimal (1.1.0)
bundler (1.6.3)
bundler-unload (1.0.2)
executable-hooks (1.3.2)
gem-wrappers (1.2.5)
io-console (0.3)
json (1.5.5)
minitest (2.5.1)
rake (0.9.2.2)
rdoc (3.9.5)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
xapian-ruby (1.2.17)
|


Reply to this email directly or view it on GitHub
#317 (comment).

@0xErnie
Copy link
Author

0xErnie commented Jul 2, 2014

The command is rvm system and it does not seem like I have other ncurses gems installed.

$ ruby --version
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
$ gem list

*** LOCAL GEMS ***

bigdecimal (1.2.0)
CFPropertyList (2.2.0)
io-console (0.4.2)
json (1.7.7)
libxml-ruby (2.6.0)
minitest (4.3.2)
nokogiri (1.5.6)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
sqlite3 (1.3.7)
test-unit (2.0.0.0)
xapian-ruby (1.2.17)

@gauteh
Copy link
Member

gauteh commented Jul 2, 2014

Unsure what the problem can be then, you could have a look around at the other issues here regarding mac os x and ncurses. There have been quite a few, they have mostly come down to different ways to configure the system. The gem is definitely a bit picky.

@schmeisers
Copy link

Hi Ernie,
I'm not sure if this is helpful, but in your last output, it looks like you're running ruby 2.0.0. I've never been able to get sup running with 2.0.0 on mac, but 1.9.3 works fine.

@0xErnie
Copy link
Author

0xErnie commented Jul 14, 2014

@schmeisers In the last output I made shure that there were no ncurses gems installed, before that I checked 1.9.3 und in that output I check 2.0.0

How did you install sup?

@schmeisers
Copy link

I installed ruby 1.9.3 with homebrew, then installed ncurses via homebrew using the instructions on the wiki (https://github.com/sup-heliotrope/sup/wiki/Mac-OSX). After forcing the link, sup installed fine via the gem.

On Jul 14, 2014, at 9:52 AM, 0xErnie [email protected] wrote:

@schmeisers In the last output I made shure that there were no ncurses gems installed, before that I checked 1.9.3 und in that output I check 2.0.0

How did you install sup?


Reply to this email directly or view it on GitHub.

@gauteh gauteh added the notsup label Jul 31, 2014
@gauteh
Copy link
Member

gauteh commented Jul 31, 2014

Did you figure this out?

@0xErnie
Copy link
Author

0xErnie commented Aug 4, 2014

Nope. Maybe we need better installation instructions for OS-X.

@0xErnie
Copy link
Author

0xErnie commented Aug 4, 2014

Removed rvm and installed ruby 1.9.3 via brew install ruby193 and brew link ruby193.

While executing 'gem install sup' I get the following:

ERROR:  While executing gem ... (Errno::EEXIST)
    File exists - /usr/local/Cellar/ruby193/1.9.3-p547/lib/ruby/gems

I just deleted it.

Maybe someone recognizes it:

ERROR:  While executing gem ... (Errno::EEXIST)
    File exists - /usr/local/Cellar/ruby193/1.9.3-p547/lib/ruby/gems
(reverse-i-search)`brew': brew link ruby193
ak-geraet:~ akauerz$ rm /usr/local/Cellar/ruby193/1.9.3-p547/lib/ruby/gems
ak-geraet:~ akauerz$ gem install sup
Fetching: xapian-ruby-1.2.17.gem (100%)
Building native extensions.  This could take a while...
Fetching: ncursesw-1.4.9.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing sup:
    ERROR: Failed to build gem native extension.

        /usr/local/Cellar/ruby193/1.9.3-p547/bin/ruby extconf.rb
checking for unistd.h... yes
checking for locale.h... yes
checking for ncursesw/curses.h... no
checking for ncurses.h... yes
checking for wmove() in -lncursesw... no
checking for wmove() in -lpdcurses... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/local/Cellar/ruby193/1.9.3-p547/bin/ruby
    --with-ncurseswlib
    --without-ncurseswlib
    --with-pdcurseslib
    --without-pdcurseslib
extconf.rb:48:in `<main>': ncurses library not found (RuntimeError)


Gem files will remain installed in /usr/local/Cellar/ruby193/1.9.3-p547/lib/ruby/gems/1.9.1/gems/ncursesw-1.4.9 for inspection.
Results logged to /usr/local/Cellar/ruby193/1.9.3-p547/lib/ruby/gems/1.9.1/gems/ncursesw-1.4.9/./gem_make.out

@cscorley
Copy link
Contributor

cscorley commented Aug 4, 2014

I've had luck installing sup as so:

brew install ruby-installer
brew install chruby
ruby-installer ruby 1.9.3
chruby 1.9.3
gem install sup

In the end, I add this to my .zsh (or .bashrc) to launch sup:

alias sup='chruby ruby-1.9.3 && sup'

I am not sure if brew install ncurses &c are required for this, I already had those packages installed prior.

@0xErnie
Copy link
Author

0xErnie commented Aug 11, 2014

brew install ruby-install
brew install chruby
ruby-install ruby 1.9.3
source /usr/local/share/chruby/chruby.sh
chruby 1.9.3
gem install sup

I still get extconf.rb:48:in

': ncurses library not found (RuntimeError)`.

Time for some emoji: 😡

@cscorley
Copy link
Contributor

FWIW, I do not link the new ncurses. I use the one that ships with OSX (5.7.20081102).

If it helps nail something down for you, here are my brewed packages:

apple-gcc42
asciidoc
aspell
autoconf
automake
chruby
cloog
cmake
colordiff
curl-ca-bundle
docbook
dos2unix
dtach
faac
faad2
ffmpeg
fondu
fontconfig
fontforge
freetype
gcc
gdbm
gettext
gfortran
ghc
gist
git
glib
gmime
gmp
gnutls
gsl
haskell-platform
htop-osx
isl
jpeg
json-c
lame
libao
libffi
libgcrypt
libgpg-error
libmpc
libpng
libtasn1
libtiff
libtool
libyaml
lsyncd
lua
mad
mercurial
mongodb
mpfr
msmtp
ncurses
nettle
openssl
p11-kit
pcre
pianobar
pkg-config
pyqt
python
python3
qt
readline
rsync
ruby-build
ruby-install
sip
sqlite
ssh-copy-id
talloc
tokyo-cabinet
unrar
urlview
vim
weechat
wget
x264
xapian
xvid
xz
zsh

@gauteh gauteh changed the title Mac OS X 13.2.0 build issue Mac OS X 13.2.0 ncursesw-ruby build issue: cannot find libncurses Aug 13, 2014
@gauteh
Copy link
Member

gauteh commented Oct 7, 2014

Closing, need-more-info.

@gauteh gauteh closed this as completed Oct 7, 2014
@0xErnie
Copy link
Author

0xErnie commented Oct 10, 2014

What info do you need?

@gauteh
Copy link
Member

gauteh commented Oct 10, 2014

Actually, need-more-info might have been a little misleading. This issue needs more investigation from someone on a mac.

@vsbuffalo
Copy link

I have this same issue. Frustrating. Any updates? Tried brewing ncurses, forcing links, etc. etc. with no resolution.

@gauteh
Copy link
Member

gauteh commented Apr 6, 2015

You also need to make sure that any leftovers from previous ncurses-ruby are gone.

@danmichaelo
Copy link

I tried filing an issue at rlane/ncursesw-ruby#5 , since I guess this is more of an issue with ncursesw than sup.

For some reason, ruby extconf.rb didn't look in /usr/local/include/, so gem link ncurses -f didn't make any difference. By adding dir_config('ncurses') to extconf.rb I could add --with-ncurses-dir=/usr/local/Cellar/ncurses/5.9 to the install command, and finally get checking for ncursesw/curses.h... yes

… but the wmove() checks still failed 😭

@gauteh
Copy link
Member

gauteh commented Jun 15, 2015

@danmichaelo: We use our own version of ncursesw, could you check if anything here: sup-heliotrope/ncursesw-ruby#17 helps?

@danmichaelo
Copy link

Thanks @gauteh ! Turns out I was using the OS X-bundled Ruby 2.0.0. By installing 2.2.0 from brew install ruby, it worked! I still had to add dir_config('ncurses') to/usr/local/lib/ruby/gems/2.2.0/gems/ncursesw-1.4.9\extconf.rb so I could run ruby extconf.rb -- --with-ncurses-dir=/usr/local/opt/ncurses/ (but that could probably be avoided by doing brew link ncurses -f for those who are ok with that)

@focs
Copy link

focs commented Nov 9, 2015

Thanks @danmichaelo ! that worked for me.

@JuPlutonic
Copy link

brew link -f ruby ncurses gcc
CXX=./bin/g++ ruby extconf.rb -- --with-opt-include=./include/ncursesw/ --with-opt-lib=./ --without-ncurses-dir

gem build ncursesw.gemspec && gem install ncursesw-1.4.10.gem

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

No branches or pull requests

8 participants