LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-12-2017, 11:02 PM   #1
popwizard
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Rep: Reputation: Disabled
Unhappy Ruby 2.0.0 gem install error


Hello,

I am having difficulties installing a gem on Ruby 2.0.0. I have done this on five other Ubuntu 16.04 computers with no errors, but my last two builds are giving me a challenge. I installed dependencies: sudo apt-get install zlib1g-dev openssl libopenssl-ruby1.9.1 libssl-dev libruby1.9.1 libreadline-dev git-core bison - others have noted. The gem error is:

Building native extensions. This could take a while...

sudo gem install gtk2 -v 3.0.8 > ../gem.log
ERROR: Error installing gtk2:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb
checking for --enable-debug-build option... no
checking for -Wall option to compiler... yes
checking for -Waggregate-return option to compiler... yes
checking for -Wcast-align option to compiler... yes
checking for -Wextra option to compiler... yes
checking for -Wformat=2 option to compiler... yes
checking for -Winit-self option to compiler... yes
checking for -Wlarger-than-65500 option to compiler... yes
checking for -Wmissing-declarations option to compiler... yes
checking for -Wmissing-format-attribute option to compiler... yes
checking for -Wmissing-include-dirs option to compiler... yes
checking for -Wmissing-noreturn option to compiler... yes
checking for -Wmissing-prototypes option to compiler... yes
checking for -Wnested-externs option to compiler... yes
checking for -Wold-style-definition option to compiler... yes
checking for -Wpacked option to compiler... yes
checking for -Wp,-D_FORTIFY_SOURCE=2 option to compiler... yes
checking for -Wpointer-arith option to compiler... yes
checking for -Wswitch-default option to compiler... yes
checking for -Wswitch-enum option to compiler... yes
checking for -Wundef option to compiler... yes
checking for -Wout-of-line-declaration option to compiler... no
checking for -Wunsafe-loop-optimizations option to compiler... yes
checking for -Wwrite-strings option to compiler... yes
checking for rb_define_alloc_func() in ruby.h... yes
checking for rb_block_proc() in ruby.h... yes
checking for new allocation framework... yes
checking for attribute assignment... no
checking for rb_errinfo()... yes
checking for cairo... yes
checking for rb_cairo.h... yes
checking for Windows... no
checking for gtk+-2.0 version (>= 2.10.0)... yes
checking for st.h... yes
checking for ruby/st.h... yes
checking for target... *** 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/bin/ruby
--enable-debug-build
--disable-debug-build
--with-pkg-config
--without-pkg-config
--with-override-variables
--without-override-variables
extconf.rb:80:in `<main>': can't find gdkkeysyms.h (RuntimeError)
x11


Gem files will remain installed in /usr/local/lib/ruby/gems/2.0.0/gems/gtk2-3.0.8 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.0.0/gems/gtk2-3.0.8/ext/gtk2/gem_make.out

I can post the configure output, the make output, and the make install output if needed.
 
Old 08-13-2017, 02:11 AM   #2
Michael Uplawski
Member
 
Registered: Dec 2015
Distribution: Debian stretch/sid
Posts: 465
Blog Entries: 16

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
Could this be an incompatibility between the installed Gtk-2 libraries and the gem?
AFAIS, the current Gtk2 gem is 3.1.8. If you do not have special reasons to stick with 3.0.8, maybe just execute
Code:
:~$ sudo gem install gtk2
The missing header should be found in a location like
Code:
user@machine:~$ locate gdkkeysyms.h
/usr/include/gtk-2.0/gdk/gdkkeysyms.h
/usr/include/gtk-3.0/gdk/gdkkeysyms.h
If you do not find it, then your Gtk-libraries are not installed in the way that the gem requires. Pay attention to the fact that this is a C-header, as part of the Gtk-API; meaning, that the development-version of Gtk is needed!!

Question for the forum direction: Should this be moved to “programming”?

Last edited by Michael Uplawski; 08-13-2017 at 02:14 AM. Reason: words
 
Old 08-13-2017, 06:49 AM   #3
popwizard
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hello,

Code:
locate gdkkeysyms.h
/usr/include/gtk-2.0/gdk/gdkkeysyms.h
/usr/include/gtk-3.0/gdk/gdkkeysyms.h
I need to use Ruby 2.0.0, therefore I need v 3.0.8. I installed this on 5 other Ubuntu 16.04 computers with no challenges. I must have installed something that put the proper files down for it to install.
Code:
sudo gem install gtk2
ERROR:  Error installing gtk2:
	glib2 requires Ruby version >= 2.1.0.

sudo apt-get install libgtk-3-devReading package lists... Done
Building dependency tree       
Reading state information... Done
libgtk-3-dev is already the newest version (3.18.9-1ubuntu3.3).

sudo apt-get install libgtk2.0-devReading package lists... Done
Building dependency tree       
Reading state information... Done
libgtk2.0-dev is already the newest version (2.24.30-1ubuntu1.16.04.2).
On the computers I did install successfully:
Code:
locate gdkkeysyms.h
/usr/include/gtk-2.0/gdk/gdkkeysyms.h
/usr/local/lib/ruby/gems/2.0.0/gems/gtk2-3.0.8/ext/gtk2/rbgdkkeysyms.h

Last edited by popwizard; 08-13-2017 at 07:10 AM. Reason: Adding information
 
Old 08-14-2017, 08:35 AM   #4
Michael Uplawski
Member
 
Registered: Dec 2015
Distribution: Debian stretch/sid
Posts: 465
Blog Entries: 16

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
Good afternoon.
Quote:
Originally Posted by popwizard View Post
I must have installed something that put the proper files down for it to install.
Yes.
Code:
sudo gem install gtk2
ERROR:  Error installing gtk2:
	glib2 requires Ruby version >= 2.1.0.
End of story. Ω
 
Old 08-14-2017, 08:57 AM   #5
popwizard
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Code:
user@computer:~/lich_git/dr-scripts$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]

user@computer:~/lich_git/dr-scripts$ gem list

*** LOCAL GEMS ***

atk (3.0.8)
bigdecimal (1.2.0)
cairo (1.15.2)
curses (1.0.0)
gdk_pixbuf2 (3.0.8)
glib2 (3.0.8)
gtk2 (3.0.8)
hitimes (1.2.4)
httpclient (2.8.2.2)
io-console (0.4.2)
json (1.7.7)
mime-types (3.1)
mime-types-data (3.2016.0521)
minitest (4.3.2)
pango (3.0.8)
pkg-config (1.1.7)
promise_pool (0.9.0)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
rest-builder (0.9.1)
rest-core (4.0.0)
rest-firebase (1.1.0)
sqlite3 (1.3.11)
test-unit (2.0.0.0)
timers (4.1.1)
As you can see, I have successfully installed Ruby 2.0.0 with gtk2 -v 3.0.8 last year (on 5 separate computers) running Ubuntu 16.04 LTS. I need to understand what changed and how to make it compile. I tried a newer Ruby with newer gtk but the application does not work.
 
Old 08-14-2017, 10:56 AM   #6
popwizard
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by popwizard View Post


As you can see, I have successfully installed Ruby 2.0.0 with gtk2 -v 3.0.8 last year (on 5 separate computers) running Ubuntu 16.04 LTS. I need to understand what changed and how to make it compile. I tried a newer Ruby with newer gtk but the application does not work.
I was able to make gtk2 3.1.8 work after another gem uninstall and install. The application now works. I am still curious why I could not do the same process I did a year ago on 5 computers. I am going to mark closed/resolved for now.
 
  


Reply

Tags
ruby


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error while using rvm - symbol lookup error: /home/rsurabhi/.rvm/gems/ruby-2.1.0/ruby surabhi.rajkumar Linux - Newbie 1 07-24-2014 10:54 AM
Backtrack (Ubuntu based) having issues with ruby, gem etc for Metasploit lewandowskid Linux - Distributions 0 06-22-2013 01:45 AM
Can't install 'rmagick' Ruby gem... ahmadj Slackware 4 01-04-2011 04:23 AM
[SOLVED] Installing Ruby on Rails -- "gem update --system is disabled on Debian". bartonski Debian 2 08-23-2009 09:17 PM
Error while installing MySQL Ruby gem skie_knite007 Programming 5 07-12-2009 06:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration