Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Скриптовые языки программирования > Ruby
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 19.11.2016, 19:45   #1
Antibreez
Новичок
Джуниор
 
Регистрация: 19.11.2016
Сообщений: 1
По умолчанию Ocra и Ruby

Пытаюсь скомпелировать exe приложение из руби при помощи ocra. Самый простой скрипт превращается в exe без проблем. А теперь мой скрипт включает Tk и ничего не выходит.
Скрипт:
-----------------------------------------------------------------------
Код:
require 'tk'
require 'tkextlib/tile'

root = TkRoot.new {title "Feet to Meters"}
content = Tk::Tile::Frame.new(root) {padding "3 3 12 12"}.grid( :sticky => 'nsew')
TkGrid.columnconfigure root, 0, :weight => 1; TkGrid.rowconfigure root, 0, :weight => 1

$feet = TkVariable.new; $meters = TkVariable.new
f = Tk::Tile::Entry.new(content) {width 7; textvariable $feet}.grid( :column => 2, :row => 1, :sticky => 'we' )
Tk::Tile::Label.new(content) {textvariable $meters}.grid( :column => 2, :row => 2, :sticky => 'we');
Tk::Tile::Button.new(content) {text 'Calculate'; command {calculate}}.grid( :column => 3, :row => 3, :sticky => 'w')

Tk::Tile::Label.new(content) {text 'feet'}.grid( :column => 3, :row => 1, :sticky => 'w')
Tk::Tile::Label.new(content) {text 'is equivalent to'}.grid( :column => 1, :row => 2, :sticky => 'e')
Tk::Tile::Label.new(content) {text 'meters'}.grid( :column => 3, :row => 2, :sticky => 'w')

TkWinfo.children(content).each {|w| TkGrid.configure w, :padx => 5, :pady => 5}
f.focus
root.bind("Return") {calculate}

def calculate
  begin
     $meters.value = (0.3048*$feet*10000.0).round()/10000.0
  rescue
     $meters.value = ''
  end
end

Tk.mainloop
-----------------------------------------------------------------------------
А вот что получаю в консоли:
-----------------------------------------------------------------------------
Код:
C:\Users\Anton\Desktop\Programs>ocra test.rb
=== Loading script to check dependencies
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Pack
=== WARNING: #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Pack was defined autoloadable, but caused NameError
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Place
=== WARNING: #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Place was defined autoloadable, but caused NameError
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Canvas
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::CheckButton
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::LabelFrame
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Listbox
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Menu
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Message
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::PanedWindow
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Scale
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Scrollbar
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Spinbox
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Text
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Toplevel
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Clock
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::OptionObj
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::Fontchooser
=== Attempting to trigger autoload of #<Class:#<Tk::Tile::TEntry:0x000000051bd438>>::MacResource
C:/Ruby23-x64/lib/ruby/2.3.0/tk/macpkg.rb:42:in `<module:MacResource>': RuntimeError (RuntimeError)
        from C:/Ruby23-x64/lib/ruby/2.3.0/tk/macpkg.rb:31:in `<top (required)>'
        from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ocra-1.3.6/bin/ocra:477:in `const_get'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ocra-1.3.6/bin/ocra:477:in `block (3 levels) in attempt_load_autoload'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ocra-1.3.6/bin/ocra:471:in `each'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ocra-1.3.6/bin/ocra:471:in `block (2 levels) in attempt_load_autoload'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ocra-1.3.6/bin/ocra:469:in `each'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ocra-1.3.6/bin/ocra:469:in `block in attempt_load_autoload'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ocra-1.3.6/bin/ocra:463:in `loop'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ocra-1.3.6/bin/ocra:463:in `attempt_load_autoload'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ocra-1.3.6/bin/ocra:715:in `build_exe'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ocra-1.3.6/bin/ocra:1177:in `block in <top (required)>'
--------------------------------------------------------------------------------
Может кто подскажет в чем проблема?

Последний раз редактировалось Alex11223; 19.11.2016 в 20:00.
Antibreez вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Ruby Илья94 Ruby 1 02.09.2013 21:36
Ruby (Руби) Владисла8 Фриланс 4 19.11.2012 13:15
Ruby Владисла8 Фриланс 3 11.10.2012 10:26
из Ruby в Си++ Invis999 Помощь студентам 4 20.07.2009 20:20