You are here

Is the use of batch files the only way to accomplish some things?

47 posts / 0 new
Last post
ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
Is the use of batch files the only way to accomplish some things?

I'm trying to make a portable Ruby that launches an editor and a cmd.exe window along with it. The launcher works in that it starts Ruby, but I cannot seem to make the environmental variables for "Path" stick, and I end up with an open and unused window (if I hide the window, I have to kill Ruby using the Task Manager). I'm trying to overcome these problems before adding the additional parts.

I asked on the IRC channel and I was told that I had to use a batch file. I am not against trying to do this, but I see posts that say it is better to stick to the scripting system, which seems logical to me.

I'm new at this and not a programmer, so I'd prefer to be pointed in the right direction rather than be spoon-fed the answers.

My questions are:

1) Can I accomplish these things in the basic launcher.ini (RubyPortable.ini) or do I need custom script, and if so, where is the best source for how to do it?

2) Are batch files really a 'bad' way to accomplish this?

Thanks in advance for any help

3D1T0R
3D1T0R's picture
Offline
Last seen: 3 years 4 months ago
Developer
Joined: 2006-12-29 23:48
Sorry but I can't help you unless you 'spoonfeed' me the problem

"Spoonfed" or not, it's easiest for us to help you if we can see what you have so far, and what (exactly) you're trying to accomplish.
I'd point you to the [Environment] section of the PortableApps.com Launcher Manual but I can see from the IRC logs that Gizmokid2005 already did, and that you apparently had already found it even then.
I really like your "I don't know what I don't know" line, but without more information from you, I don't know what you don't know either.

As to your second question, there are some things which can't be done strictly with the PAL INI files, but usually we try to accomplish them with Custom Code rather than resorting to BAT files. Not that batch scripts are evil or anything, and they can be quite useful in figuring out what you need to do, but we generally try to use PAL and/or NSIS to do our portablisations if possible.

If I had more Ruby experience, I might be able to guess at some of this, but … I don't, sorry. Perhaps someone else who does know some more about Ruby can help, but if I'm to help I'll need more information first.

~3D1T0R

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
Problems making a portable Ruby

3D1T0R,

Thanks for your quick reply.

Basically, I want to make Ruby portable, using the PortableApps format, and including showing a command prompt; once I get that working I want to include an editor to be launched with it (either Notepad++Portable or gvimPortable).

Here is the 'Control' section of my appinfo.ini:

[Control]
Icons=1
Start=RubyPortable.exe

[Associations]
FileTypes=rb,rbw

Here is my RubyPortable.ini (launcher.ini):

[Launch]

ProgramExecutable=Ruby\bin\ruby.exe
[Environment]
PATH=%PATH%;%PAL:AppDir%\RubyPortable
RubyPortable_HOME=%PAL:DataDir%\settings

The launcher generator builds with no errors, and when I test the launcher I can see by checking the Task Manager that the Ruby interpreter is running with a blank command line window; if I use 'HideCommandLineWindow' to hide that window, the only way (I know of) to quit Ruby is to kill the process in Task Manager. Again, I want to be able to replace that empty command window with one that I can issue commands in, and for it to end both itself and the Ruby interpreter when I close or exit it, and for it to 'know' the path to the Ruby interpreter.

By opening a new command line window, I can only run ruby -version from the bin directory in my RubyPortable.ini file, making me believe that something is either wrong with my 'Environment' section or that it isn't even the correct approach for me to use. The way I understand it, the path in the 'Environment' section is like using 'SET' in a batch file... is that correct? Or do I need custom code to do this?

I'm not a programmer, although I can program rudimentary things, and so if I need to I think I can probably figure out custom code or batch files if that is what I need to do. I'm just kind of unsure if I am even on the right track. I've been through the manuals completely (more than once) and looked at all of the suggested apps as well as many others, to no avail.

Once I get this working, I'll be glad to document my entire process for others to see if that would be useful, and even contribute it to be made available for others.

Thanks again.

EPS

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 32 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Local

How do you 'run' Ruby locally? Do you run ruby.exe and then it creates its own command prompt you can issue commands in? If so, why is it not doing so when run from another EXE? If not and you just need a regular command line window, then you won't be able to use PAL because you should be launching CMD.exe whose location can vary. Starting from Command Prompt Portable would likely make more sense. Actually, if the latter is the case, we could consider Ruby being added as a CommonFiles plugin and adding support within Command Prompt Portable for it. CPP already supports Java and sets up the proper environment variables automatically, for instance.

