ocra icon indicating copy to clipboard operation
ocra copied to clipboard

cannot load such file - rubygems.rb. :-(

Open hongliang-goudou opened this issue 11 years ago • 4 comments

Ruby version is 1.9.3 and I installed it by using RailsInstaller which contains Ruby 1.9.3-p429. I use ocra to make an exe file for a very single ruby file and test the exe file on a new Windows XP machine. It complains:

<internal:gem_prelude>:1:in `require`: cannot load such file -- rubygems.rb <LoadError>
       from <internal:gem_prelude>:1:in `<compiled>'

The ruby script is quite simple:

puts 'Here you go!'
gets # for not closing the terminal window so quickly

The ocra command:

ocra abc.rb --output abc.exe --add-all-core --gem-full --chdir-first

UPDATE: While I re-install RubyInstall and this time I chose 1.9.2-p0 as suggested by ocra official document, the exe result is different:

<internal:enc/prelude>:3:in 'require': code converter not found <ASCII-8BIT to UTF-8> <Encoding:ConverterNotFoundError>
        from <internal:enc/prelude>:3:in 'block in <compiled>'
        from <internal:enc/prelude>:1:in `block in 'each'
        from <internal:enc/prelude>:1:in `block in '<compiled>'

Can anyone help me out of this? Please. Thank you!

hongliang-goudou avatar Aug 19 '13 10:08 hongliang-goudou

I'm experiencing the same problem. My Ruby version is 2.1.5. I tried to append 'unless ENV['OCRA_EXECUTABLE']' to require 'rubygems' and require 'bundler/setup' lines. I even tried to delete these two line, but the error remains the same. Please help.

3str avatar Feb 02 '15 07:02 3str

Me too... using ruby 2.3.3 and the cmd: ocra test.rb and test.exe

khiav223577 avatar Jun 03 '17 10:06 khiav223577

Your problem is similar to mine. I use Ruby 2.3.0p0-32bit installed by RubyInstaller, Ocra-1.3.10, on Windows10(64bit). I tested on Windows10(64).

It appear error message, internal:gem_prelude:4:in require: cannot load such file -- rubygems.rb (LoadError) from internal:gem_prelude:4:in `internal:gem_prelude'

Script "Hello.rb" is puts "Hello World!!"

Ocra command is

ocra Hello.rb

I tried on Ruby2.0.0, 2.1.5, 2.2.4, 2.3.5 with Ocra-1.3.10, same error message appeared. Please help ;-(

bunkan avatar Nov 23 '17 04:11 bunkan

I have the same issue. I tried with ruby 2.3.0 and got the exact same error message as bunkan.

Lemontrace avatar Dec 09 '17 14:12 Lemontrace