*.exe from ruby file

328 views Asked by At

i'm using OCRA to make an exe from my ruby file. The .exe creation works without any error, but when i try to launch it, i got this :

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>'

So, as you can see I have a right issue on the files, but I don't know wich ones. Plus, I have an issue in one of the file (filename.rb) I included in my exe, but this one runs totally fine when I launch it alone...

So i don't really understand what is my problem over here. I'm on windows 7, using ruby 2.1.

If you could give me a tip about this, i would be really gratefully !

EDIT : the code

runThemAll.rb

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

filename1.rb

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

filname2.rb

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

The command line I use to make the exe :

ocra runThemAll.rb
0

There are 0 answers