help to run Ruby

B

balzer

I am on windows XP.

Ruby.exe is in directory "bin":
E:\Ruby\bin

script is in directory "embed":

E:\Ruby\myprogram-beta1\sources\scripts\embed

how to run script which is in embed dir?

thanks
 
L

Luis Lavena

I am on windows XP.

Ruby.exe is in directory "bin":
E:\Ruby\bin

script is in directory "embed":

E:\Ruby\myprogram-beta1\sources\scripts\embed

how to run script which is in embed dir?

E:\Ruby\bin\ruby.exe E:\Ruby\myprogram-beta1\sources\scripts\embed


Or preferable you add Ruby\bin to your PATH:

SET PATH=%PATH%;E:\Ruby\bin

And then you can invoke "ruby embed" directly from inside the scripts
folder.

HTH,
 
B

balzer

I am on windows XP.

Ruby.exe is in directory "bin":
E:\Ruby\bin

script is in directory "embed":

E:\Ruby\myprogram-beta1\sources\scripts\embed

how to run script which is in embed dir?

E:\Ruby\bin\ruby.exe E:\Ruby\myprogram-beta1\sources\scripts\embed


Or preferable you add Ruby\bin to your PATH:

SET PATH=%PATH%;E:\Ruby\bin

And then you can invoke "ruby embed" directly from inside the scripts
folder.

HTH,
--
Luis Lavena
------------


to add Ruby\bin to your PATH with:

SET PATH=%PATH%;E:\Ruby\bin

or

SET PATH=%PATH%;E:\Ruby\bin\ruby.exe

To invoke command directly from inside the scripts folder, should I
directly run MS-DOS command ruby.exe embed.rb
C:\Documents and Settings\User> ruby.exe embed.rb
or or first change directory from default windows to
E:\> ruby.exe embed.rb ?

THANKS.
 
L

Luis Lavena

to add Ruby\bin to your PATH with:

SET PATH=%PATH%;E:\Ruby\bin

or

SET PATH=%PATH%;E:\Ruby\bin\ruby.exe

No, you add directories, not executables.
To invoke  command directly from inside the scripts folder, should I
directly run MS-DOS command ruby.exe embed.rb
C:\Documents and Settings\User>  ruby.exe embed.rb
or or first change directory from default windows to
E:\> ruby.exe embed.rb ?

You change (cd) into the directory that contains your scripts,
whatever.

Since Ruby's bin directory is in the search path, invoking "ruby" is
enough to locate it properly.
 
T

Thomas Volkmar Worm

BTW: If you use 4nt from jpsoft, which is a cmd.exe replacement,
you can do the following:

set PATH=E:\Ruby\bin;E:\Ruby\myprogram-beta1\sources\scripts\embed;%PATH%
set .rb=ruby.exe

The last one says, treat ruby scripts as executables through ruby.exe.

lets say, your script is myprog.rb then you can call it like this:

C:> myprog

But if the path to your prog only contains one ruby script worth starting
directly, it does not make much sense to put its directory into PATH.
Then you could setup an alias to achieve the same:

alias myprog=E:\Ruby\myprogram-beta1\sources\scripts\embed\myprog.rb

get 4nt. jpsoft has a free version and it is really worth testing. On
windows I use it for years.


4nt has a file 4start.btm (or so) where you can put such settings in.
Then when you start 4nt, everything is setup automatically. Another nice
thing about 4nt: It comes with an installer, but you can take the 4nt-
directory and move it somewhere else, eg. onto an usb-stick. This way I
run a full sack of software: ruby, perl, python, java, php, mysql,
apache, firefox, thunderbird, openoffice and another 50-100 open source
software packages.


But if you want to stick with cmd.exe, you could do it this way:

make a bin-folder lets say in E:\bin and put it into PATH

set PATH=E:\Ruby\bin;E:\bin;%PATH

Then but a bat-file into E:\bin with the name of your prog, myprog.bat:

--- snip ---
@echo off
setlocal
ruby E:\Ruby\myprogram-beta1\sources\scripts\embed\myprog.rb %*
--- snip ---

%* passes all the arguments you give to the bat-file to your ruby script.

now you can call your prog

C:> myprog


Thomas
 
B

balzer

Thomas Volkmar Worm said:
BTW: If you use 4nt from jpsoft, which is a cmd.exe replacement,
you can do the following:

set PATH=E:\Ruby\bin;E:\Ruby\myprogram-beta1\sources\scripts\embed;%PATH%
set .rb=ruby.exe

The last one says, treat ruby scripts as executables through ruby.exe.

lets say, your script is myprog.rb then you can call it like this:

C:> myprog

But if the path to your prog only contains one ruby script worth starting
directly, it does not make much sense to put its directory into PATH.
Then you could setup an alias to achieve the same:

