Giter VIP home page Giter VIP logo

ocra's Introduction

ocra

home :: https://github.com/larsch/ocra/

issues :: http://github.com/larsch/ocra/issues

forum :: http://groups.google.com/group/ruby-ocra

Description

OCRA (One-Click Ruby Application) builds Windows executables from Ruby source code. The executable is a self-extracting, self-running executable that contains the Ruby interpreter, your source code and any additionally needed ruby libraries or DLL.

Features

  • LZMA Compression (optional, default on)
  • Both windowed/console mode supported
  • Includes gems based on usage, or from a Bundler Gemfile

Problems & Bug Reporiting

  • Windows support only

If you experience problems with OCRA or have found a bug, please use the issue tracker on GitHub (http://github.com/larsch/ocra/issues). You can also join the Google Group discussion forum to ask questions and get help (http://groups.google.com/group/ruby-ocra).

Installation

Gem:

gem install ocra

Alternatively you can download the gem at either http://rubygems.org/gems/ocra or https://github.com/larsch/ocra/releases/.

Stand-alone Version: Get ocrasa.rb from https://github.com/larsch/ocra/releases/. Requires nothing but a working Ruby installation on Windows.

Synopsis

Building an executable:

ocra script.rb

Will package script.rb, the Ruby interpreter and all dependencies (gems and DLLs) into an executable named script.exe.

Command line:

ocra [options] script.rb [<other files> ...] [-- <script arguments> ...]

Options:

ocra --help

Ocra options:

--help             Display this information.
--quiet            Suppress output while building executable.
--verbose          Show extra output while building executable.
--version          Display version number and exit.

Packaging options:

--dll dllname      Include additional DLLs from the Ruby bindir.
--add-all-core     Add all core ruby libraries to the executable.
--gemfile <file>   Add all gems and dependencies listed in a Bundler Gemfile.
--no-enc           Exclude encoding support files

Gem content detection modes:

--gem-minimal[=gem1,..]  Include only loaded scripts
--gem-guess=[gem1,...]   Include loaded scripts & best guess (DEFAULT)
--gem-all[=gem1,..]      Include all scripts & files
--gem-full[=gem1,..]     Include EVERYTHING
--gem-spec[=gem1,..]     Include files in gemspec (Does not work with Rubygems 1.7+)

--[no-]gem-scripts[=..]  Other script files than those loaded
--[no-]gem-files[=..]    Other files (e.g. data files)
--[no-]gem-extras[=..]   Extra files (README, etc.)

Gem modes:

  • minimal: loaded scripts
  • guess: loaded scripts and other files
  • all: loaded scripts, other scripts, other files (except extras)
  • full: Everything found in the gem directory

File groups:

  • scripts: .rb/.rbw files
  • extras: C/C++ sources, object files, test, spec, README
  • files: all other files

Auto-detection options:

--no-dep-run       Don't run script.rb to check for dependencies.
--no-autoload      Don't load/include script.rb's autoloads.
--no-autodll       Disable detection of runtime DLL dependencies.

Output options:

--output <file>    Name the exe to generate. Defaults to ./<scriptname>.exe.
--no-lzma          Disable LZMA compression of the executable.
--innosetup <file> Use given Inno Setup script (.iss) to create an installer.

Executable options:

--windows          Force Windows application (rubyw.exe)  
--console          Force console application (ruby.exe)  
--chdir-first      When exe starts, change working directory to app dir.  
--icon <ico>       Replace icon with a custom one.  
--debug            Executable will be verbose.  
--debug-extract    Executable will unpack to local dir and not delete after.  

Compilation:

  • OCRA will load your script (using Kernel#load) and build the executable when it exits.

  • Your program should 'require' all necessary files when invoked without arguments, so OCRA can detect all dependencies.

  • DLLs are detected automatically but only those located in your Ruby installation are included.

  • .rb files will become console applications. .rbw files will become windowed application (without a console window popping up). Alternatively, use the --console or --windows options.

Running your application:

  • The 'current working directory' is not changed by OCRA when running your application. You must change to the installation or temporary directory yourself. See also below.
  • When the application is running, the OCRA_EXECUTABLE environment variable points to the .exe (with full path).
  • The temporary location of the script can be obtained by inspected the $0 variable.
  • OCRA does not set up the include path. Use $:.unshift File.dirname($0) at the start of your script if you need to 'require' additional source files from the same directory as your main script.

Pitfalls:

  • Avoid modifying load paths at run time. Specify load paths using -I or RUBYLIB if you must, but don't expect OCRA to preserve them for runtime. OCRA may pack sources into other directories than you expect.
  • If you use .rbw files or the --windows option, then check that your application works with rubyw.exe before trying with OCRA.
  • Avoid absolute paths in your code and when invoking OCRA.

REQUIREMENTS:

  • Windows
  • Working Ruby installation.
  • MinGW Installation (when working with the source code only)

Stand-alone version

Get ocrasa.rb from http://rubyforge.org/frs/?group_id=8185. Requires nothing but a working Ruby installation on Windows.

Technical details

OCRA first runs the target script in order to detect any files that are loaded and used at runtime (Using Kernel#require and Kernel#load).

OCRA embeds everything needed to run a Ruby script into a single executable file. The file contains the .exe stub which is compiled from C-code, and a custom opcode format containing instructions to create directories, save files, set environment variables and run programs. The OCRA script generates this executable and the instructions to be run when it is launched.

When executed, the OCRA stub extracts the Ruby interpreter and your scripts into a temporary directory. The directory will contains the same directory layout as your Ruby installlation. The source files for your application will be put in the 'src' subdirectory.

Libraries

Any code that is loaded through Kernel#require when your script is executed will be included in the OCRA executable. Conditionally loaded code will not be loaded and included in the executable unless the code is actually run when OCRA invokes your script. Otherwise, OCRA won't know about it and will not include the source files.

RubyGems are handled specially. Whenever a file from a Gem is detected, OCRA will attempt to include all the required files from that specific Gem, expect some unlikely needed files such as readme's and other documentation. This behaviour can be controlled by using the --gem-* options. Behaviour can be changed for all gems or specific gems using --gem-*=gemname.

Libraries found in non-standard path (for example, if you invoke OCRA with "ruby -I some/path") will be placed into the site dir (lib/ruby/site_ruby). Avoid changing $LOAD_PATH or $: from your script to include paths outside your source tree, since OCRA may place the files elsewhere when extracted into the temporary directory.

In case your script (or any of its dependencies) sets up autoloaded module using Kernel#autoload, OCRA will automatically try to load them to ensure that they are all included in the executable. Modules that doesn't exist will be ignored (a warning will be logged).

Dynamic link libraries (.dll files, for example WxWidgets, or other source files) will be detected and included by OCRA.

Including libraries non-automatically

If an application or framework is complicated enough that it tends to confuse Ocra's automatic dependency resolution, then you can use other means to specify what needs to be packaged with your app.

To disable automatic dependency resolution, use the --no-dep-run option; with it, Ocra will skip executing your program during the build process. This on the other hand requires using --gem-full option (see more below); otherwise Ocra will not include all the necessary files for the gems.

You will also probably need to use the --add-all-core option to include the Ruby core libraries.

If your app uses gems, then you can specify them in a Bundler (http://gembundler.com) Gemfile, then use the --gemfile option to supply it to Ocra. Ocra will automatically include all gems specified, and all their dependencies.

(Note: This assumes that the gems are installed in your system, not locally packaged inside the app directory by "bundle package")

These options are particularly useful for packaging Rails applications. For example, to package a Rails 3 app in the directory "someapp" and create an exe named "someapp.exe", without actually running the app during the build, you could use the following command:

ocra someapp/script/rails someapp --output someapp.exe --add-all-core \
--gemfile someapp/Gemfile --no-dep-run --gem-full --chdir-first -- server

Note the space between -- and server! It's important; server is an argument to be passed to rails when the script is ran.

Rails 2 apps can be packaged similarly, though you will have to integrate them with Bundler (http://gembundler.com/rails23.html) first.

Gem handling

By default, Ocra includes all scripts that are loaded by your script when it is run before packaging. Ocra detects which gems are using and includes any additional non-script files from those gems, except trivial files such as C/C++ source code, object files, READMEs, unit tests, specs, etc.

This behaviour can be changed by using the --gem-* options. There are four possible modes:

  • minimal: Include only loaded scripts
  • guess: Include loaded scripts and important files (DEFAULT)
  • all: Include all scripts and important files
  • full: Include all files

If you find that files are missing from the resulting executable, try first with --gem-all=gemname for the gem that is missing, and if that does not work, try --gem-full=gemname. The paranoid can use --gem-full to include all files for all required gems.

Creating an installer for your application

To make your application start up quicker, or to allow it to keep files in its application directory between runs, or if you just want to make your program seem more like a "regular" Windows application, you can have Ocra generate an installer for your app with the free Inno Setup software.

You will first have to download and install Inno Setup 5 or later, and also add its directory to your PATH (so that Ocra can find the ISCC compiler program). Once you've done that, you can use the --innosetup option to Ocra to supply an Inno Setup script. Do not add any [Files] or [Dirs] sections to the script; Ocra will figure those out itself.

To continue the Rails example above, let's package the Rails 3 app into an installer. Save the following as someapp.iss:

[Setup] AppName=SomeApp AppVersion=0.1 DefaultDirName={pf}\SomeApp DefaultGroupName=SomeApp OutputBaseFilename=SomeAppInstaller

[Icons] Name: "{group}\SomeApp"; Filename: "{app}\someapp.exe" Name: "{group}\Uninstall SomeApp"; Filename: "{uninstallexe}"

Then, run Ocra with this command:

ocra someapp/script/rails someapp --output someapp.exe --add-all-core \
--gemfile someapp/Gemfile --no-dep-run --gem-full --chdir-first --no-lzma \
--innosetup someapp.iss -- server

If all goes well, a file named "SomeAppInstaller.exe" will be placed into the Output directory.

Environment variables

OCRA executables clear the RUBYLIB environment variable before your script is launched. This is done to ensure that your script does not use load paths from the end user's Ruby installation.

OCRA executables set the RUBYOPT environment variable to the value it had when you invoked OCRA. For example, if you had "RUBYOPT=rubygems" on your build PC, OCRA ensures that it is also set on PC's running the executables.

OCRA executables set OCRA_EXECUTABLE to the full path of the executable, for example

ENV["OCRA_EXECUTABLE"] # => C:\Program Files\MyApp\MyApp.exe

Working directory

The OCRA executable does not change the working directory when it is launched, unless you use the --chdir-first option.

You should not assume that the current working directory when invoking an executable built with .exe is the location of the source script. It can be the directory where the executable is placed (when invoked through the Windows Explorer), the users' current working directory (when invoking from the Command Prompt), or even C:\\WINDOWS\\SYSTEM32 when the executable is invoked through a file association.

With the --chdir-first option, the working directory will always be the common parent directory of your source files. This should be fine for most applications. However, if your application is designed to run from the command line and take filenames as arguments, then you cannot use this option.

If you wish to maintain the user's working directory, but need to require additional Ruby scripts from the source directory, you can add the following line to your script:

$LOAD_PATH.unshift File.dirname($0)

Load path mangling

Adding paths to $LOAD_PATH or $: at runtime is not recommended. Adding relative load paths depends on the working directory being the same as where the script is located (See above). If you have additional library files in directories below the directory containing your source script you can use this idiom:

$LOAD_PATH.unshift File.join(File.dirname($0), 'path/to/script')

Detecting

You can detect whether OCRA is currently building your script by looking for the 'Ocra' constant. If it is defined, OCRA is currenly building the executable from your script. For example, you can use this to avoid opening a GUI window when compiling executables:

app = MyApp.new
app.main_loop unless defined?(Ocra)

Additional files and resources

You can add additional files to the OCRA executable (for example images) by appending them to the command line. They should be placed in the source directory with your main script (or a subdirectory).

ocra mainscript.rb someimage.jpeg docs/document.txt

This will create the following layout in the temporary directory when your program is executed:

src/mainscript.rb
src/someimage.jpeg
src/docs/document.txt

Both files, directoriess and glob patterns can be specified on the command line. Files will be added as-is. If a directory is specified, OCRA will include all files found below that directory. Glob patterns (See Dir.glob) can be used to specify a specific set of files, for example:

ocra script.rb assets/**/*.png

Command Line Arguments

To pass command line argument to your script (both while building and when run from the resulting executable), specify them after a -- marker. For example:

ocra script.rb -- --some-options=value

This will pass --some-options=value to the script when build and when running the executable. Any extra argument specified by the user when invoking the executable will be appended after the compile-time arguments.

Window/Console

By default, OCRA builds console application from .rb-files and windowed applications (without console window) from .rbw-files.

Ruby on Windows provides two executables: ruby.exe is a console mode application and rubyw.exe is a windowed application which does not bring up a console window when launched using the Windows Explorer. By default, or if the --console option is used, OCRA will use the console runtime (ruby.exe). OCRA will automatically select the windowed runtime when your script has the ".rbw" extension, or if you specify the --windows command line option.

If your application works in console mode but not in windowed mode, first check if your script works without OCRA using rubyw.exe. A script that prints to standard output (using puts, print etc.) will eventually cause an exception when run with rubyw.exe (when the IO buffers run full).

You can also try wrapping your script in an exception handler that logs any errors to a file:

begin
  # your script here
rescue Exception => e
  File.open("except.log") do |f|
    f.puts e.inspect
    f.puts e.backtrace
  end
end

CREDITS:

Thanks for Igor Pavlov for the LZMA compressor and decompressor. The source code used was place into Public Domain by Igor Pavlov.

Erik Veenstra for rubyscript2exe which provided inspiration.

Dice for the default .exe icon (vit-ruby.ico, http://ruby.morphball.net/vit-ruby-ico_en.html)

LICENSE:

(The MIT License)

Copyright (c) 2009-2020 Lars Christensen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

ocra's People

Contributors

davidmikesimon avatar jcangas avatar karhatsu avatar kimhmadsen avatar larsch avatar octopushugs avatar saintpeter avatar siu avatar tac0x2a avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ocra's Issues

Splash screen

The startup time of Ruby on Windows is slower than on Linux or OSX. Sometimes it may take up couple of seconds for the initial window to show.

A nice feature would be to have a --splash option for Rubyw.exe applications.
The splash parameter would simply accept a path to an image.

"Failed to create directory" with require "./.." and "../"

Hello, I have a problem when I try to run my exe.

Here is the code :
require "./../functions.rb"

This code bugs too (same bug) :
require "../functions.rb"

run resulting test.exe =>
Failed to create directory 'C:\DOCUME1\KINGKA1\LOCALS~1\Temp\ocr3ED.tmp\lib\ru
by\site_ruby\1.8.'.

When I compile the following code, I get a warning.
code : require "../functions.rb"
warning : === WARNING: Detected a relative require (../functions.rb). This is not recommended.

When I compile the following code, I get no warning.
code : require "./../functions.rb"
warning : /

ocra v. 1.2.0 (installed today with gem install ocra)
Windows XP pro SP3

ruby -v =>
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]

RubyGems Environment:

  • RUBYGEMS VERSION: 1.3.7
  • RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]
  • INSTALLATION DIRECTORY: C:/Ruby/lib/ruby/gems/1.8
  • RUBY EXECUTABLE: C:/Ruby/bin/ruby.exe
  • EXECUTABLE DIRECTORY: C:/Ruby/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86-mingw32
  • GEM PATHS:
    • C:/Ruby/lib/ruby/gems/1.8
    • C:/Documents and Settings/King Kadelfek/.gem/ruby/1.8
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

Packaging on multiple files (like Py2Exe)

Hello,

I would like to know if there is a plan to add an option to package the files to multiples files instead of on big file that require decompression at each launch (slow).

I'm looking for something like what provides Py2exe, it creates an archive containing the (compiled) scripts, and include required .dll and binaries files to run the program (ruby interpreter, native libraries, etc).

This would also make updating easer, by allowing updating only modified files.

Is this planed ? Would it be hard ?

Thank you

jRuby

It appears as though jRuby is conflicting with ocra in some way, i was unable to compile anything until i completely uninstalled jruby.

Just a heads up if you're using both.

Ocra fails when script is in a path with funky characters

  • Ocra 1.3.0
  • Ruby 1.9.2p180 (2011-02-18) [i386-mingw32]
  • Windows XP SP2
  • system encoding Windows-1250, console encoding CP852

Ocra fails when the script it's supposed to compile is in a path containing non-ASCII characters - precisely, this one: ń (I haven't checked any others) . It worked perfectly when I moved everything into another directory without this character.

The error message is:

C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:54:in `subpath?': incomp
atible encoding regexp match (ISO-8859-2 regexp with Windows-1250 string) (Encod
ing::CompatibilityError)
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:485:in `blo
ck in find_load_path'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:485:in `sel
ect'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:485:in `fin
d_load_path'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:728:in `blo
ck in build_exe'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:727:in `eac
h'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:727:in `bui
ld_exe'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:1138:in `bl
ock in <top (required)>'

I've added some debugging into ocra file, here are the values of loadpaths and feature variables in Ocra.find_load_path just before the crash:

loadpaths: [C:/Ruby192/lib/ruby/gems/1.9.1/gems/markaby-0.7.2/lib, <redacted>/...ń.../<redacted>/warlight tools, C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/lib, C:/Ruby192/lib/ruby/gems/1.9.1/gems/progressbar-0.9.1/lib, C:/Ruby192/lib/ruby/gems/1.9.1/gems/savage-1.1.5/lib, C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.0-x86-mingw32/lib, C:/Ruby192/lib/ruby/gems/1.9.1/gems/builder-3.0.0/lib, C:/Ruby192/lib/ruby/gems/1.9.1/gems/markaby-0.7.2/lib, C:/Ruby192/lib/ruby/site_ruby/1.9.1, C:/Ruby192/lib/ruby/site_ruby/1.9.1/i386-msvcrt, C:/Ruby192/lib/ruby/site_ruby, C:/Ruby192/lib/ruby/vendor_ruby/1.9.1, C:/Ruby192/lib/ruby/vendor_ruby/1.9.1/i386-msvcrt, C:/Ruby192/lib/ruby/vendor_ruby, C:/Ruby192/lib/ruby/1.9.1, C:/Ruby192/lib/ruby/1.9.1/i386-mingw32]

feature: <redacted>/...ń.../<redacted>/warlight tools/tools/extensions.rb

I suppose the Ocra::Pathname class could just convert all input to UTF-8 under Ruby 1.9?

The script in question is here: https://github.com/MatmaRex/Warlight-Tools

The precise command I ran is: ocra connection_uploader.rb tools\*.

Doesn't like tk gem

Running on windows 7, under the ruby one click installer. ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]

I have tried this with both ocra 1.2.0 and 1.3.0, and with both ruby 1.8.7 and 1.9.1/2

requiring the tk gem causes lots of failures. Just for fun I started putting rescues around the failure points in the tk code, but it just went on and on. (note removing the require 'tk' allows the exe to be created) Note also none of the tk code is being called. Its just requiring the gem that is causing the problems.

Here are some samples:

=== Loading script to check dependencies
C:/Ruby192/lib/ruby/1.9.1/tk/console.rb:13:in _create_console': interpreter is deleted (RuntimeError) from C:/Ruby192/lib/ruby/1.9.1/tk/console.rb:13:increate'
from C:/Ruby192/lib/ruby/1.9.1/tk/console.rb:15:in `module:TkConsole'

def self.create
TkCore::INTERP._create_console # LINE 13 #
end
self.create # initialize console

putting a rescue at line 13 gets us to:

=== Loading script to check dependencies
C:/Ruby192/lib/ruby/1.9.1/tk/msgcat.rb:24:in <class:TkMsgCatalog>': RuntimeErro r (RuntimeError) from C:/Ruby192/lib/ruby/1.9.1/tk/msgcat.rb:8:in<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467:in `con
st_get'

tk_call_without_enc('package', 'require', 'Tcl', '8.2') # Line 24 #

this problem is repeated a bunch of places in msgcat

and on it goes...

Facing Error while creating exe- Undefined method full_name

Command Used:
ocra projname\script\rails projname --output iscrm.exe --add-all-core --gemfile projname\Gemfile --no-dep-run --chdir-first --gem-all --windows --no-lzma --innosetup iscrm.iss -- server

This is the error i'm facing

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:623:in block in find_gem_files': undefined methodfull_name' for nil:NilClass (NoMethodError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin
/ocra:581:in each' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin /ocra:581:infind_gem_files'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin
/ocra:701:in build_exe' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin /ocra:1138:inblock in <top (required)>'

Full details can be found here:
http://paste.debian.net/175275/

Please someone help me to solve this issue.

Include all files from custom-built Gems

Currently, OCRA will only include files that are listed in the Manifest of a gem (i.e. files that are installed by the Gem). Any files generated while installing, e.g. if the Gem is compiled using the DevKit are not currently included with the executable.

As a workaround, you can specify the extra needed files on the command line when invoking OCRA.

Ocra 1.2.0 fails to load 'prawn' gem

Env: Window XP SP3, ruby 1.9.2 installed using rubyinstaller

Package a script which required the 'rake' gem. Ocra ran fine with no error message. When I tried to invoke the executable I received the following message:
C:/DOCUME1/Owner/LOCALS1/Temp/ocr28.tmp/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36: in 'require' no such file to load --- prawn (LoadError) .

from C:/DOCUME~/owner/LOCALS~//Temp/ocr28.tmp/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 'require' rom C:/DOCUME~/owner/LOCALS~//Temp/ocr28.tmp/src/df_dda.rb:22:in

'

Examination of ocra's output reveals that only the following lines contained "prawn"

a lib/ruby/gems/1.9.1/specifications/prawn-0.11.1.gemspec --- appears twice

m lib/ruby/gems/1.9.1/prawn-0.11.1/
a lib/ruby/gems/1.9.1/prawn-0.11.1/COPYING
a lib/ruby/gems/1.9.1/prawn-0.11.1/HACKING
a lib/ruby/gems/1.9.1/prawn-0.11.1/LICENSE
a lib/ruby/gems/1.9.1/prawn-0.11.1/README

no listing of rb files for the prawn gem.

Use the following program which replicates the problem.

require 'prawn'

puts "Hello world"

the specifications list pdf_reader-0.9.1.gemspec, Ascii85-1.0.0.gemspec, and ttfunk-1.0.1.gemspec as prawn dependencies.
Only pdf_reader rb files are listed in ocra's output.

Assistance in solving this problem is appreciated.

Thank you
Bernard Kenik

Specifying gemspec in the Gemfile doesn't seem to work.

If I use 'gemspec' in the Gemfile to reference the gems in the myapp.gemspec file...

source 'https://rubygems.org'
gemspec

...ocra fails with the following error...

C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.1/bin/ocra:639:in `block in find_gem_files': undefined
method `full_name' for nil:NilClass (NoMethodError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.1/bin/ocra:597:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.1/bin/ocra:597:in `find_gem_files'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.1/bin/ocra:716:in `build_exe'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.1/bin/ocra:1153:in `block in <top (required)>'

If I explicitly add the gems in the Gemfile all is well.

source 'https://rubygems.org'

gem 'ruport', '>= 1.6.3'
gem 'sqlite3'
gem 'activerecord', '>= 3.2.3'
gem 'memcache-client'

I'm using the following command to build the exe.

ocra --no-autoload --dll sqlite3.dll --gemfile Gemfile --console bin\myapp

Thanks!

--gemfile produces deprecation warnings

NOTE: Gem::Specification#installation_path is deprecated, use base_dir. It will be removed on or after 2011-10-01.
Gem::Specification#installation_path called from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:557.

Feature request: ocra script.rb ++ --some-options=value

This shall pass “—some-options=value” to the script when build, however not when running the executable. Any arguments specified by the user when invoking the executable shall be used as arguments during execution. The compile time arguments shall be ignored during execution time.


I have the problem that our script needs some options at compile time, however at runtime the complietime options shall not be present. Thus I suggest above build time commandline marker "++" similar to the already available commandline marker "--".

open a file inside a directorystructure

I got a simple app like this:

ocra_text.rb
gfx\man.png
src\game_objects.rb

Packing with "ocra ocra_text.rb src/game_objects.rb gfx/man.png"
According to the output both files are found/added. (src/ is added to both paths)

Packing works fine, then I try it out on another Vista-machine and this line inside game_objects.rb fails cause it cant find the file:

@image = Image.new($screen, File.join("gfx", "man.png"))

So I try with the tip from the README with:

@image = Image.new($screen, File.join(File.dirname(FILE), "gfx", "man.png"));

Now the ocra-packing fails, it cant find the file:

.
=== Compressing
=== Finished (Final size was 776919)
./src/game_objects.rb:29:in `initialize': While opening ./src/gfx/man.png, the following error occur
(RuntimeError)annot find the path specified.
.
.

I'm confused how to open files in my script to get both packing and executing on a new machine to work..

OSX Support

It would be nice for OCRA to support building one click applications on OSX as well. I, the author (larsch) do not have any experience with OSX development (nor do I have to an OSX installation), so if anyone is up to the task, feel free to contact me.

The primary task is to write the stub executable for OSX, or rewrite the existing one in a portable manner (it's currently highly Windows-specific). The main Ocra script may also need minor tweaks to handle platform differences.

gem spec problem

The gemspec has the following line:

 s.date = %q{2011-06-19 00:00:00.000000000Z}

which is causing problems with latest rubygems

$ gem -v
Invalid gemspec in [c:/Ruby187/lib/ruby/gems/1.8/specifications/ocra-1.3.0.gemspec]: invalid date format in specification: "2011-06-19 00:00:00.000000000Z "
Invalid gemspec in [c:/Ruby187/lib/ruby/gems/1.8/specifications/win32-autogui-0.5.0.gemspec]: invalid date format in specification: "2011-08-17 00:00:00.000000000Z"
 1.8.8

Couple of other gems are having the same problem... seems like there was a buggy rubygems floating around.

For now I am just editing the gemspec to remove the 00.00...Z and problem goes away.

simply enlist needed files

Given the time needed to unpack the files in a temp directory at each run, it would be fine to add support for 2 distribution cases:
1 - unpack in USERDATA dir if not already present or run from already unpacked location;
2 - simply allow ocra to list needed files: one can then zip them or build an NSIS installer and then make a shortcut to $INSTALLDIR\bin\ruby.exe $INSTALLDIR\src\whatever.rb... this will avoid unpacking delay.

However, thank you very much: great tool.
Federico

Additional file inclusion

Hi Lars,
I have an application of the form:-

main.rb
gen_lib.rb
libs/lib1.rb
libs/lib2.rb

With the libs "required" in the main.rb

running "ruby ocrasa.rb main.rb" runs fine and gen_lib and lib1 etc are included in the build time run. however the subfoldered libs appear to be missing from the .exe which fails due to their lack. the gen_lib located in the root is fine.

This with:-
$LOAD_PATH.unshift File.join(File.dirname($0), 'path/to/script')
set

Using Ocrasa.rb 1.2

this behaviour doesn't seem to match the description in the section "Additional files and resources" in "http://ocra.rubyforge.org/"

cora convert script to executable file problems

Used the cora convert the script which coding by GUI (require gtk2) to executable file.
It can create a exe file, but the exe file can't work

it show below message:

internal:lib/rubygems/custom_require>:29:in 'require':no such file to load --gtk2(LoadError)
from internal:lib/rubygems/custom_require:29:in 'require'
from C:/DOCUME1/CHUNCH1/LOCALS~1/Temp/ocr3C.tmp/src/GUI_try0609_3rbw:6:in '

'

How to fix the problems?

Thanks,

icon only working on smallest icon size

In Windows 7 with ruby version 1.9.2 and ocra version 1.3.0 (update: just updated gem to 1.3.1 and issue still occurs).

I can add an icon using the --icon flag but even though the icon has multiple sizes in it only the smallest size works (in windows the "small icon" or "detail" view).

If it try the "medium" or "large" views the icon defaults back to the standard ruby image.

I have tried multiple .ico files as well.

uninitialized constant Params::YAML -- in ocra-ized exe, but not elsewhere

I am getting this error -- uninitialized constant Params::YAML -- in a .exe generated by ocra. It works fine as plain ruby and in netbeans debugger. To make it worse, it used to work in the exe too, but suddenly stopped. What could I ahve done. I was not require-ing 'yaml' but I added that, to no avail. The statement it hangs on is...

@ph = YAML::load_file( @param_file)

... but as I said, only in the .exe generated by ocra.

Win 7, ruby 1.9.2, ocra (and ocrasa also) 1.2.0

Thanks. --David

Bad file descriptor

Whenever I try and compile anything with OCRA, I get this error:

=== Compressing 5914523 bytes
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:1005:in 'write': Bad file descriptor - RubyRPG1-6.exe (Errno::EBADF)
from ocra:1005:in 'block in initialize'
from ocra:983:in 'open'
from ocra:983:in 'initialize'
from ocra:822:in 'new'
from ocra:822:in 'build_exe'
from ocra:1138: in 'block in (top (required))'

Then it creates a 34KB .exe with a bad file signature. This is happening no matter where I try to compile, in Downloads or Desktop, even when I run it as administrator, even when I try and compile .rbs I have previously successfully compiled .exes of. Normally I recall this error message popping up if there was already a .exe with that file name in the directory, but I make sure to delete or rename any duplicate files before I run the compiler.

I am running Windows 7 Ultimate 64-bit with SP1.

Feature request: ruby.exe.manifest Support (XP visual style GUI support)

An ocra executable file is expanded to temporary folder at running. So really executed file is ruby.exe or rubyw.exe, not be exe file created by ocra. Therefore, .exe.manifest file and XP visual style are not enabled with ocra. (.exe.manifest file has effect to enable XP visual style for application, to controll windows privileges and others, when it is placed same an application's exe file)

Please support a function for bundling ruby.exe.manifest or rubyw.exe.support for XP visual style GUI.

Example

ocra --exe-manifest myapplication.exe.manifest myapplication.rb

=> myapplication.exe.manifest is renamed ruby.exe.manifest or rubyw.exe.manifest, and it is expanded to ocra temporary bin folder.

Included folders become downcase

Hello,

When I include folders with the following code :

ocra 'main.rb' 'Ressources' 'Kadelfek Temp' --no-lzma --chdir-first --innosetup 'main.iss'

All folders included have their name in downcase in the final folder "src".
"Ressource" => "ressource"
"Kadelfek Temp" => "kadelfek temp"

All subfolders are downcased too. Files keep their case.

I'm using ocra 1.3.0, Ruby 1.9.2 and Inno Setup 5.4.2.

rake gem fails

I tried to generate the gem from the source but I get following error:
(in c:/Users/roman/cyt/ocra)
mingw32-make -C src
mingw32-make: Entering directory c:/Users/roman/cyt/ocra/src' mingw32-make: *** No rule to make targetlzma/lzmadec.o', needed by stub.exe'. Stop. mingw32-make: Leaving directoryc:/Users/roman/cyt/ocra/src'
rake aborted!
Command failed with status (2): [mingw32-make -C src...]
c:/Ruby192/lib/ruby/1.9.1/rake.rb:993:in block in sh' c:/Ruby192/lib/ruby/1.9.1/rake.rb:1008:incall'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:1008:in sh' c:/Ruby192/lib/ruby/1.9.1/rake.rb:1092:insh'
c:/Users/roman/cyt/ocra/Rakefile:15:in block in <top (required)>' c:/Ruby192/lib/ruby/1.9.1/rake.rb:634:incall'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in block in execute' c:/Ruby192/lib/ruby/1.9.1/rake.rb:629:ineach'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in execute' c:/Ruby192/lib/ruby/1.9.1/rake.rb:595:inblock in invoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in mon_synchronize' c:/Ruby192/lib/ruby/1.9.1/rake.rb:588:ininvoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:605:in block in invoke_prerequisites' c:/Ruby192/lib/ruby/1.9.1/rake.rb:602:ineach'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in invoke_prerequisites' c:/Ruby192/lib/ruby/1.9.1/rake.rb:594:inblock in invoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in mon_synchronize' c:/Ruby192/lib/ruby/1.9.1/rake.rb:588:ininvoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:605:in block in invoke_prerequisites' c:/Ruby192/lib/ruby/1.9.1/rake.rb:602:ineach'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in invoke_prerequisites' c:/Ruby192/lib/ruby/1.9.1/rake.rb:594:inblock in invoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in mon_synchronize' c:/Ruby192/lib/ruby/1.9.1/rake.rb:588:ininvoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:605:in block in invoke_prerequisites' c:/Ruby192/lib/ruby/1.9.1/rake.rb:602:ineach'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in invoke_prerequisites' c:/Ruby192/lib/ruby/1.9.1/rake.rb:594:inblock in invoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in mon_synchronize' c:/Ruby192/lib/ruby/1.9.1/rake.rb:588:ininvoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:605:in block in invoke_prerequisites' c:/Ruby192/lib/ruby/1.9.1/rake.rb:602:ineach'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in invoke_prerequisites' c:/Ruby192/lib/ruby/1.9.1/rake.rb:594:inblock in invoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in mon_synchronize' c:/Ruby192/lib/ruby/1.9.1/rake.rb:588:ininvoke_with_call_chain'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in invoke' c:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:ininvoke_task'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in block (2 levels) in top_level' c:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:ineach'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in block in top_level' c:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:instandard_exception_handling'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in top_level' c:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:inrun'
c:/Ruby192/bin/rake:31:in `

'

Do you have any idea what it could be?

Ocrasa 1.3.1

Hi,

this ticket highly relates to #31

This time I tried to create ocrasa 1.3.1 via rake but the test suite is failing in Test 20. I assume this is an issue with my Ruby installation (I tried 1.9.3 and 2.0 in 32bit) but I always have the same error.

Would please be so kind and create a new version of ocrasa? Should I create a ticket regarding the failing test?

Gem files not detected correctly with recent RubyGems

Probably related to issues #4 and #24.

It appears that ocra is using specifications/gem-name.gemspec files array to find what files it should package when the gem is used in the app.

After this patch:
rubygems/rubygems@a1a5ab5
gemspec no longer lists all the files, see http://blog.ra66i.org/archives/2011/02/rubygems-no-longer-chews-on-ram/ why.
Also check the discussion at http://rubyforge.org/pipermail/rubygems-developers/2011-May/006540.html.
It seems that this change is by design and will not be reverted, so ocra needs to use a different way to list gem files.

Now most of the gems are not fully packaged and dependencies are missing in the final executable. This includes both gems with native extensions and plain ruby gems.

One of the examples would be 'aes' gem. Original gemspec is:

    ".document",
    "Gemfile",
    "LICENSE.txt",
    "README.rdoc",
    "Rakefile",
    "VERSION",
    "aes.gemspec",
    "lib/aes.rb",
    "lib/aes/aes.rb",
    "test/helper.rb",
    "test/test_aes.rb"
  ]

after processing with RubyGems specifications/aes-0.4.0.gemspec becomes:
s.files = [%q{LICENSE.txt}, %q{README.rdoc}]

As a result ocra will not package lib/aes.rb and lib/aes/aes.rb.

It looks like the proper solution would be to add all the files from the require_paths recursively in addition to files.

Request: ocrasa-1.3.0

Will there be a standalone version of ocra available for the current stable version? If not, is there a recommendation how to create it? I always used the standalone version (easier to include libs with ruby -I) and would like to avoid to change the build scripts.

Failed to create directory (require 'json')

this is the example input file js2.rb:
require "json"
p "hello"

Z:\staging\ruby\stbeehive\win>ocra js2.rb
=== Loading script to check dependencies
"hello"
=== Building js2.exe
m src
a src/js2.rb
m bin
a bin/ruby.exe
a bin/msvcrt-ruby18.dll
a bin/libiconv2.dll
m lib
m lib/ruby
m lib/ruby/gems
m lib/ruby/gems/1.8
m lib/ruby/gems/1.8/specifications
a lib/ruby/gems/1.8/specifications/ocra-1.2.0.gemspec
a lib/ruby/gems/1.8/specifications/json_pure-1.5.1.gemspec
a lib/ruby/gems/1.8/specifications/json_pure-1.5.1.gemspec
m lib/ruby/site_ruby
m lib/ruby/site_ruby/1.8
m lib/ruby/site_ruby/1.8/rubygems
a lib/ruby/site_ruby/1.8/rubygems/defaults.rb
m lib/ruby/1.8
m lib/ruby/1.8/i386-mingw32
a lib/ruby/1.8/i386-mingw32/thread.so
a lib/ruby/1.8/thread.rb
a lib/ruby/1.8/i386-mingw32/etc.so
a lib/ruby/1.8/i386-mingw32/rbconfig.rb
a lib/ruby/site_ruby/1.8/rubygems/exceptions.rb
a lib/ruby/site_ruby/1.8/rubygems/version.rb
a lib/ruby/site_ruby/1.8/rubygems/requirement.rb
a lib/ruby/site_ruby/1.8/rubygems/dependency.rb
a lib/ruby/site_ruby/1.8/rubygems/gem_path_searcher.rb
a lib/ruby/site_ruby/1.8/rubygems/user_interaction.rb
a lib/ruby/site_ruby/1.8/rubygems/platform.rb
a lib/ruby/site_ruby/1.8/rubygems/specification.rb
a lib/ruby/site_ruby/1.8/rubygems/source_index.rb
a lib/ruby/site_ruby/1.8/rubygems/builder.rb
m lib/ruby/site_ruby/1.8/rubygems/defaults
a lib/ruby/site_ruby/1.8/rubygems/defaults/operating_system.rb
a lib/ruby/1.8/i386-mingw32/Win32API.so
a lib/ruby/site_ruby/1.8/rubygems/config_file.rb
a lib/ruby/site_ruby/1.8/rubygems/custom_require.rb
a lib/ruby/site_ruby/1.8/rubygems.rb
m lib/ruby/gems/1.8/gems
m lib/ruby/gems/1.8/gems/json_pure-1.5.1
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/version.rb
a lib/ruby/1.8/i386-mingw32/iconv.so
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/common.rb
a lib/ruby/1.8/i386-mingw32/strscan.so
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/pure
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/pure/parser.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/pure/generator.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/pure.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json.rb
a lib/ruby/1.8/i386-mingw32/zlib.so
a lib/ruby/1.8/fileutils.rb
a lib/ruby/1.8/i386-mingw32/socket.so
a lib/ruby/1.8/timeout.rb
m lib/ruby/1.8/net
a lib/ruby/1.8/net/protocol.rb
m lib/ruby/1.8/uri
a lib/ruby/1.8/uri/common.rb
a lib/ruby/1.8/uri/generic.rb
a lib/ruby/1.8/uri/ftp.rb
a lib/ruby/1.8/uri/http.rb
a lib/ruby/1.8/uri/https.rb
a lib/ruby/1.8/uri/ldap.rb
a lib/ruby/1.8/uri/ldaps.rb
a lib/ruby/1.8/uri/mailto.rb
a lib/ruby/1.8/uri.rb
a lib/ruby/1.8/net/http.rb
a lib/ruby/1.8/i386-mingw32/stringio.so
a lib/ruby/1.8/rational.rb
m lib/ruby/1.8/date
a lib/ruby/1.8/date/format.rb
a lib/ruby/1.8/parsedate.rb
a lib/ruby/1.8/time.rb
a lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb
a lib/ruby/site_ruby/1.8/rubygems/errors.rb
a lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/.
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/./tests
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/./tests/test_json.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/./tests/test_json_addition.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/./tests/test_json_encoding.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/./tests/test_json_fixtures.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/./tests/test_json_generate.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/./tests/test_json_string_matching.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/./tests/test_json_unicode.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/CHANGES
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/COPYING
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/COPYING-json-jruby
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/GPL
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/README
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/README-json-jruby.markdown
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/TODO
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/VERSION
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/bin
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/bin/edit_json.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/bin/prettify_json.rb
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/data
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/data/example.json
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/data/index.html
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/data/prototype.js
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/install.rb
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/java
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/lib
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/lib/bytelist-1.0.6.jar
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/lib/jcodings.jar
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/ByteListTranscoder.ja
va
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/Generator.java
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/GeneratorMethods.java

a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/GeneratorService.java

a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/GeneratorState.java
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/OptionsReader.java
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/Parser.java
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/Parser.rl
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/ParserService.java
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/RuntimeInfo.java
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/StringDecoder.java
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/StringEncoder.java
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/java/src/json/ext/Utils.java
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/json-java.gemspec
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/Array.xpm
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/FalseClass.xpm
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/Hash.xpm
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/Key.xpm
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/NilClass.xpm
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/Numeric.xpm
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/String.xpm
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/TrueClass.xpm
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/add
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/add/core.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/add/rails.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/common.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/editor.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/ext.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/json.xpm
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/pure.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/pure/generator.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/pure/parser.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/lib/json/version.rb
m lib/ruby/gems/1.8/gems/json_pure-1.5.1/tools
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/tools/fuzz.rb
a lib/ruby/gems/1.8/gems/json_pure-1.5.1/tools/server.rb
e RUBYOPT
e RUBYLIB
e GEM_PATH \gemhome
p \bin\ruby.exe ruby.exe "\src\js2.rb"
=== Compressing
=== Finished building js2.exe (1363061 bytes)

Z:\staging\ruby\stbeehive\win>js2.exe
Failed to create directory 'C:\DOCUME1\KCIERP1.KCI\LOCALS~1\Temp\ocr206.tmp\li
b\ruby\gems\1.8\gems\json_pure-1.5.1.'.

Z:\staging\ruby\stbeehive\win>ruby -v
ruby 1.8.7 (2010-12-23 patchlevel 330) [i386-mingw32]

Z:\staging\ruby\stbeehive\win>ocra --version
Ocra 1.2.0

How can I successfully create that js2.exe?

thanks,
chris

"Failed to create directory" error with 'pg' gem.

Steps to reproduce:

  1. make a 2 line test.rb
    require 'rubygems'
    require 'pg'

  2. compile test.rb via "ocra test.rb". The output from this command is included farther down.

  3. run resulting test.exe =>
    Failed to create directory 'C:\DOCUME1\myusername\LOCALS1\Temp\ocr2DF.tmp\lib\ruby\gems\1.8\gems\pg-0.9.0-x86-mingw32.'.

The contents list for the pg gem has paths in it that use '.', which I suspect may be the trouble.
gem contents pg =>

c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/Rakefile
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/ChangeLog
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/README
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/LICENSE
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/m17n_spec.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/pgconn_spec.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/pgresult_spec.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/lib/helpers.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/lib/pg.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/ext/compat.c
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/ext/pg.c
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/ext/compat.h
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/ext/pg.h
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/ext/extconf.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/191_compat.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/dependencies.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/helpers.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/hg.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/manual.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/packaging.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/publishing.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/rdoc.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/style.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/svn.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/testing.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/verifytask.rb
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/./README.ja
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/./README.OS_X
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/./README.windows
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/./GPL
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/./BSD
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/./Contributors
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/Rakefile.local
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/data/expected_trace.out
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/data/random_binary_data
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/lib/1.8/pg_ext.so
c:/Ruby187/lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/lib/1.9/pg_ext.so

ocra v. 1.2.0
pg v 0.9.0 x86-mingw32

OS: 32 bit Windows XP SP3

ruby -v =>

ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]

gem env =>

RubyGems Environment:

  • RUBYGEMS VERSION: 1.3.7
  • RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
  • INSTALLATION DIRECTORY: c:/Ruby187/lib/ruby/gems/1.8
  • RUBY EXECUTABLE: c:/Ruby187/bin/ruby.exe
  • EXECUTABLE DIRECTORY: c:/Ruby187/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86-mingw32
  • GEM PATHS:
    • c:/Ruby187/lib/ruby/gems/1.8
    • C:/Documents and Settings/ajones/.gem/ruby/1.8
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

command line and ocra output:
ocra test.rb =>

=== Loading script to check dependencies
=== Building test.exe
m src
a src/test.rb
m bin
a bin/ruby.exe
a bin/msvcrt-ruby18.dll
m lib
m lib/ruby
m lib/ruby/gems
m lib/ruby/gems/1.8
m lib/ruby/gems/1.8/specifications
a lib/ruby/gems/1.8/specifications/pg-0.9.0-x86-mingw32.gemspec
a lib/ruby/gems/1.8/specifications/ocra-1.2.0.gemspec
a lib/ruby/gems/1.8/specifications/pg-0.9.0-x86-mingw32.gemspec
m lib/ruby/site_ruby
m lib/ruby/site_ruby/1.8
m lib/ruby/site_ruby/1.8/rubygems
a lib/ruby/site_ruby/1.8/rubygems/defaults.rb
m lib/ruby/1.8
m lib/ruby/1.8/i386-mingw32
a lib/ruby/1.8/i386-mingw32/thread.so
a lib/ruby/1.8/thread.rb
a lib/ruby/1.8/i386-mingw32/etc.so
a lib/ruby/1.8/i386-mingw32/rbconfig.rb
a lib/ruby/site_ruby/1.8/rubygems/exceptions.rb
a lib/ruby/site_ruby/1.8/rubygems/version.rb
a lib/ruby/site_ruby/1.8/rubygems/requirement.rb
a lib/ruby/site_ruby/1.8/rubygems/dependency.rb
a lib/ruby/site_ruby/1.8/rubygems/gem_path_searcher.rb
a lib/ruby/site_ruby/1.8/rubygems/user_interaction.rb
a lib/ruby/site_ruby/1.8/rubygems/platform.rb
a lib/ruby/site_ruby/1.8/rubygems/specification.rb
a lib/ruby/site_ruby/1.8/rubygems/source_index.rb
a lib/ruby/site_ruby/1.8/rubygems/builder.rb
a lib/ruby/1.8/i386-mingw32/Win32API.so
a lib/ruby/site_ruby/1.8/rubygems/config_file.rb
a lib/ruby/site_ruby/1.8/rubygems/custom_require.rb
a lib/ruby/site_ruby/1.8/rubygems.rb
m lib/ruby/gems/1.8/gems
m lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32
m lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/lib
m lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/lib/1.8
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/lib/1.8/pg_ext.so
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/lib/pg.rb
a lib/ruby/1.8/i386-mingw32/zlib.so
a lib/ruby/1.8/fileutils.rb
a lib/ruby/1.8/i386-mingw32/socket.so
a lib/ruby/1.8/timeout.rb
m lib/ruby/1.8/net
a lib/ruby/1.8/net/protocol.rb
m lib/ruby/1.8/uri
a lib/ruby/1.8/uri/common.rb
a lib/ruby/1.8/uri/generic.rb
a lib/ruby/1.8/uri/ftp.rb
a lib/ruby/1.8/uri/http.rb
a lib/ruby/1.8/uri/https.rb
a lib/ruby/1.8/uri/ldap.rb
a lib/ruby/1.8/uri/ldaps.rb
a lib/ruby/1.8/uri/mailto.rb
a lib/ruby/1.8/uri.rb
a lib/ruby/1.8/net/http.rb
a lib/ruby/1.8/i386-mingw32/stringio.so
a lib/ruby/1.8/rational.rb
m lib/ruby/1.8/date
a lib/ruby/1.8/date/format.rb
a lib/ruby/1.8/parsedate.rb
a lib/ruby/1.8/time.rb
a lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb
a lib/ruby/site_ruby/1.8/rubygems/errors.rb
a lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb
m lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/.
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/./BSD
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/./Contributors
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/./GPL
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/./README.OS_X
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/./README.ja
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/./README.windows
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/ChangeLog
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/LICENSE
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/README
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/Rakefile.local
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/lib/1.8/pg_ext.so
m lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/lib/1.9
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/lib/1.9/pg_ext.so
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/lib/pg.rb
m lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/191_compat.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/dependencies.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/helpers.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/hg.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/manual.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/packaging.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/publishing.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/rdoc.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/style.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/svn.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/testing.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/rake/verifytask.rb
m lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec
m lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/data
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/data/expected_trace.out
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/data/random_binary_data
m lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/lib
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/lib/helpers.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/m17n_spec.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/pgconn_spec.rb
a lib/ruby/gems/1.8/gems/pg-0.9.0-x86-mingw32/spec/pgresult_spec.rb
e RUBYOPT
e RUBYLIB
e GEM_PATH \gemhome
p \bin\ruby.exe ruby.exe "\src\test.rb"
=== Compressing
=== Finished building test.exe (1102470 bytes)

Doesn't find all dlls loaded by Ray

Ray is an opengl based game-development library. When running normally, it loads a number of dlls on Windows correctly, but when made into an exe, Ocra finds all but one of them (using Ruby 1.9.2, Ocra 1.3.0, Ray 0.2.0).

=== Adding detected DLL C:/Ruby192/bin/libiconv2.dll
=== Adding detected DLL C:/Ruby192/lib/ruby/gems/1.9.1/gems/ray-0.2.0/ext/freetype6.dll
=== Adding detected DLL C:/Ruby192/bin/zlib1.dll
=== Adding detected DLL C:/Ruby192/lib/ruby/gems/1.9.1/gems/ray-0.2.0/ext/glew32.dll
=== Adding detected DLL C:/Ruby192/lib/ruby/gems/1.9.1/gems/ray-0.2.0/ext/libsndfile-1.dll
=== Adding detected DLL C:/Ruby192/bin/libeay32-1.0.0-msvcrt.dll
=== Adding detected DLL C:/Ruby192/bin/ssleay32-1.0.0-msvcrt.dll

It does not find OpenAL32.dll however (though I can include it manually and add it to the path at run-time and that works OK, it would perhaps prevent other users from using the library).

Relevant file is probably https://github.com/Mon-Ouie/ray/blob/master/lib/ray/ray.rb (adds dll directory at the correct end of the path, so it should load its own dlls before the system ones).

The only oddity is that the OpenAL32.dll is originally named soft_oal.dll, but it is renamed when the gem is installed, unlike all the other dlls (https://github.com/Mon-Ouie/ray/blob/master/ext/extconf.rb)

Thanks for any thoughts on the matter!

Failed to create directory - mailfactory-1.4.0/.

When i require 'mailfactory' and use ocra to generate .exe file, the error caused.

Failed to create directory 'C:\DOCUME1\admin\LOCALS1\Temp\ocr71.tmp\lib\ruby
ems\1.8\gems\mailfactory-1.4.0.'.

Found that a folder under mailfactory-1.4.0 which was named "." was created when package to .exe, but it's not exist actually, see the log below.

how can i package it successfully?

=== Loading script to check dependencies
=== Building demo.exe
m src
a src/demo.rb
m bin
a bin/ruby.exe
a bin/msvcrt-ruby18.dll
a bin/zlib1.dll
m lib
m lib/ruby
m lib/ruby/gems
m lib/ruby/gems/1.8
m lib/ruby/gems/1.8/specifications
a lib/ruby/gems/1.8/specifications/mailfactory-
a lib/ruby/gems/1.8/specifications/ocra-1.2.0.g
a lib/ruby/gems/1.8/specifications/mime-types-1
a lib/ruby/gems/1.8/specifications/mailfactory-
a lib/ruby/gems/1.8/specifications/mime-types-1
m lib/ruby/site_ruby
m lib/ruby/site_ruby/1.8
m lib/ruby/site_ruby/1.8/rubygems
a lib/ruby/site_ruby/1.8/rubygems/defaults.rb
m lib/ruby/1.8
m lib/ruby/1.8/i386-mswin32
a lib/ruby/1.8/i386-mswin32/thread.so
a lib/ruby/1.8/thread.rb
a lib/ruby/1.8/i386-mswin32/etc.so
a lib/ruby/1.8/i386-mswin32/rbconfig.rb
a lib/ruby/site_ruby/1.8/rubygems/exceptions.rb
a lib/ruby/site_ruby/1.8/rubygems/version.rb
a lib/ruby/site_ruby/1.8/rubygems/requirement.r
a lib/ruby/site_ruby/1.8/rubygems/dependency.rb
a lib/ruby/site_ruby/1.8/rubygems/gem_path_sear
a lib/ruby/site_ruby/1.8/rubygems/user_interact
a lib/ruby/site_ruby/1.8/rubygems/platform.rb
a lib/ruby/site_ruby/1.8/rubygems/specification
a lib/ruby/site_ruby/1.8/rubygems/source_index.
a lib/ruby/site_ruby/1.8/rubygems/builder.rb
a lib/ruby/1.8/i386-mswin32/Win32API.so
a lib/ruby/site_ruby/1.8/rubygems/config_file.r
a lib/ruby/site_ruby/1.8/rubygems/custom_requir
a lib/ruby/site_ruby/1.8/rubygems.rb
a lib/ruby/site_ruby/1.8/ubygems.rb
a lib/ruby/1.8/pathname.rb
m lib/ruby/gems/1.8/gems
m lib/ruby/gems/1.8/gems/mime-types-1.16
m lib/ruby/gems/1.8/gems/mime-types-1.16/lib
m lib/ruby/gems/1.8/gems/mime-types-1.16/lib/mi
a lib/ruby/gems/1.8/gems/mime-types-1.16/lib/mi
a lib/ruby/1.8/i386-mswin32/enumerator.so
m lib/ruby/gems/1.8/gems/mailfactory-1.4.0
m lib/ruby/gems/1.8/gems/mailfactory-1.4.0/lib
a lib/ruby/gems/1.8/gems/mailfactory-1.4.0/lib/
m lib/ruby/site_ruby/1.8/i386-msvcrt
a lib/ruby/site_ruby/1.8/i386-msvcrt/zlib.so
a lib/ruby/1.8/fileutils.rb
a lib/ruby/1.8/i386-mswin32/socket.so
a lib/ruby/1.8/timeout.rb
m lib/ruby/1.8/net
a lib/ruby/1.8/net/protocol.rb
m lib/ruby/1.8/uri
a lib/ruby/1.8/uri/common.rb
a lib/ruby/1.8/uri/generic.rb
a lib/ruby/1.8/uri/ftp.rb
a lib/ruby/1.8/uri/http.rb
a lib/ruby/1.8/uri/https.rb
a lib/ruby/1.8/uri/ldap.rb
a lib/ruby/1.8/uri/mailto.rb
a lib/ruby/1.8/uri.rb
a lib/ruby/1.8/net/http.rb
a lib/ruby/1.8/i386-mswin32/stringio.so
a lib/ruby/1.8/rational.rb
m lib/ruby/1.8/date
a lib/ruby/1.8/date/format.rb
a lib/ruby/1.8/parsedate.rb
a lib/ruby/1.8/time.rb
a lib/ruby/site_ruby/1.8/rubygems/remote_fetche
a lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.
m lib/ruby/gems/1.8/gems/mailfactory-1.4.0/.
m lib/ruby/gems/1.8/gems/mailfactory-1.4.0/./li
a lib/ruby/gems/1.8/gems/mailfactory-1.4.0/./li
m lib/ruby/gems/1.8/gems/mailfactory-1.4.0/./te
a lib/ruby/gems/1.8/gems/mailfactory-1.4.0/./te
a lib/ruby/gems/1.8/gems/mime-types-1.16/lib/mi
a lib/ruby/gems/1.8/gems/mime-types-1.16/lib/mi
a lib/ruby/gems/1.8/gems/mime-types-1.16/mime-t
e RUBYOPT -rubygems
e RUBYLIB
e GEM_PATH \gemhome
p \bin\ruby.exe ruby.exe "\sr
=== Compressing

=== Finished building demo.exe (488136 bytes)

ruby -version: 1.8.6
ocra -version:1.2.0
OS: windows xp sp3

by the way, I tried ocra-1.3.0, a warning showed that the folder "mailfactory-1.4.0/lib" cannot be found when package to .exe.

When run as service: Leaves ruby running and temp directory in place

On Windows Server 2008, if the ocra-generated EXE file is started as a service using SRVANY.EXE, when the service is stopped/killed, the ruby.exe/rubyw.exe continues running.

Killing the ruby.exe/rubyw.exe does not automatically clear the temporary directory hierarchy.

Is this a SRVANY.EXE problem or an OCRA problem?

Bad signature in SEB error

The documentation is sparse so I am not sure what I'm doing wrong here. I ran this command:

ocra vuzitcli

It returned this:

=== Building vuzitcli.exe
m src
a src\vuzitcli
m bin
a bin\ruby.exe
a bin\msvcrt-ruby18.dll
m lib
m lib\ruby
m lib\ruby\gems
m lib\ruby\gems\1.8
m lib\ruby\gems\1.8\specifications
a lib\ruby\gems\1.8\specifications\ocra-1.0.0.gem
a lib\ruby\gems\1.8\specifications\mime-types-1.1
m lib\ruby\site_ruby
m lib\ruby\site_ruby\1.8
m lib\ruby\site_ruby\1.8\rubygems
a lib\ruby\site_ruby\1.8\rubygems\rubygems_versio
a lib\ruby\site_ruby\1.8\rubygems\defaults.rb
m lib\ruby\1.8
m lib\ruby\1.8\i386-mswin32
a lib\ruby\1.8\i386-mswin32\thread.so
a lib\ruby\1.8\thread.rb
a lib\ruby\1.8\i386-mswin32\rbconfig.rb
a lib\ruby\site_ruby\1.8\rubygems\exceptions.rb
a lib\ruby\site_ruby\1.8\rubygems\requirement.rb
a lib\ruby\site_ruby\1.8\rubygems\version.rb
a lib\ruby\site_ruby\1.8\rubygems\dependency.rb
a lib\ruby\site_ruby\1.8\rubygems\gem_path_search
a lib\ruby\site_ruby\1.8\rubygems\user_interactio
a lib\ruby\site_ruby\1.8\rubygems\platform.rb
a lib\ruby\site_ruby\1.8\rubygems\specification.r
a lib\ruby\site_ruby\1.8\rubygems\source_index.rb
a lib\ruby\site_ruby\1.8\rubygems\builder.rb
a lib\ruby\1.8\i386-mswin32\stringio.so
m lib\ruby\1.8\yaml
a lib\ruby\1.8\yaml\error.rb
a lib\ruby\1.8\i386-mswin32\syck.so
a lib\ruby\1.8\yaml\ypath.rb
a lib\ruby\1.8\yaml\basenode.rb
a lib\ruby\1.8\yaml\syck.rb
a lib\ruby\1.8\yaml\tag.rb
a lib\ruby\1.8\yaml\stream.rb
a lib\ruby\1.8\yaml\constants.rb
a lib\ruby\1.8\rational.rb
m lib\ruby\1.8\date
a lib\ruby\1.8\date\format.rb
a lib\ruby\1.8\date.rb
a lib\ruby\1.8\yaml\rubytypes.rb
a lib\ruby\1.8\yaml\types.rb
a lib\ruby\1.8\yaml.rb
a lib\ruby\1.8\i386-mswin32\Win32API.so
a lib\ruby\site_ruby\1.8\rubygems\config_file.rb
a lib\ruby\site_ruby\1.8\rubygems\custom_require.
a lib\ruby\site_ruby\1.8\rubygems.rb
a lib\ruby\site_ruby\1.8\ubygems.rb
a lib\ruby\1.8\i386-mswin32\etc.so
a lib\ruby\1.8\fileutils.rb
a lib\ruby\1.8\optparse.rb
a lib\ruby\1.8\parsedate.rb
a lib\ruby\1.8\time.rb
m lib\ruby\1.8\optparse
a lib\ruby\1.8\optparse\time.rb
a lib\ruby\1.8\ostruct.rb
a lib\ruby\1.8\prettyprint.rb
a lib\ruby\1.8\pp.rb
a lib\ruby\1.8\i386-mswin32\socket.so
a lib\ruby\1.8\timeout.rb
m lib\ruby\1.8\net
a lib\ruby\1.8\net\protocol.rb
m lib\ruby\1.8\uri
a lib\ruby\1.8\uri\common.rb
a lib\ruby\1.8\uri\generic.rb
a lib\ruby\1.8\uri\ftp.rb
a lib\ruby\1.8\uri\http.rb
a lib\ruby\1.8\uri\https.rb
a lib\ruby\1.8\uri\ldap.rb
a lib\ruby\1.8\uri\mailto.rb
a lib\ruby\1.8\uri.rb
a lib\ruby\1.8\net\http.rb
a lib\ruby\1.8\i386-mswin32\openssl.so
m lib\ruby\1.8\openssl
a lib\ruby\1.8\openssl\bn.rb
a lib\ruby\1.8\openssl\cipher.rb
a lib\ruby\1.8\openssl\digest.rb
a lib\ruby\1.8\openssl\buffering.rb
a lib\ruby\1.8\i386-mswin32\fcntl.so
a lib\ruby\1.8\openssl\ssl.rb
a lib\ruby\1.8\openssl\x509.rb
a lib\ruby\1.8\openssl.rb
a lib\ruby\1.8\net\https.rb
m lib\ruby\gems\1.8\gems
m lib\ruby\gems\1.8\gems\mime-types-1.15
m lib\ruby\gems\1.8\gems\mime-types-1.15\lib
m lib\ruby\gems\1.8\gems\mime-types-1.15\lib\mime
a lib\ruby\gems\1.8\gems\mime-types-1.15\lib\mime
a lib\ruby\1.8\i386-mswin32\nkf.so
a lib\ruby\1.8\kconv.rb
a lib\ruby\1.8\base64.rb
a lib\ruby\1.8\English.rb
a lib\ruby\1.8\delegate.rb
a lib\ruby\1.8\cgi.rb
a lib\ruby\1.8\i386-mswin32\digest.so
a lib\ruby\1.8\digest.rb
m lib\ruby\1.8\i386-mswin32\digest
a lib\ruby\1.8\i386-mswin32\digest\md5.so
a lib\ruby\1.8\md5.rb
m lib\ruby\site_ruby\1.8\vuzitruby
a lib\ruby\site_ruby\1.8\vuzitruby\service.rb
m lib\ruby\1.8\rexml
a lib\ruby\1.8\rexml\parseexception.rb
a lib\ruby\1.8\rexml\node.rb
a lib\ruby\1.8\rexml\child.rb
a lib\ruby\1.8\rexml\parent.rb
a lib\ruby\1.8\rexml\xmltokens.rb
a lib\ruby\1.8\rexml\namespace.rb
a lib\ruby\1.8\rexml\encoding.rb
a lib\ruby\1.8\rexml\source.rb
a lib\ruby\1.8\rexml\entity.rb
a lib\ruby\1.8\rexml\attlistdecl.rb
a lib\ruby\1.8\rexml\doctype.rb
a lib\ruby\1.8\rexml\text.rb
a lib\ruby\1.8\rexml\attribute.rb
a lib\ruby\1.8\rexml\cdata.rb
a lib\ruby\1.8\rexml\functions.rb
a lib\ruby\1.8\rexml\syncenumerator.rb
m lib\ruby\1.8\rexml\parsers
a lib\ruby\1.8\rexml\parsers\xpathparser.rb
a lib\ruby\1.8\rexml\xpath_parser.rb
a lib\ruby\1.8\rexml\xpath.rb
a lib\ruby\1.8\rexml\element.rb
a lib\ruby\1.8\rexml\xmldecl.rb
a lib\ruby\1.8\rexml\comment.rb
a lib\ruby\1.8\rexml\instruction.rb
a lib\ruby\1.8\rexml\rexml.rb
a lib\ruby\1.8\rexml\output.rb
a lib\ruby\1.8\rexml\parsers\baseparser.rb
a lib\ruby\1.8\rexml\parsers\streamparser.rb
m lib\ruby\1.8\rexml\validation
a lib\ruby\1.8\rexml\validation\validationexcepti
a lib\ruby\1.8\rexml\parsers\treeparser.rb
m lib\ruby\1.8\rexml\encodings
a lib\ruby\1.8\rexml\encodings\UTF-8.rb
a lib\ruby\1.8\rexml\document.rb
a lib\ruby\site_ruby\1.8\vuzitruby\document.rb
a lib\ruby\site_ruby\1.8\vuzitruby\exception.rb
m lib\ruby\site_ruby\1.8.
m lib\ruby\site_ruby\1.8...
m lib\ruby\site_ruby\1.8...\lib
a lib\ruby\site_ruby\1.8...\lib\vuzitruby.rb
m lib\ruby\site_ruby\1.8\i386-msvcrt
a lib\ruby\site_ruby\1.8\i386-msvcrt\zlib.so
a lib\ruby\site_ruby\1.8\rubygems\remote_fetcher.
a lib\ruby\site_ruby\1.8\rubygems\spec_fetcher.rb
e RUBYOPT
e RUBYLIB
l bin\ruby.exe ruby.exe  \src\vuzitcli
=== Compressing

The resulting vuzitcli.exe program was only 17.5 KB which is clearly wrong. When I ran it the error was "Bad signature in SEB error". What do I do?

Error trying to make an executable

game_manager> ocra game_manager.rb
=== Loading script to check dependencies
Starting App..
Started.
Exiting...
Good Bye
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467: Use RbConfig instead of obsolete and de
precated Config.
=== WARNING: Class::Bloops was not loadable
=== WARNING: Module::Bloops was not loadable
=== WARNING: Object::Bloops was not loadable
=== WARNING: ActiveRecord::SessionStore was defined autoloadable, but caused NameError
C:/Ruby193/lib/ruby/gems/1.9.1/gems/i18n-0.6.0/lib/i18n/tests/basics.rb:8:in `test': unknown command
 'a' (ArgumentError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/i18n-0.6.0/lib/i18n/tests/basics.rb:8:in `<module:B
asics>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/i18n-0.6.0/lib/i18n/tests/basics.rb:3:in `<module:T
ests>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/i18n-0.6.0/lib/i18n/tests/basics.rb:2:in `<module:I
18n>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/i18n-0.6.0/lib/i18n/tests/basics.rb:1:in `<top (req
uired)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467:in `const_get'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467:in `block (3 levels) in att
empt_load_autoload'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:464:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:464:in `block (2 levels) in att
empt_load_autoload'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:462:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:462:in `block in attempt_load_a
utoload'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:456:in `loop'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:456:in `attempt_load_autoload'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:679:in `build_exe'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:1138:in `block in <top (require
d)>'

ActiveRecord - MemCacheStore

I've just come across orca and so not even sure if it is an issue with you're gem or with something else.

I don't directly call ActiveSupport but maybe one of the gems i use does.

I ran my app against orca and got the errors below...

C:\monitoring screen\bar codes>ocra --windows guifront.rbw
=== Loading script to check dependencies
=== WARNING: ActiveSupport::Cache::FileStore was not loadable
You don't have memcache-client installed in your application. Please add it to y
our Gemfile and run bundle install
=== WARNING: ActiveSupport::Cache::MemCacheStore was not loadable
=== WARNING: ActiveSupport::Cache::CompressedMemCacheStore was defined autoloada
ble, but caused NameError
C:/Ruby187/lib/ruby/gems/1.8/gems/i18n-0.5.0/lib/i18n/tests/link.rb:6:in test': wrong number of arguments (1 for 2) (ArgumentError) from C:/Ruby187/lib/ruby/gems/1.8/gems/i18n-0.5.0/lib/i18n/tests/link.rb :6 from C:/Ruby187/lib/ruby/gems/1.8/gems/ocra-1.2.0/bin/ocra:186:inconst
_get'
from C:/Ruby187/lib/ruby/gems/1.8/gems/ocra-1.2.0/bin/ocra:186:in attem pt_load_autoload' from C:/Ruby187/lib/ruby/gems/1.8/gems/ocra-1.2.0/bin/ocra:183:ineach'

    from C:/Ruby187/lib/ruby/gems/1.8/gems/ocra-1.2.0/bin/ocra:183:in `attem

pt_load_autoload'
from C:/Ruby187/lib/ruby/gems/1.8/gems/ocra-1.2.0/bin/ocra:181:in `each'

    from C:/Ruby187/lib/ruby/gems/1.8/gems/ocra-1.2.0/bin/ocra:181:in `attem

pt_load_autoload'
from C:/Ruby187/lib/ruby/gems/1.8/gems/ocra-1.2.0/bin/ocra:175:in `loop'

    from C:/Ruby187/lib/ruby/gems/1.8/gems/ocra-1.2.0/bin/ocra:175:in `attem

pt_load_autoload'
from C:/Ruby187/lib/ruby/gems/1.8/gems/ocra-1.2.0/bin/ocra:325:in `build
_exe'
from C:/Ruby187/lib/ruby/gems/1.8/gems/ocra-1.2.0/bin/ocra:640
from C:/Ruby187/bin/ocra:19

C:\monitoring screen\bar codes>

rgds,

dave.

ruby -E utf-8 script.rb ---> how to pass "-E utf-8" parameters to ocra?

Hi,

I need to run my script.rb with these parameters(ruby 1.9.2): ruby -E utf-8 script.rb
Wihout these parameters I've got error:
C:/Ruby/192-p0/lib/ruby/1.9.1/uri/common.rb:219:in `gsub': incompatible encoding regexp match (US-ASCII regexp with CP28592 string) (Encoding::CompatibilityError)

So when I use script.exe (made by ocra), I've got above error.
How to tell ocra, to prepare script.exe with these parameters?

with best regards
Maciek

Needed encodings are not included in Ruby 1.9 executables

If one writes a script and compiles it with ocra and Ruby 1.9.x on a system using one encoding and then runs the resulting executable on a system using a different encoding, an error like this will be generated:
(internal:enc/prelude):3:in require':code converter not found (ASCII-8BIT to UTF-8) (Encoding::ConverterNotFoundError) from (internal:enc/prelude):3:inblock in (compiled)'
from (internal:enc/prelude):1:in each' from (internal:enc/prelude):1:in(compiled)'
This can occur, for example, if compiled on a system using English is later run on a system using another language like Japanese.

ocra should automatically include the other encodings, in case they are needed.

Can not parse code containing non US characters (Unicode issue)

Fails to run the following single line code containing a german umlaut

puts("This is a test with ä")

ocra main.rb
=== Loading script to check dependencies
C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:1146:in `load': C:/Dokum
ente und Einstellungen/josemi1/Eigene Dateien/NetBeansProjects/Test2/lib/main.rb:1: invalid multibyte char (US-ASCII) (SyntaxError)
C:/Dokumente und Einstellungen/jos/Eigene Dateien/NetBeansProjects/Test2/lib/main.rb:1: invalid multibyte char (US-ASCII)
C:/Dokumente und Einstellungen/jose/Eigene Dateien/NetBeansProjects/Test2/lib/main.rb:1: syntax error, unexpected $end, expecting ')'

puts("This is a test with ä")
^
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:1146:in <t op (required)>' from C:/Ruby192/bin/ocra:19:inload'
from C:/Ruby192/bin/ocra:19:in `<mai

win/api gem problems

inside the win/api gem you find this code in api.rb

if RUBY_VERSION.to_f >= 1.9
require File.join(File.dirname(FILE), 'ruby19/win32/api')
else
require File.join(File.dirname(FILE), 'ruby18/win32/api')
end

which pulls in the appropriate .so file

For now I have patched around this by renaming the api.rb file above to xxxapi.rb and putting the api.so (for 1.8) in the directory. So it pulls the .so file directly, (but I can't just switch to ruby 1.9)

Just wondering if there is anything we can do to automate this "trick" that is being used by I think a popular library.

If you want to reproduce this problem just include the win32/api gem.

Scripts using __END__ and DATA cannot be packed

When Ruby loads the script, DATA is not defined.

puts DATA.read
__END__
Hello, World!

C:\>ocra data.rb
=== Loading script to check dependencies
./data.rb:1: uninitialized constant DATA (NameError)

"Failed to create directory"

Used ocra to create an exe out of a ruby gosu game. Running the exe I get a "Failed to create directory". Im on windows XP, logged in as admin. Any ideas?

no such file to load -- win32ole when running .exe but not ruby script

Local dev box is Windows XP SP3

ruby 1.8.7 (2012-10-12 patchlevel 371) [i386-mingw32]
gem -v => 1.8.24

gem list:
actionmailer (2.3.4)
actionpack (2.3.4)
activerecord (2.3.4)
activeresource (2.3.4)
activesupport (2.3.4)
builder (3.1.4)
cgi_multipart_eof_fix (2.5.0)
commonwatir (1.6.5)
daemons (1.0.10)
fastercsv (1.5.0)
fastthread (1.0.7)
ffi (1.1.5 x86-mingw32)
firewatir (1.6.5)
gem_plugin (0.2.3)
hoe (3.3.0)
i18n (0.6.1)
mongrel (1.1.5)
multi_json (1.3.7)
mysql (2.7.3 mswin32)
net-ssh (2.0.14)
nokogiri (1.5.5 x86-mingw32)
ocra (1.3.0)
rack (1.0.1)
rails (2.3.4)
rake (0.8.7)
rubygems-update (1.3.5)
s4t-utils (1.0.4)
sequel (3.0.0)
user-choices (1.1.6.1)
watir (1.6.5)
will_paginate (2.3.12)
win32-api (1.4.8 x86-mingw32)
win32-process (0.5.5)
windows-api (0.4.2)
windows-pr (1.2.2)
xml-simple (1.1.2)

script works as expected on local dev machine. Use OCRA to create .exe, run .exe on local dev machine and the following error is encountered:

...custom_require.rb:36:in `gem_original_require': no such file to load -- win32ole (LoadError)

script excerpt where this is being called out is on require statement:

require 'win32ole'

autoit = WIN32OLE.new("AutoItX3.Control")

Inexistent temp path leads to deleted files

E:>set TMP=E:\inexistent
E:>set TEMP=E:\inexistent
E:>dir Installation\integration
Volume in drive E is Data
Volume Serial Number is E222-A1111

Directory of E:\Installation\integration

06.02.2012 15:40

.
06.02.2012 15:40 ..
06.02.2012 12:14 104.414.549 aFile.zip
06.02.2012 13:26 3.370.398.641 bFile.zip
06.02.2012 15:01 11.636.519 installer.exe
3 File(s) 3.486.449.709 bytes
2 Dir(s) 51.610.136.576 bytes free

E:>call Installation\integration\installer.exe
FATAL ERROR: Failed to create installation directory.

E:>dir Installation\integration
Volume in drive E is Data
Volume Serial Number is E222-A1111

Directory of E:\Installation\integration

06.02.2012 15:41

.
06.02.2012 15:41 ..
06.02.2012 15:01 11.636.519 installer.exe
1 File(s) 11.636.519 bytes
2 Dir(s) 55.084.953.600 bytes free

E:>

This happens with Ocra-1.3.0. The key for this behavior is that the working directory is not the directory where the ocra executable is located. Seems Ocra tries to cleanup wrong files. Unfortunately when double clicking the Ocra executable via Windows Explorer, the working directory is always C:\Windows\System32, and never the Ocra executable base path. That's critical and happened on two systems I am aware of. Yes, it would be nice the TMP variable would be properly set, but that should imho still not happen.

cannot load such file -- rbconfig (LoadError)

ruby 1.9.3p429 (2013-05-15) [i386-mingw32]

=== WARNING: Gem::DependencyResolver was not loadable
=== WARNING: Gem::RequestSet was not loadable
=== WARNING: Gem::SpecFetcher was not loadable
E:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in require': cannot load such file -- rbconfig (LoadError) from E:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:inrequire'
from E:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.1/bin/ocra:709:in build_exe' from E:/Ruby193/lib/ruby/gems/1.9.1/gems/ocra-1.3.1/bin/ocra:1153:inblock in <top (required)>'

User requested to unblock firewall for Ruby every time

I create a local webserve with Mongrel. The package from OCRA work very perfect!

Except user need to click "unblock" everytime when they run application.
I check in Firewall setting, it has a lot of Ruby Interpreter records (duplication)
every user run application Windows firewall asks everytime.

So I don't know the solution, can we create application signature like normal window application (like author, ....) if it help this issue.

Nokogiri update breaks "require"

ruby 2.0.0p195 (2013-05-14) [i386-mingw32]
ocra (1.3.1)
Inno Setup 5

Build command:
ocra "Daily Workshop Report.rb" --output "Daily Workshop Report.exe" --chdir-first --no-lzma --innosetup "DWR.iss"

Somewhere between nokogiri-1.5.9-x86-mingw32 and nokogiri 1.6.0 the require path for Ocra seems to have broken.

Here's the error when running after install:

C:\Users\Joel\Desktop\Files\Projects\Daily Workshop Report MI043>"C:\Program Fil
es (x86)\Daily Workshop Report\Daily Workshop Report.exe"
C:/Program Files (x86)/Daily Workshop Report/lib/ruby/site_ruby/2.0.0/rubygems/c
ore_ext/kernel_require.rb:116:in require': cannot load such file -- nokogiri (L oadError) from C:/Program Files (x86)/Daily Workshop Report/lib/ruby/site_ruby/2.0 .0/rubygems/core_ext/kernel_require.rb:116:inrescue in require'
from C:/Program Files (x86)/Daily Workshop Report/lib/ruby/site_ruby/2.0
.0/rubygems/core_ext/kernel_require.rb:122:in require' from C:/Program Files (x86)/Daily Workshop Report/lib/ruby/gems/2.0.0/ge ms/mechanize-2.7.1/lib/mechanize.rb:8:in<top (required)>'
from C:/Program Files (x86)/Daily Workshop Report/lib/ruby/site_ruby/2.0
.0/rubygems/core_ext/kernel_require.rb:116:in require' from C:/Program Files (x86)/Daily Workshop Report/lib/ruby/site_ruby/2.0 .0/rubygems/core_ext/kernel_require.rb:116:inrescue in require'
from C:/Program Files (x86)/Daily Workshop Report/lib/ruby/site_ruby/2.0
.0/rubygems/core_ext/kernel_require.rb:122:in require' from C:/Program Files (x86)/Daily Workshop Report/src/bin/MechReporter.r b:7:in<top (required)>'
from C:/Program Files (x86)/Daily Workshop Report/src/Daily Workshop Rep
ort MI043/Daily Workshop Report.rb:18:in require_relative' from C:/Program Files (x86)/Daily Workshop Report/src/Daily Workshop Rep ort MI043/Daily Workshop Report.rb:18:in

'

Uninstalling the Inno/Ocra-built program and re-running it with Nokogiri 1.5.9 works fine.

Installing thje 1.5.9 version over the top without previously uninstalling the program doesn't remove the gem files for Nokogiri 1.6.0 and this error remains.

Manually deleting Nokogiri 1.6.0 after running the Inno/Ocra installer works as long as there is a previous version of Nokogiri also in the gem library.

Unable to Use Ocra With watir-webdriver

For whatever reason, ocra seems to have problems with watir-webdriver.

Here's some sample code:

require 'watir-webdriver'
browser = Watir::Browser.new :firefox
pause

This is the error when I try to launch the exe:

internal:lib/rubygems/custom_require:29:in require': no such file to load -- watir-webdriver (LoadError) from <internal:lib/rubygems/custom_require>:29:inrequire'
from C:/Users/Drew/AppData/Local/Temp/ocr898A.tmp/src/watirwebdrivertest
.rb:1:in `

'

custom icon is not working

i am using ruby 1.9 i am using below command to create ruby script to exe.

ocra script.rb --icon icon.ico --output output.exe

it is displaying error edicon.exe has stopped working. i am using window 7.I tried other extension(.jpg,.png) of icon also but it's giving same error.For .jpg no error is displaying but custom icon is not displaying for exe.Exe is working fine no problem in exe.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.