Ruby2exe

i get a error i dont understand. pl help
E:\TradingTools\Development\app\helpers>rubyscript2exe sendIM.rb
Tracing sendIM …
e:/ruby/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:19:
uninitialized constant Gem::Exception (NameError)
from e:/ruby/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:
4:in require' from e:/ruby/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:4 from e:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb: 10:inrequire’
from e:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:
10
from e:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:767:in
require' from e:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:767 from e:/ruby/lib/ruby/site_ruby/1.8/rubygems/exceptions.rb: 1:inrequire’
from e:/ruby/lib/ruby/site_ruby/1.8/rubygems/exceptions.rb:1
Couldn’t execute this command (rc=256):
e:\ruby\bin\ruby -r ‘rubygems/rubygems_version.rb’ -r ‘rubygems/
defaults.rb’ -r ‘thread.so’ -r ‘thread.rb’ -r ‘rbconfig.rb’ -r
‘rubygems/exceptions.rb’ -r ‘rubygems/requirement.rb’ -r ‘rubygems/
version.rb’ -r ‘rubygems/dependency.rb’ -r ‘rubygems/
gem_path_searcher.rb’ -r ‘rubygems/user_interaction.rb’ -r ‘rubygems/
platform.rb’ -r ‘rubygems/specification.rb’
-r ‘zlib.so’ -r ‘socket.so’ -r ‘timeout.rb’ -r ‘net/protocol.rb’ -r
‘uri/common.rb’ -r ‘uri/generic.rb’ -r ‘uri/ftp.rb’ -r ‘uri/http.rb’ -
r ‘uri/https.rb’ -r ‘uri/ldap.rb’ -r ‘uri/mailto.rb’ -r ‘uri.rb’ -r
‘net/http.rb’ -r ‘stringio.so’ -r ‘rubygems/remote_fetcher.rb’ -r
‘rubygems/spec_fetcher.rb’ -r ‘rubygems/source_index.rb’ -r ‘rubygems/
builder.rb’ -r ‘rubygems/custom_require.rb’ -r ‘rubygems.rb’ -r
‘ubygems.rb’ -r ‘etc.so’ -r ‘fileutils.rb’ -I

rubyscript2exe has problems with rubygems 1.2.0. You’ll need to
downgrade to rubygems 1.1.1.

James

You’ll need to downgrade to rubygems 1.1.1.

You don’t have to. This topic has been discussed before:

https://groups.google.com/group/ruby-talk-google/tree/browse_frm/thread/f922ec9ef52af7e4/79ed5e66091744bb?rnum=1&_done=%2Fgroup%2Fruby-talk-google%2Fbrowse_frm%2Fthread%2Ff922ec9ef52af7e4%3Ftvc%3D1%26#doc_cd01f5645fdf9c8d

gegroet,
Erik V.

On Sep 20, 5:42 am, Erik V. [email protected] wrote:

You’ll need to downgrade to rubygems 1.1.1.

You don’t have to. This topic has been discussed before:

https://groups.google.com/group/ruby-talk-google/tree/browse_frm/thre

gegroet,
Erik V.

i tried this
E:\TradingTools\Development\app\helpers>unset RUBYOPT
‘unset’ is not recognized as an internal or external command,
operable program or batch file.

but unset does not work in my machine. infact in that thread, the last
note is that thread seems that the issue is unresolved. are there any
more suggestions or i have to downgrade…

On Sep 21, 2:03 am, Axel [email protected] wrote:

:: begin long line
by your absolute path to your rubyscript2exe
cd %0..
:: begin long line
by your absolute path to your rubyscript2exe
wording?)

Please let me know if this works for you, too.

Have a nice day,

Axel

One little change. ruby C:\ruby\lib\ruby\gems\1.8\gems
\rubyscript2exe-0.5.3\bin\rubyscript2exe %1
–rubyscript2exe-verbose

%1 in the command line allows you to specify the path+filename of the
ruby program on the command line. Makes your script a little more
generic.