Starting an editor at the same time would not make sense, though. Users are free to start Notepad++ themselves, of course. Many users prefer different editors which is why we have several.

Sometimes, the impossible can become possible, if you're awesome!

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
'Running' Ruby Locally

John,

Thank you for your help.

Some history might help. Several years ago there was a portable Ruby project on About.com, which I built and 'lost' somewhere (it's several versions old in any case). If you do a search for 'portable Ruby,' plenty of links come up referencing that series of articles. While you can see the pages courtesy of the Wayback Machine, the files About.com (template, script, etc) are no longer available.

Perhaps I am over-complicating things because of that experience. The script involved was several hundred lines long (possibly necessitated by an older version of the PAF), so I had it in my mind that the 'modern' procedure might still be somewhat complicated and I overlooked the obvious - seeing how a 'normal' install functions and going from there - a rookie mistake.

For what it's worth, generally my process is to carefully document what I have, document what I am going to change, make the changes, test the changes, and document the results.

I installed Ruby in a normal fashion, and the start menu shortcut is this:

C:\Windows\System32\cmd.exe /E:ON /K C:\Ruby200\bin\setrbvars.bat

The actual setrbvars.bat file contains this:

@ECHO OFF
REM Determine where is RUBY_BIN (where this script is)
PUSHD %~dp0.
SET RUBY_BIN=%CD%
POPD

REM Add RUBY_BIN to the PATH
REM RUBY_BIN takes higher priority to avoid other tools
REM conflict with our own (mainly the DevKit)
SET PATH=%RUBY_BIN%;%PATH%
SET RUBY_BIN=

REM Display Ruby version
ruby.exe -v

I created my RubyPortable.ini (launcher.ini) to read:

[Launch]
ProgramExecutable=Ruby\bin\RubyPortable.bat

I created 'RubyPortable.bat' in 'Ruby\bin' (which is how my directory structure is, and it contains the original (above) with the following change:

1) I placed the startmenu target command inside the batch file and I removed the 'C:' drive reference from it
2) I changed the 'Ruby200\bin' to 'Ruby\bin' to mirror my setup

Here is my version of the batch file:

C:\Windows\System32\cmd.exe /E:ON /K \Ruby\bin\setrbvars.bat
@ECHO OFF
REM Determine where is RUBY_BIN (where this script is)
PUSHD %~dp0.
SET RUBY_BIN=%CD%
POPD

REM Add RUBY_BIN to the PATH
REM RUBY_BIN takes higher priority to avoid other tools
REM conflict with our own (mainly the DevKit)
SET PATH=%RUBY_BIN%;%PATH%
SET RUBY_BIN=

REM Display Ruby version
ruby.exe -v

The launch generator doesn't throw off any errors (I haven't checked the log), but when I try to test it I get a command window labeled 'C:WINDOWS\system32\cmd.exe' with this inside of it:

D:\PortableApps\RubyPortable>C:\Windows\System32\cmd.exe /E:ON /K \Ruby\bin\setrbvars.bat
The system cannot find the path specified.

D:\PortableApps\RubyPortable>

'ruby -v' reports the version if done from withing 'Ruby\bin' (it throws up an error message from anywhere else) which means the interpreter is running, but I still haven't gotten the path problem figured out.

So I think I am getting close. Apart from getting it to work properly, my question is now 'Do I need to use that original batch file to accomplish my goal, or can it all be done from the launcher.ini (RubyPortable.ini)?'

Thanks again for your help. While I am still struggling to get it working, your reply helped me get the command window part working.

EPS

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 32 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Post

