0

ルビーファイルからexeを作成するためにOCRAを使用しています。.exe の作成はエラーなしで機能しますが、起動しようとすると、次のようになります。

C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `chdir': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)

        No such file or directory @ dir_chdir - C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/gems/2.1.0/gems/json-1.8.2/ext/json/ext/generator

Gem files will remain installed in C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/gems/2.1.0/gems/json-1.8.2 for inspection.
Results logged to C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/json-1.8.2/gem_make.out
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `block in build_extension'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `synchronize'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `build_extension'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_extensions'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/specification.rb:1436:in `block in build_extensions'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/user_interaction.rb:45:in `use_ui'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/specification.rb:1434:in `build_extensions'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/stub_specification.rb:60:in `build_extensions'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/specification.rb:925:in `block in find_inactive_by_path'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/specification.rb:924:in `each'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/specification.rb:924:in `find'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/specification.rb:924:in `find_inactive_by_path'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems.rb:185:in `try_activate'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
    from filename.rb:1:in `<top (required)>'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/src/runThemAll.rb:3:in `load'
    from C:/Users/XX/AppData/Local/Temp/ocr81CD.tmp/src/runThemAll.rb:3:in `<main>'

ご覧のとおり、ファイルに正しい問題がありますが、どのファイルかわかりません。さらに、exeに含めたファイル(filename.rb)の1つに問題がありますが、これは単独で起動するとまったく問題なく動作します...

だから私はここで私の問題が何であるかを本当に理解していません。Ruby 2.1を使用して、Windows 7を使用しています。

これについてのヒントを教えていただければ、本当にありがたく思います。

編集:コード

runThemAll.rb

$:.unshift File.dirname($0)
load 'filename.rb'
load 'filename2.rb'
require 'securerandom'

ファイル名1.rb

require 'Watir'
require 'csv'
require 'mechanize'
#here some code

フィルム名2.rb

require 'Watir'
require 'csv'
require 'mechanize'
#here some code too

exeを作成するために使用するコマンドライン:

ocra runThemAll.rb
4

0 に答える 0