Can't install gems, need root permission?

I've been trying to get tk working with Ruby for days and it's been a real PITA. I've managed to get it working on the command line:

irb
irb(main):001:0> require 'tk'
=> true
irb(main):002:0>

My program runs from the command line but not in RubyMine. In RM I get:

<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- tk (LoadError)

So I go in File/Settings/Ruby SDK and Gems and see that no Gems are installed.

I try to install tk_as_gem but get:

Following gems were not installed:

tk_as_gem (0.1.0):  Error installing tk_as_gem:

     ERROR: Failed to build gem native extension.  /usr/local/bin/ruby extconf.rb checking for ruby_native_thread_p() in ruby.h... yes checking for rb_errinfo() in ruby.h... yes checking for rb_safe_level() in ruby.h... yes checking for struct RArray.ptr in ruby.h... no checking for struct RArray.len in ruby.h... no checking for t_open() in -lnsl... no checking for socket() in -lsocket... no checking for dlopen() in -ldl... yes checking for log() in -lm... no checking for tcl.h... no checking for tcl.h in /usr/local/include,/usr/pkg/include,/usr/include,/Tcl/include,/usr/local/include/tcl8.4,/usr/pkg/include/tcl8.4,/usr/include/tcl8.4,/Tcl/include/tcl8.4,/usr/local/include/tcl8.7,/usr/pkg/include/tcl8.7,/usr/include/tcl8.7,/Tcl/include/tcl8.7,/usr/local/include/tcl8.6,/usr/pkg/include/tcl8.6,/usr/include/tcl8.6,/Tcl/include/tcl8.6,/usr/local/include/tcl8.5,/usr/pkg/include/tcl8.5,/usr/include/tcl8.5,/Tcl/include/tcl8.5,/usr/local/include/tcl8.3,/usr/pkg/include/tcl8.3,/usr/include/tcl8.3,/Tcl/include/tcl8.3,/usr/local/include/tcl8.2,/usr/pkg/include/tcl8.2,/usr/include/tcl8.2,/Tcl/include/tcl8.2,/usr/local/include/tcl8.1,/usr/pkg/include/tcl8.1,/usr/include/tcl8.1,/Tcl/include/tcl8.1,/usr/local/include/tcl8.0,/usr/pkg/include/tcl8.0,/usr/include/tcl8.0,/Tcl/include/tcl8.0,/usr/local/include/tcl7.6,/usr/pkg/include/tcl7.6,/usr/include/tcl7.6,/Tcl/include/tcl7.6... no checking for tk.h... no checking for tk.h in /usr/local/include,/usr/pkg/include,/usr/include,/Tcl/include,/usr/local/include/tk8.4,/usr/pkg/include/tk8.4,/usr/include/tk8.4,/Tcl/include/tk8.4,/usr/local/include/tk8.7,/usr/pkg/include/tk8.7,/usr/include/tk8.7,/Tcl/include/tk8.7,/usr/local/include/tk8.6,/usr/pkg/include/tk8.6,/usr/include/tk8.6,/Tcl/include/tk8.6,/usr/local/include/tk8.5,/usr/pkg/include/tk8.5,/usr/include/tk8.5,/Tcl/include/tk8.5,/usr/local/include/tk8.4,/usr/pkg/include/tk8.4,/usr/include/tk8.4,/Tcl/include/tk8.4,/usr/local/include/tk8.3,/usr/pkg/include/tk8.3,/usr/include/tk8.3,/Tcl/include/tk8.3,/usr/local/include/tk8.2,/usr/pkg/include/tk8.2,/usr/include/tk8.2,/Tcl/include/tk8.2,/usr/local/include/tk8.1,/usr/pkg/include/tk8.1,/usr/include/tk8.1,/Tcl/include/tk8.1,/usr/local/include/tk8.0,/usr/pkg/include/tk8.0,/usr/include/tk8.0,/Tcl/include/tk8.0,/usr/local/include/tk4.2,/usr/pkg/include/tk4.2,/usr/include/tk4.2,/Tcl/include/tk4.2... 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/bin/ruby     --with-tcl-framework-header     --without-tcl-framework-header     --with-tk-framework-header     --without-tk-framework-header     --with-tcltk-framework     --without-tcltk-framework     --enable-tcltk-framework     --disable-tcltk-framework     --enable-mac-tcltk-framework     --disable-mac-tcltk-framework     --with-nsllib     --without-nsllib     --with-socketlib     --without-socketlib     --with-dllib     --without-dllib     --with-mlib     --without-mlib     --with-tk-dir     --without-tk-dir     --with-tk-include     --without-tk-include=${tk-dir}/include     --with-tk-lib     --without-tk-lib=${tk-dir}/lib     --with-tcl-dir     --without-tcl-dir     --with-tcl-include     --without-tcl-include=${tcl-dir}/include     --with-tcl-lib     --without-tcl-lib=${tcl-dir}/lib     --with-X11-dir     --without-X11-dir     --with-X11-include     --without-X11-include=${X11-dir}/include     --with-X11-lib     --without-X11-lib=${X11-dir}/lib     --with-tk-lib     --without-tk-lib     --with-tcl-lib     --without-tcl-lib     --with-X11-lib     --without-X11-lib     --with-tklib     --without-tklib     --with-tcllib     --without-tcllib     --enable-tcltk_stubs     --disable-tcltk_stubs     --with-tcltk_stubs     --without-tcltk_stubs     --with-tcltkversion     --without-tcltkversion     --with-X11     --without-X11   Gem files will remain installed in /fs/home/rleblanc/.gem/ruby/1.9.1/gems/tk_as_gem-0.1.0 for inspection. Results logged to /net/nfs.xxxxxxx.com/home/rleblanc/.gem/ruby/1.9.1/gems/tk_as_gem-0.1.0/ext/gem_make.out

"Check the mkmf.log file for more details."

And just where might this be?

I'm thinking it's because I'm not root? I'm confused as to how to get this working. Everything seems to be installed but RubyMine can't see it? Do I need to set paths somewhere in RM or reinstall the Gems in RM? But when I do I get the fail. I was root to install them on the command line so I'm thinking that's why they fail to install in RM. How to install Gems in RM? Do I need to be root somehow? Everything is already installed I think. I don't think I need to install it again, but why can't RM see my tk?

thanks,
Rich

1 comment
Comment actions Permalink

Hi Rich,

Everything seems to be installed but RubyMine can't see it?

Where does it installed? Could you provide full path to gem folder. And also please add diagnostics info from RubyMine | Tools | Show Gem Environment dialog

0

Please sign in to leave a comment.