N
N
Nazar Jeveling2014-06-16 20:42:01
ruby
Nazar Jeveling, 2014-06-16 20:42:01

Can't compile tkImg from Tk package for Ruby on Ubuntu 14.04?

And now in more detail. I needed a Tk toolkit for Ruby.
I installed it via sudo apt-get install libtcltk-ruby.
At first everything worked, but when it was necessary to use it, it require "tkextlib/tkimg/jpeg"gives errors:

/usr/lib/ruby/1.9.1/tk/package.rb:86:in `rescue in require': TkPackage can't find package img::jpeg (RuntimeError)
  from /usr/lib/ruby/1.9.1/tk/package.rb:83:in `require'
  from /usr/lib/ruby/1.9.1/tkextlib/tkimg/jpeg.rb:14:in `<top (required)>'
  from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /home/xo8bit/RubymineProjects/test/my_test.rb:4:in `<top (required)>'
  from -e:1:in `load'
  from -e:1:in `<main>'

I found the tkimg1.4.tar.gz package separately , but I need to build it myself, I have no experience in building / compiling, after reading the manuals on the Ubuntu forum a little, I tried:
./configure
./make

and many other methods, but nothing came of it. Please help solve the original problem with Tk in Ruby. And poke your nose if the second one has already been decided somewhere.
PS Here is what irb outputs
irb(main):002:0> require "tkextlib/tkimg/jpeg"
RuntimeError: TkPackage can't find package img::jpeg
  from /usr/lib/ruby/1.9.1/tk/package.rb:86:in `rescue in require'
  from /usr/lib/ruby/1.9.1/tk/package.rb:83:in `require'
  from /usr/lib/ruby/1.9.1/tkextlib/tkimg/jpeg.rb:14:in `<top (required)>'
  from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from (irb):2
  from /usr/bin/irb:12:in `<main>'

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mikhail Alekseev, 2014-06-16
@Fandorin

Try to put
sudo apt-get install libjpeg libjpeg-dev

N
Nazar Jeveling, 2014-06-16
@xo8bit

libjpeg-dev installed, libjpeg not found. The error is still here:

/usr/lib/ruby/1.9.1/tk/package.rb:86:in `rescue in require': TkPackage can't find package img::jpeg (RuntimeError)
  from /usr/lib/ruby/1.9.1/tk/package.rb:83:in `require'
  from /usr/lib/ruby/1.9.1/tkextlib/tkimg/jpeg.rb:14:in `<top (required)>'
  from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /home/xo8bit/RubymineProjects/test/my_test.rb:4:in `<top (required)>'
  from -e:1:in `load'
  from -e:1:in `<main>'

A
Alexey Shein, 2014-12-01
@conf

See a similar problem here: https://www.ruby-forum.com/topic/4414548
As far as I could understand, the problem is that extensions from tkextlib/must be installed separately, or that the standard delivery of extensions from tcl is incomplete and it overwrites the one that is placed through the gem. You can check support with the command

ruby C:/Ruby193/lib/ruby/1.9.1/tkextlib/pkg_checker.rb
(substitute the desired path to your version of ruby)
More details in English. via the link above. Good luck.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question