ocra
ocra copied to clipboard
cannot load such file - rubygems.rb. :-(
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!
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.
Me too... using ruby 2.3.3 and the cmd: ocra test.rb
and test.exe
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 ;-(
I have the same issue. I tried with ruby 2.3.0 and got the exact same error message as bunkan.