You likely don't need the stuff with cmd.exe at all. I'd recommend storing Ruby within RubyPortable\App\Ruby for consistency with other apps. (The word 'portable' isn't used within app names within App) The environment variables should be set in your launcher.ini:

[Environment]
RUBY_BIN=%PAL:AppDir%\Ruby\bin
PATH=%PAL:AppDir%\Ruby\bin;%PATH%

And then your bat file need only be:

@ECHO OFF
prompt $p$g
title Ruby Portable
cls
ruby.exe -v

I'm unsure if the CMD window will close on completion of the BAT or not offhand, though, from PAL. Command Prompt Portable uses a custom NSI to ensure it all works and does not use PAL.

Sometimes, the impossible can become possible, if you're awesome!

3D1T0R
3D1T0R's picture
Offline
Last seen: 3 years 4 months ago
Developer
Joined: 2006-12-29 23:48
Needs the /K switch.

You can tell PAL that the ProgramExecutable is a batch file, but (as you surmised) the Command Prompt window will close when the batch script terminates. The way to change this behaviour from default is to run your command in an instance of CMD which has been passed the /K switch, so your options are to run CMD /K [BatchFile].bat (as is done by the installed version) or to run CMD /K [Something] at the point in your batch file where it should begin taking commands from the user.

For example:

@ECHO OFF
prompt $p$g
title Ruby Portable
cls
CMD /E:ON /K ruby.exe -v

Note: /E:ON enables command extensions. (for more info about what enabling command extensions does run CMD /?)

~3D1T0R

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
The /K Switch

3D1T0R,

Thanks for all your help. I was able to get it working as expected (see my reply to John) with both of your help.

irb works as expected by simply issuing the command 'irb' within that open command line window.

I have other things I'd like to do for my own use, but all the basic expected functionality is there.

EPS

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 1 month 2 weeks ago
DeveloperModerator
Joined: 2008-07-24 18:46
RUBY_BIN

You can use previous Environment variables later in Environment, so PATH should be

PATH=%RUBY_BIN%;%PATH%

I will take a look at the NSI for Command Prompt Portable to see if it can be adapted to PAL for this app (and to switch to PAL).

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
RUBY_BIN & Command Prompt Portable

Gord,

Many thanks for your help. I would like to incorporate CPP into my personal copy of RubyPortable as well as a text editor (probably gvim), so any help you can offer on that front would be most welcome. I'm wondering if I could just include the existing CPP in my RubyPortable structure instead and reference that instead of cmd.exe? I'm going to try it over the next couple of days and see if that works, and will let you know.

EPS

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
Working but with a question about your reply

John,

Thank you very much. By changing the launcher and the batch file -- with the exception of the last line -- per your instructions, it works as expected; the change (with thanks to 3D1T0R) to the last line keeps the command line open and is as follows:

CMD /E:ON /K ruby.exe -v

I'm not sure if I understand your comment about 'storing Ruby within RubyPortable\App\Ruby for consistency with other apps'. That's where I have it:

RubyPortable\APP\Ruby

Isn't this correct? (I apologize if I wasn't clear about this before.) In the original installation file the Ruby directory is identified as 'Ruby200' to identify the version number, but I changed it to 'Ruby' to make upgrading to newer versions easier... I'm under the impression that I can simply overwrite the contents of this and the other sub-directories and rerun the launch generator - is this correct?

Again, thank you for your help. Awesome product (PortableApps concept) and absolutely outstanding support from you and your members. I'm better at writing (even if I'm pedantic) than at programming -- even though at root they are really the same -- and I'd like to help in any way I can... I don't know how much my experience mirrors that of other users, but after going through this process, I have a couple of suggestions for 'improving' your documentation.

EPS

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 32 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Above

In an above post you listed:

PATH=%PATH%;%PAL:AppDir%\RubyPortable

which stated otherwise for location.

Sometimes, the impossible can become possible, if you're awesome!

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
'Incorrect' path

John,

My apologies... I had tried so many things that my mind was mush and I mistakenly posted that path. (There are those who would say that that is the normal state of my mind...)

EPS

Wm ...
Offline
Last seen: 7 years 11 months ago
Joined: 2010-07-17 12:37
Ruby versions

I haven't had a lot to do with ruby but it does seem very version specific, is it too early for me to mention that if you get ruby200 going someone might want ruby193 immediately afterwards? [1]

[1] ruby193 is the version the bit of ruby I use says it needs, I don't need it to be portable so I'm not asking for anything

I'm just flagging a possible issue that isn't so obvious with (say) java (mainly if it worked with the version before it will probably be OK) or python (py2 or py3 being the main distinctions)

I could be completely wrong and the bit of ruby I use is overly fussy, in which case, no problem.

Wm

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
Ruby versions

Wm,

Thanks for responding. I had considered that, and considered the possibility of making three separate versions - the last of the 1.8x series, the latest 1.9x, and the latest 2.0x. I could be persuaded otherwise, but I think just the 2.0x version is sufficient. Anyone looking for those other versions could follow this thread and make their own, or they could possibly use the 'Pik' version manager with mine.