Ryan

Hello,

I had the same problem two weeks ago and managed to solve it with the
following .bat file.
(The bat file starts rubyscript2exe.)

Short version:

set rubyopt= :: begin long line ruby C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3\bin \rubyscript2exe diashow.rb --rubyscript2exe-verbose :: end long line set rubyopt=-rubygems pause

Replace
C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3\bin
\rubyscript2exe
by your absolute path to your rubyscript2exe

Replace
diashow.rb
by the path to your ruby file you want to convert into an exe.

Long version:

@echo off
cd
:: Setting working dir to the dir of this .bat file:
cd %0…

if “%OS%”==“Windows_NT” ((cd /d %~dp0)&(goto next))
echo %0 | find.exe “:” >nul
if not errorlevel 1 %0
cd %0…
:next
echo Working dir:
cd

set rubyopt=
:: begin long line
ruby C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3\bin
\rubyscript2exe diashow.rb --rubyscript2exe-verbose
:: end long line
set rubyopt=-rubygems
pause

Replace
C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3\bin
\rubyscript2exe
by your absolute path to your rubyscript2exe

Replace
diashow.rb
by the path to your ruby file you want to convert into an exe.

I’m using:

  • gem 1.2.0
  • rubyscript2exe-0.5.3
  • ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
  • Windows XP Home, running with administratory rights (right English
    wording?)

Please let me know if this works for you, too.

Have a nice day,

Axel

I am getting this error

C:/DOCUME~1/RAVEEN~1/LOCALS~1/Temp/tar2rubyscript.d.3048.1/rubyscript2exe/require2lib.rb:60:in
gat herlibs': undefined method list’ for Gem::Specification:Class
(NoMethodError)
from
C:/DOCUME~1/RAVEEN~1/LOCALS~1/Temp/tar2rubyscript.d.3048.1/rubyscript2exe/require2lib.
rb:30
from jazzez-FFbook-urls.rb:16
Couldn’t execute this command (rc=256):
C:\ruby\bin\ruby -I
‘C:/DOCUME~1/RAVEEN~1/LOCALS~1/Temp/tar2rubyscript.d.3048.1/rubyscript2exe’
-I
‘C:/DOCUME~1/RAVEEN~1/LOCALS~1/Temp/tar2rubyscript.d.3048.1’ -I
‘C:/ruby/lib/ruby/site_ruby/1.8’ -
I ‘C:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt’ -I
‘C:/ruby/lib/ruby/site_ruby’ -I ‘C:/ruby/lib/ruby
/1.8’ -I ‘C:/ruby/lib/ruby/1.8/i386-mswin32’ -I ‘.’ -I ‘C:/ruby/bin’ -I
‘C:/DOCUME~1/RAVEEN~1/LOCAL
S~1/Temp/tar2rubyscript.d.3048.1/rubyscript2exe’ -I
‘C:/DOCUME~1/RAVEEN~1/LOCALS~1/Temp/tar2rubyscr
ipt.d.3048.1/rubyscript2exe/lib’ -I
‘C:/DOCUME~1/RAVEEN~1/LOCALS~1/Temp/tar2rubyscript.d.3048.1/rub
yscript2exe’ -I
‘C:/DOCUME~1/RAVEEN~1/LOCALS~1/Temp/tar2rubyscript.d.3048.1/rubyscript2exe/lib’
-r
‘C:/DOCUME~1/RAVEEN~1/LOCALS~1/Temp/tar2rubyscript.d.3048.1/rubyscript2exe/require2lib.rb’
‘jazzez-
FFbook-urls.rb’ --require2lib-verbose
Stopped.

Bat file code:

echo off
cd
:: Setting working dir to the dir of this .bat file:
cd %0..

if “%OS%”==“Windows_NT” ((cd /d %~dp0)&(goto next))
echo %0 | find.exe “:” >nul
if not errorlevel 1 %0
cd %0..
:next
echo Working dir:
cd

