ruby2exe

J

Junkone

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:in `require'
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:in `require'
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
 
J

James Dinkel

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

James
 
J

Junkone

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....
 
A

Axel

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:

<snip>
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
</snip>

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:
<snip>
@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
</snip>

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
 
R

rpminihan

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:

<snip>
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
</snip>

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:
<snip>
@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
</snip>

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

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
 
R

Raveendran Perumalsamy

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/rub.../f922ec9ef52af7e4?tvc=1&#doc_cd01f5645fdf9c8d


Still no solution for this issue
 
J

James Dinkel

Wu said:
Maybe you should try ocra instead of rubyscript2exe,it's excellentï¼
It support ruby1.9,waitr and so on.
http://github.com/larsch/ocra/tree/master

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.
 
L

Leslie Viljoen

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|
 
R

Raveendran Perumalsamy

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
 
B

Bigmac Turdsplash

rubyscript2exe.rb

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,117
Latest member
Matilda564
Top