I chose the 2.0 branch because 1.9 is already several years old and might rightfully be considered a development branch even though many people used it for production purposes.

What are you using that requires 1.9x?

EPS

Wm ...
Offline
Last seen: 7 years 11 months ago
Joined: 2010-07-17 12:37
apparently

https://www.petekeen.net/ledger

are you suggesting I should kick his bum ? he is sort of famous in the personal finance world

Wm

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
Kicking Pete Keen's butt

Wm,

While I think it is only a matter of time before your 'problem' is solved in terms of running Ruby 2.0x, I may change course and post a 1.9x version instead (the 2.0x version is already available on http://rubyportablepaf.sourceforge.net/ for testing); see 'Answers and files available' in this forum.

EPS

3D1T0R
3D1T0R's picture
Offline
Last seen: 3 years 4 months ago
Developer
Joined: 2006-12-29 23:48
[Environment] works for current process & subprocesses ONLY

The [Environment] section works the same way that the SET command does, it modifies the Local (for this process only) Environment Variables, which will (usually) be passed on to any child processes but will not spread to any other processes. So opening a separate Command Prompt after Ruby Portable is running will be just like opening a Command Prompt without it running (as far as Environment Variables are concerned).

It sounds to me like you should either be running CMD.exe (with certain environment variables), or (if you're trying to get straight to the 'interactive ruby interpreter') "irb.bat" (or perhaps you could check what irb.bat does and try to do the same thing as it if this is your goal).

~3D1T0R

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
Environmental Values

3D1T0R,

Thank you for taking the time again to help me out.

I've detailed my situation more fully in my reply to John above.

I would like to get irb working as well of course, and for your refernce, below are both the start menu target and the actual batch file:

C:\Ruby200\bin\irb.bat
@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
ECHO.This version of Ruby has not been built with support for Windows 95/98/Me.
GOTO :EOF
:WinNT
@"%~dp0ruby.exe" "%~dpn0" %*

Any help you can offer would be much appreciated.

As a postscript, I'm sure you are aware that requests for a portable version of Ruby have appeared multiple times on your site... I'm willing to offer my copy once I get it working, and to keep it updated as necessary.

EPS

3D1T0R
3D1T0R's picture
Offline
Last seen: 3 years 4 months ago
Developer
Joined: 2006-12-29 23:48
Not my site, it's John's :-þ

If you get the Command Line solution (what you're working on above) working then you can just run irb from that can't you? My understanding was that you could even 'require' certain files by running "irb -r [file].rb" is this wrong? or do you still want a Portable irb launcher just to make it easy for beginners or something?

~3D1T0R

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
irb

3D1T0R,

I can start irb from the command line. I'm idly curious if I could use a second batch file to do it, but given that starting irb from the command line is the preferred way to go, I'd probably only try it to learn about the process and not for the end result itself, if that makes any sense.

Again, many thanks for your help, not the least of which was helping me be able to figure out some stuff on my own.

EPS

MongolJohn
Offline
Last seen: 1 year 3 months ago
Joined: 2014-10-30 11:03
Step-wise solution

ExpatSailor,

This week I started looking into a portable Ruby setup, for a project I'm going to start soon. Serendipity pointed me to your work that was done, serendipitously, this week.

However, I need a somewhat more step-wise process to follow. I'm not looking for spoonfeeding on the order of this:

III.A.4.g. Click on the "Save" button

But it would help me to have a list of procedures that you used, and I can research individual parts as needed. I'm new to Ruby, and know absolutely nothing about Portable Applications, beyond a "user" level.

Thanks for the work you've put into this, and I look forward to taking my Ruby with me.

3D1T0R
3D1T0R's picture
Offline
Last seen: 3 years 4 months ago
Developer
Joined: 2006-12-29 23:48
If I'm right ExpatSailor will release a DevTest for us to try

Correct me if I'm wrong ExpatSailor, but my understanding was that you were going to release a Development Test version of Ruby Portable once you had it working. (at least that's what I was hoping for)

I'd really like to see what you have, and I'd like to play with it some too (as I've stated earlier I'm a Ruby noob in the extreme), that's really one of the main reasons why I was trying to help you get it working. ☺

Can't wait to see a Ruby Portable [VersionNumber] Dev Test 1 thread soon.
 (Oh, and don't forget to use the Development Test Forum Posting Layout.)

~3D1T0R

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
DevTest

3D1T0R,

I apologize for the delay - life rather rudely interrupted my 'playing' for a day or so, but I'll do it tomorrow or Saturday. I haven't had time to read everything I need to do to meet your requirements/guidelines in terms of any documentation, etc, and I don't want to be a 'sloppy half-doer'. Any suggestions for making it better will be more than welcome.

The only other thing I want to do before making it available is to update it to the very latest release... I'm a couple of minor release points behind in the version I created.

Thanks again for your help.

EPS

3D1T0R
3D1T0R's picture
Offline
Last seen: 3 years 4 months ago
Developer
Joined: 2006-12-29 23:48
No problem

I don't think waiting for this for a few days is going to kill any of us.
Thanks for doing it and if you need any more help, you know where to post. Smile

~3D1T0R

Wm ...
Offline
Last seen: 7 years 11 months ago
Joined: 2010-07-17 12:37
I'll second that

I have a real-life bit of non-critical ruby to play with when you are ready.

Wm

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
How do I upload my RubyPortable for testing?

3D1T0R,

Thanks for your patience.

Sorry to be dense (I plead to being overly tired as an excuse), but I'm ready to upload my RubyPortable and am having trouble finding out where to do so... or does John send me a link enabling me do do so?

Here is what I have done ...:

- Updated it to Ruby 2.0.0p576 (the latest official release)

- Moved the PortableRuby.bat file to PortableRuby\App\Ruby and made the necessary change to RubyPortable.ini (launcher.ini).

- Tested making an installer (Successful).

- Tested RubyPortable by changing the command line window to a different drive and running a Ruby script living in that location as well as running the script from the 'default' command line location with that script on the other drive; I've run irb (it throws an error message but doesn't affect it otherwise, and is a known issue with 2.0 - solutions are available on the 'net, although I chose not to fix it so that my package tracks the original exactly); and I've successfully run the 'gem list' command (the RubyGems package manager is installed by default on 2.x).

...and haven't done:

- Help.html is an empty shell to enable the installer to work. (Is there any problem with my creating that file using AsciiDoctor?)

- The Ruby icon. (I'll add that to my next upload).

- My 'appinfo.ini file has non-performance related stuff that I need to fix (For example, 'Me' as the publisher).

I don't know if I'm missing anything else that I should have at this point, but if so, let me know and I'll do it right away (I'm unsure but I may be disconnected from shortly after I send this until mid-day tomorrow (Sat) - it's currently ~14:30 Eastern Time.

Again, thanks for your help. I'm pretty excited to be able to contribute something.

EPS

3D1T0R
3D1T0R's picture
Offline
Last seen: 3 years 4 months ago
Developer
Joined: 2006-12-29 23:48
 

ExpatSailor- Updated it to Ruby 2.0.0p576 (the latest official release)

Strange, I don't see that listed as the "latest official release".
Ruby-Lang.org indicates that 2.1.4 should be used, or optionally 2.0.0-p594 or 1.9.3-p550.

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

  • Current stable: Ruby 2.1.4
  • Previous stable: Ruby 2.0.0-p594
  • Old stable: Ruby 1.9.3-p550

And RubyInstaller.org indicates that 1.9.3-p550 should be used, or optionally 2.1.4 or 2.0.0-p594.

http://rubyinstaller.org/downloads
Which version to download?

If you don’t know what version to install and you’re getting started with Ruby, we recommend you use Ruby 1.9.3 installers. These provide a stable language and a extensive list of packages (gems) that are compatible and updated.

Ruby 2.0.0, specially the 64bits version, are relatively new on the Windows area and not all the packages have been updated to be compatible with it. To use this version you will require some knowledge about compilers and solving dependency issues, which might be too complicated if you just want to play with the language.

Users of CPUs older than Intel’s Nocona (90nm Pentium 4) who wish to use Ruby 2.0.0 will need to build their own using a different DevKit by following these instructions.

So, is there a reason you're choosing 2.0.0 (and more specifically 2.0.0-p576)? over the other versions?

ExpatSailor- Moved the PortableRuby.bat file to PortableRuby\App\Ruby and made the necessary change to RubyPortable.ini (launcher.ini).

Is it PortableRuby or RubyPortable? Please keep your package consistent. (I would recommend naming it "Ruby Portable", with an AppID of "RubyPortable", and thus a RubyPortable.ini 'launcher.ini' file and RubyPortable.exe compiled PA.c Launcher)

ExpatSailor- Help.html is an empty shell to enable the installer to work. (Is there any problem with my creating that file using AsciiDoctor?)

Are you aware of the "PortableApps.com Application Template"? It's currently at version 2.4, and is one of the items in the unordered list on the Development page (which is linked in the header of every PA.c page) and one of the files it contains is a Help.html template. I don't know if it's required that the Help.html be based on that template for release here or not, but it certainly won't hurt.

ExpatSailorSorry to be dense (I plead to being overly tired as an excuse), but I'm ready to upload my RubyPortable and am having trouble finding out where to do so... or does John send me a link enabling me do do so?

DevTests don't usually get hosted by PortableApps.com, so emailing John is unlikely to do much more for you than posting here is. However there are a number of free file hosts to choose from. Just don't use a temporary file host (that deletes your files after a period of time) or something that charges for full-speed downloads (like RapidShare) and I'll be happy.

ExpatSailorI don't know if I'm missing anything else that I should have at this point

That's one of the reasons we post DevTests, so other people can review them and see what we may have missed.

~3D1T0R

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
Answers and files posted

-3DITOR,

Ruby 2.0.0 -p576 was the latest RubyInstaller for Windows when I extracted the files, and these are the installation files that ruby-lang.org points you to if you don't want to compile the source yourself. (I'm wondering if there is a 'lag' between ruby-lang announcing the availability of something and the installer files being updated.) I see -p94 is available, but in the interest of just getting this moving, I'm posting what I have now.

I chose 2.0 over 1.9 because the 1.9 series was originally described as being on the road towards 2.0 (partly 1.8 branch and partly 2.0?); 1.87-p374x is the end of the line for the 1.x branch. I'm aware that there are 'issues' for the reasons stated on the download page, but a large part of my wanting to use 2.0 and to turn it into a portable app is the learning process, even if it makes it more difficult for me. That said, now that I know how to do it, I'm willing to make the 1.9 version available publicly while using the 2.0 version privately for myself. As for not using the 2.1 version, my understanding is that minor revision numbers that are odd are more 'development' than 'production' and I wanted to avoid that. Finally (and although you didn't ask), although there is no x64 version for anything before 2.x, I deliberately chose the 32 bit version of 2.0 so that it could run on any Windows machine, while the 64 bit version would have required users to be running a 64 bit OS.

These files are available now at http://rubyportablepaf.sourceforge.net/:

RubyPortable_1.1_English.paf.exe
appinfo.ini
RubyPortable.ini
RubyPortable.bat

I want to note that these files still have one or two things that I know that I need to do beyond whatever else comes up in the course of making them available for testing. I would have liked to do them before making the files available, but I have limited time and I never imagined that there would be any great interest in this -- I thought of it as 'hobby'-like thing mostly for my own education -- and instead I find myself being chased down the street by an excited posse...

I'm late for an appointment, but I will post to the development forums later today or tomorrow, but the application is available now.

I've tried to make clear from the beginning that I'm new to this, and I've replied to the various threads in as much detail as I did to try and provide as much context as possible, including why I've made the decisions that I've made... if someone points out something, as you have (perhaps 1.9x is a better choice), I have an open mind and am willing to change.

Again, much thanks for your help and interest.

EPS

MongolJohn
Offline
Last seen: 1 year 3 months ago
Joined: 2014-10-30 11:03
Chased down the street ...

That may not be an excited posse, it could be zombies.

Thanks for your work. I got it working twice. Now I have to actually try to use it (see: "zombies" above). We've had house guests over the weekend, so I'll have to wait to actually produce something with it (see: "life interrupting projects" from a previous post).

Expect some stupid questions.

Thanks again.
John

3D1T0R
3D1T0R's picture
Offline
Last seen: 3 years 4 months ago
Developer
Joined: 2006-12-29 23:48
What no Dev Test thread?

As far as which version you choose, I just wanted to know what your reasoning was. And yes, 2.0.0-p594 was posted on RubyInstaller.org about 3 days after the source for it was made available on Ruby-Lang.org.
I should inform you however that Dev Tests should be versioned as [App Name] Portable [App Version] Dev Test # (e.g. Ruby Portable 2.0.0-p576 Dev Test 1) which results in an installer file name of [AppName]Portable_[AppVersion]_Dev_Test_#.paf.exe (e.g. RubyPortable_2.0.0-p576_Dev_Test_1.paf.exe)

Choosing 32-bit over 64-bit is in line with PortableApps.com's view on the matter.

And I can't add it to the Dev Test page without a Dev Test thread. (Please make one, and also please follow the layout detailed here.)

Edit: Any chance you could post a Dev Test thread ExpatSailor? I'm still waiting.

~3D1T0R

Wm ...
Offline
Last seen: 7 years 11 months ago
Joined: 2010-07-17 12:37
aren't we stuck in a branch thing like py2 vs py3 again ?

aren't we stuck in a branch thing like py2 vs py3 again ?

i.e. like it or not a ruby or python app has to carry its version of code around with it.

i.e. overload: the app carries the language overhead with it in spite of what the dev says. In case anyone is wondering I am not doing language politics, I wish other people didn't, if you see what I mean.

Wm

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
No assembly required

MongolJohn,

Thanks for your gracious comments. The app will be posted tomorrow (Friday) or Saturday.

As for instructions, I'm glad to oblige, but I don't think you will need much help. I'm far from any sort of programmer, except for the fact that I didn't have as good a grasp of environmental variables and batch files as I needed, the process couldn't be easier. The laucher.ini and batch file were all I needed to create.

I'm going to make available the most basic of programs (just the stuff that comes with the Ruby installer) for the Dev/Test, but I can add the Gem package manager if people think that would make it better.

EPS

MongolJohn
Offline
Last seen: 1 year 3 months ago
Joined: 2014-10-30 11:03
Didn't understand

Expat,

I somehow missed that you would be posting the app. I was trying to reproduce your work, and getting bogged down in it. I'll be patient, because I know how life tends to interrupt projects.

I'm not sure how things work around here, but I'd love to know when you get it posted. I'll be a tester: if I can use it, it is truly foolproof.

JS

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
It's foolproof...

MongolJohn,

I'll be sure to reply to you on this form to let you know when both the 'test' and 'release' versions are available.

...Famous last words on my part (It's foolproof)?

Seriously I think it is. It should be up in the test section within the next day, but I have done basic testing (as detailed on another post) and everything seems to be as it should. I don't know how long it will take for the testing process to be complete, but I am going to use it myself in the meantime. I basically use Ruby for the AsciiDoctor gem which enables me to generate .html pages and PDFs from the same text file, to run a portable wiki in order to keep info in some sort of structured form, and to try and teach myself Ruby and Ruby on Rails (I'll be installing the Rails gem on my own 'working' copy.

I'm also going to post my complete 'How-To' once the release version is live, but I don't want to do it before then so that I don't have to add to it if there is more work that I have to do.

EPS

3D1T0R
3D1T0R's picture
Offline
Last seen: 3 years 4 months ago
Developer
Joined: 2006-12-29 23:48
The universe is still winning.

This quote may be from 1989, but it's still accurate, in that it effectively states that (currently) there's no such thing as foolproof software.

Rick CookProgramming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

That's not to say that your Ruby Portable package isn't fool-resistant, … but yeah, we'll see just how fool-resistant it is once you've posted it. Smile

~3D1T0R

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
I was having a laugh at my own expense

3EDITOR,

I have a bent sense of humor... so far it's proved to be fool-resistant to at least one fool - the one who created it.

EPS

ExpatSailor
Offline
Last seen: 8 years 9 months ago
Joined: 2014-10-27 20:24
Files posted

MongolJohn,

The test files are now available at:

http://rubyportablepaf.sourceforge.net/

You probably want to read 'Answers and files posted' in this forum.

EPS

Wm ...
Offline
Last seen: 7 years 11 months ago
Joined: 2010-07-17 12:37
ruby portable

Hello, people following this.

I had to do a search to find this thread as E Sailor started off asking about batch files and we all drifted off as the winds and waves took us. Stuff happens, hopefully the new Subject: will help.

For those still interested:

I have an up to date and working VirtualBox Lubuntu based use case that interacts with Postgres on a Win XP host if someone wants to present a portable ruby test.

I'm still unsure about ruby's versions when more than one is required to do different things on a Win platform, how does that get made portable? Am I overthinking this and there is a ruby version that "just works in most cases" ?

Wm

MongolJohn
Offline
Last seen: 1 year 3 months ago
Joined: 2014-10-30 11:03
It's dead, Jim.

I'm assuming that, after a hiatus of six months, this project has gone to the bit bucket. I was looking forward to playing with it. Sad

If someone resurrects it, I'd be happy to be involved (e.g. tester; see post above, Didn't understand from 10/30/14).

Thanks.

Wm ...
Offline
Last seen: 7 years 11 months ago
Joined: 2010-07-17 12:37
Nah, she's just sleeping, handsome prince

Nah, she's just sleeping after chewing an apple and you're the handsome prince Smile

Two of the previous protagonists haven't been seen for a while and I figured out another way of doing what I was using Ruby for and have no need for it at the moment. It made sense under *nix but not so much under Win and even less under \win portably as far as I oould see as (by my understanding) a portable Ruby implementation would need to be like a python one (you need the right version) except that Ruby is even more specific about having the right version more frequently into a whirpool for portability.

I think if you have a static Ruby app (is there such a thing?) it is do-able. Otherwise I think Ruby is best regarded as something that comes along with a portable app rather than a language innately suitable to portability under the wing of which multiple apps can be tucked.

Other comments, differences, etc welcomed.

Wm

MongolJohn
Offline
Last seen: 1 year 3 months ago
Joined: 2014-10-30 11:03
You haven't seen me before, have you?

What you say makes sense (I think). I had set myself to learn Ruby, and was hoping to use the Portable Ruby to play with it when I went wherever. I'm optimistic by nature, so I'll keep checking back here.

Thanks!

YoursTruly
YoursTruly's picture
Offline
Last seen: 2 years 10 months ago
Joined: 2015-08-07 07:58
Is a portable Ruby still requested?

Hey guys,

is there still a need to get some protable Ruby?
It don´t seems reasonable to put it in the PortableApps Format, but if someone of you still need a portable ruby I may hand you a manual to do amke your ruby portable for sticks (without PortableApps format)

YoursTruly

Wm ...
Offline
Last seen: 7 years 11 months ago
Joined: 2010-07-17 12:37
That might be a good idea for learning

That might be a good idea for learning where a person could pick a version and use that for tutorials and so on.

My impression was that Ruby as a practical environment / language (even more so than python) needed all the right bits of various versions in place in order to work and so the first Ruby portable app would be OK but the second would need more Ruby and so on.

People wanting a small Ruby App would end up with more Ruby than PA in extremis.

I wasn't against the idea so much as the practicality. If it was a fixed learning environment I'd think that was OK.

Wm

YoursTruly
YoursTruly's picture
Offline
Last seen: 2 years 10 months ago
Joined: 2015-08-07 07:58
Hi Wm ...,

Hi Wm ...,

well I totally agree that it makes no sense to put Ruby in PortableApps Format.
But I also need Ruby on my USB-Stick to carry around with me.
For this purpose I created some batch and command files wich take care of all necessary %PATH% variables. For example I use nodejs, sikulix and tesseract-ocr in this environments and that all is portable.
I am also able to use this Ruby in GeanyPortable.

I wrote an manual some months ago (possibly years) at my Blog. So this manual doesn´t include the last changes.

At least it is still without portable Apps. So I am not sure if a updated manual is wanted by some users here.

YoursTruly

Wm ...
Offline
Last seen: 7 years 11 months ago
Joined: 2010-07-17 12:37
I don't have any working Ruby under Win

I don't have any working Ruby under Win and only a bit under *nix so I may not be the best person to advise.

Aside: I sometimes wonder if nodejs shouldn't be separate from Ruby, but that is probably philosophy Smile

Personally, I think you have made your offer clear and it is up to a person to find it. There are many people here that work on projects because it is a personal interest and they will be better able than me to tell you about the rewards (or otherwise) of making something useful to you, useful to other people.

P.S. I had a look at your blog.

Wm

YoursTruly
YoursTruly's picture
Offline
Last seen: 2 years 10 months ago
Joined: 2015-08-07 07:58
Ah ok.

Ah ok.

About nodejs:
I agree with you. I also wonder why so much Rails applications use it.

I will set this thread at my watchlist.

Log in or register to post comments