set rubyopt=
:: begin long line
ruby
C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3\bin\rubyscript2exe
%1 --rubyscript2exe-verbose
:: end long line
set rubyopt=-rubygems
pause

I have tried from the link →
https://groups.google.com/group/ruby-talk-google/tree/browse_frm/thread/f922ec9ef52af7e4/79ed5e66091744bb?rnum=1&_done=/group/ruby-talk-google/browse_frm/thread/f922ec9ef52af7e4%3Ftvc%3D1%26#doc_cd01f5645fdf9c8d

Still no solution for this issue

You’re right. Thank you!

Axel

Maybe you should try ocra instead of rubyscript2exe,it’s excellent!
It support ruby1.9,waitr and so on.

Wu Junchen wrote:

Maybe you should try ocra instead of rubyscript2exe,it’s excellent!
It support ruby1.9,waitr and so on.
GitHub - larsch/ocra: One-Click Ruby Application Builder

I’ve pretty much given up on r2exe. I don’t want to be stuck using an
old version of ruby and rubygems, and rc2exe development has been
abandoned. it looks like OCRA is the new choice, although I do not like
it nearly as well as r2exe.

Hi Wu and james,

Yes. Ocra Rocks.

Thanks
P.Raveendran

On Fri, Sep 4, 2009 at 9:08 AM, Raveendran
Perumalsamy[email protected] wrote:

I am getting this error

C:/DOCUME~1/RAVEEN~1/LOCALS~1/Temp/tar2rubyscript.d.3048.1/rubyscript2exe/require2lib.rb:60:in
gat herlibs': undefined method list’ for Gem::Specification:Class
(NoMethodError)

I have fixed this in my own local copy of RubyScript2Exe because I
can’t get Ocra to work
(my Ocra problem is here:
http://rubyforge.org/forum/forum.php?thread_id=45617&forum_id=31710)

If you need to get RubyScript2Exe working on Windows, do this:

c:
cd \ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3

C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3>ruby realstuff.rb --tar2rubyscript-justextract
C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3>cd rubyscript2exe

… now make the changes mentioned below, then repackage with:

C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3>tar2rubyscript rubyscript2exe realstuff.rb

The changes needed are in require2lib.rb, line 60 onwards needs to be
like so:

#Gem::Specification.list.each do |gem|
Gem.loaded_specs.each do |name, gem|
#if gem.loaded?
$stderr.puts “Found gem #{gem.name} (#{gem.version}).” if
VERBOSE

      fromdir  = File.join(gem.installation_path, "specifications")
      todir    =

File.expand_path(“rubyscript2exe.gems/specifications”, LIBDIR)

      fromfile  = File.join(fromdir, "#{gem.full_name}.gemspec")
      tofile  = File.join(todir, "#{gem.full_name}.gemspec")

      File.copy(fromfile, tofile)

      fromdir  = gem.full_gem_path
      todir    =

File.expand_path(File.join(“rubyscript2exe.gems/gems”, gem.full_name),
LIBDIR)

      Dir.copy(fromdir, todir)

      Dir.find(todir).each do |file|
        if File.file?(file)
          gem.require_paths.each do |lib|
            unless lib.empty?
              lib  = File.expand_path(lib, todir)
              lib  = lib + "/"

              requireablefiles << file[lib.length..-1]  if file =~ 

/^#{lib}/
end
end
end
end
#end

  end
end

($" + LOADED).each do |req|

rubyscript2exe.rb

what is all that random junk at the bottem of the script? can this be
removed?

Hi,

Error when i run the last command.

Error details:

C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3>tar2rubyscript
rubyscript2exe realstuff.rb
‘tar2rubyscript’ is not recognized as an internal or external command,
operable program or batch file.

–tar2rubyscript-justextract

C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3>cd rubyscript2exe

… now make the changes mentioned below, then repackage with:

C:\ruby\lib\ruby\gems\1.8\gems\rubyscript2exe-0.5.3>tar2rubyscript rubyscript2exe realstuff.rb