alias myprog=E:\Ruby\myprogram-beta1\sources\scripts\embed\myprog.rb

get 4nt. jpsoft has a free version and it is really worth testing. On
windows I use it for years.


4nt has a file 4start.btm (or so) where you can put such settings in.
Then when you start 4nt, everything is setup automatically. Another nice
thing about 4nt: It comes with an installer, but you can take the 4nt-
directory and move it somewhere else, eg. onto an usb-stick. This way I
run a full sack of software: ruby, perl, python, java, php, mysql,
apache, firefox, thunderbird, openoffice and another 50-100 open source
software packages.


But if you want to stick with cmd.exe, you could do it this way:

make a bin-folder lets say in E:\bin and put it into PATH

set PATH=E:\Ruby\bin;E:\bin;%PATH

Then but a bat-file into E:\bin with the name of your prog, myprog.bat:

--- snip ---
@echo off
setlocal
ruby E:\Ruby\myprogram-beta1\sources\scripts\embed\myprog.rb %*
--- snip ---

%* passes all the arguments you give to the bat-file to your ruby script.

now you can call your prog

C:> myprog


Thomas
---------------------
I use Ruby without installer, ruby-1.8.7-p72-i386-mswin32
Just tried to run script , but got error: "The application has failed to
start because SSLEAY32.dll was not found. Reinstalling the application may
fix this problem."
Here is part of output printed in DOS window:

e:/ruby/lib/ruby/1.8/i386-mswin32/openssl.so: 126: The specified module
could no
t be found. - e:/ruby/lib/ruby/1.8/i386-mswin32/openssl.so (LoadError)
from e:/ruby/lib/ruby/1.8/openssl.rb:17
from ../../parser/signature.rb:22:in `require'
from ../../parser/signature.rb:22
from ../../parser/pdf.rb:47:in `require'
from ../../parser/pdf.rb:47
from ../../parser/parser.rb:24:in `require'
from ../../parser/parser.rb:24
from embed.rb:5:in `require'
from embed.rb:5



Thank you.
 
L

Luis Lavena

---------------------
I use Ruby without installer, ruby-1.8.7-p72-i386-mswin32
Just tried to run script , but got error: "The application has failed to
start because SSLEAY32.dll was not found. Reinstalling the application may
fix this problem."
Here is part of output printed in DOS window:

Using the mswin32 downloads form ruby-lang requires you additional
instructions, as noted in the ruby-lang download page:

http://www.ruby-lang.org/en/downloads/

"Please note that some of the above binaries will require manual
download and installation of additional components detailed on this
page. Please ensure you’ve followed/performed these steps prior
reporting a bug."

And if you keep reading:

"The RubyInstaller does not require these additional tasks."

The RubyInstaller binaries are here:

http://rubyinstaller.org/
 
B

balzer

message




















---------------------
I use Ruby without installer, ruby-1.8.7-p72-i386-mswin32
Just tried to run script , but got error: "The application has failed to
start because SSLEAY32.dll was not found. Reinstalling the application may
fix this problem."
Here is part of output printed in DOS window:

Using the mswin32 downloads form ruby-lang requires you additional
instructions, as noted in the ruby-lang download page:

http://www.ruby-lang.org/en/downloads/

"Please note that some of the above binaries will require manual
download and installation of additional components detailed on this
page. Please ensure you’ve followed/performed these steps prior
reporting a bug."

And if you keep reading:

"The RubyInstaller does not require these additional tasks."

The RubyInstaller binaries are here:

http://rubyinstaller.org/
 
L

Luis Lavena

----------

Does the RubyInstaller install some libraries into Windows system directory?
Does it use Registry or config file to store program settings? Does it
install Cygwin?

You have two versions: with Installer or extractable packages (7-Zip)

The Installer version offer to register as default executing option
for .rb files and also allow you add Ruby to the search path. This
option is not portable.

The 7-Zip package is portable, extract on any directory, add the bin
directory to the PATH (as explained before) and call scripts with
"ruby myscript.rb"

Is not Cygwin nor install it.
 
B

Barry O'gorman

Luis Lavena wrote in post #911385:
E:\Ruby\bin\ruby.exe E:\Ruby\myprogram-beta1\sources\scripts\embed


Or preferable you add Ruby\bin to your PATH:

SET PATH=3D%PATH%;E:\Ruby\bin

And then you can invoke "ruby embed" directly from inside the scripts
folder.

HTH,


I am having issues - which I think relate to the PATH. I have done the
following:

SET PATH=3D%PATH%:C:\ruby192\bin

I have enclosed screen shot showing what happens when I try to generate
controller

-- =

Posted via http://www.ruby-forum.com/.=
 

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,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top