From: Rochit Sen Date: 2013-06-21T19:24:37+09:00 Subject: Re: Creating ruby script exe Joel Pearson wrote in post #1112855: > Ocra scans your script before it executes it anyway, but you might find > you'll need to actively use some gems for them to picked up properly. > > Here's an excerpt from a class I use with Ocra builds sometimes: > > ________ > > def initialize > > # Allow EXE build without running. > if defined?(Ocra) > # Let OCRA pick up the cookies from Mechanize. > Mechanize.new.cookies > # Quit so Ocra can do its thing. > exit > end > > # Normal stuff goes here... > @agent = Mechanize.new > > end Hi Joel,All I found a option for ocra: --no-dep-run using this ocra does not run my script and created .exe. This part is resolved. Now my script has some require statements as well for gems. So i created a bundler file using: bundle init Then added the following in my Gemfile: source "https://rubygems.org" gem "file-tail" gem "pony" I then ran the: bundle install which created a Gemfile.lock Then finally i ran the following ocra command: C:code>ocra --console --gemfile Gemfile --no-dep-run tailtest.rb Upon running it scans the Gemfile and then gives me error as below: --- === Scanning Gemfile C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1879:in `method_mi ssing': undefined method `installation_path' for # (NoMethodError) from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:557:in `blo ck in find_gem_files' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:556:in `fin d_gem_files' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:701: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 ' --- My script has the following statements in the beginning: require 'rubygems' require 'bundler/setup' Bundler.require Thanks in advance! -- Posted via http://www.ruby-forum.com/.