M
M
Matvey Mamonov2016-02-03 22:05:16
ruby
Matvey Mamonov, 2016-02-03 22:05:16

Ruby TK. How to make it work?

Guys, tell me, what could be the matter? I'm trying to make an example like in a book in which you need to connect tk, but it gives out this:

/home/matt/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- tk (LoadError)
  from /home/matt/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  from p001hello.rb:1:in `<main>'

Here is the code, nothing special. It is clear that this is the point (an extension, I don’t know how it’s called correctly):
require 'tk'

hello = TkRoot.new
TkLabel.new(hello) do
  text "\n Hello, Matz! \n"
  pack
end
Tk.mainloop

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mlwrm, 2016-02-03
@eucalipt

Matvey Mamonov did you install the corresponding gem (gem install tk)? If yes, then try to execute
bundle exec ruby
​​application_name.rb In general, if you want to create an interface, then I liked the shoes (greenshoes or redshoes) more

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question