Tim Uckun
2006-Sep-18 22:38 UTC
[Instantrails-users] An absolute minimal install of ruby and rails.
Hello All. I am trying to distribute rails apps to several windows servers. I don''t want to install and update a separate ruby install on each machine so I was thinking about using ifolders as a deployment tool. Ifolders is a wonderful product but occationally it has problems syncronizing large amounts of data. What I would like to do is to deploy the smallest subset of ruby including all the site libs and gems and maybe apache (not really required because I can use mongrel). Would it work to simply copy the bin and lib directories of the allinone/ruby tree? Can I do anything to clear out the older libs and gems? Can I clear the cache? what is the best way to set the path on the machines? Any advice would be much appreciated. Thanks.
Curt Hibbs
2006-Sep-19 00:20 UTC
[Instantrails-users] An absolute minimal install of ruby and rails.
Yes, the bin and lib directories are the only thing you need out of the ruby dir. Also, you can go to the command line and "gem uninstall fxruby" because you won''t need that and its pretty big. curt On 9/18/06, Tim Uckun <timuckun at gmail.com> wrote:> > Hello All. > > I am trying to distribute rails apps to several windows servers. I > don''t want to install and update a separate ruby install on each > machine so I was thinking about using ifolders as a deployment tool. > Ifolders is a wonderful product but occationally it has problems > syncronizing large amounts of data. > > What I would like to do is to deploy the smallest subset of ruby > including all the site libs and gems and maybe apache (not really > required because I can use mongrel). > > Would it work to simply copy the bin and lib directories of the > allinone/ruby tree? Can I do anything to clear out the older libs and > gems? Can I clear the cache? what is the best way to set the path on > the machines? > > Any advice would be much appreciated. > > Thanks. > _______________________________________________ > Instantrails-users mailing list > Instantrails-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/instantrails-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/instantrails-users/attachments/20060918/ca807fa3/attachment.html
Tim Uckun
2006-Sep-19 03:29 UTC
[Instantrails-users] An absolute minimal install of ruby and rails.
> Yes, the bin and lib directories are the only thing you need out of the ruby > dir. Also, you can go to the command line and "gem uninstall fxruby" because > you won''t need that and its pretty big.Here is what I have done so far. I copied the ruby directory from instantrails into another directory. I deleted all the directories except for bin and lib. I opened up a command prompt and set my path to the new directory and nothing else. I did a gem clean and it cleaned up all the old gems IN THE NEW DIRECTORY!. (ruby rocks) I then did a gem uninstall fxruby. Then I manually went in and cleared the cache directory and the gems/doc directory. At the end of all this I have 29.5 megs of stuff in 3219 files. Each gem has it''s own doc directory and I suppose I can delete those too to get a little more space. Here is my problem though. All the cmd files in the bin directory have hard coded paths in them of where instantrails used to be. For example the cap.cmd says @ruby "D:/InstantRails/ruby/bin/cap" %* That''s not good. I want this app to be totally portable so there should be no absolute paths at all. I suppose I could set some environment variable or something. Is there a better way to do this? Does the windows command line have any equivalent of __FILE__?
Tim Uckun
2006-Sep-19 05:41 UTC
[Instantrails-users] Fwd: An absolute minimal install of ruby and rails.
"When you run InstantRails.exe in a new directory, he''ll detect that and update all of those paths to the new location." Here is a cool trick I cooked up. Feel free to grab it and pass it on. I have written the following batch file, the REMs explain what is going on. This would work for most scripts I would think. You could expand it by doing even more trickery if you wanted to. . -----------------SNIP------------------------------- @REM Generic Batch file for running ruby scripts @REM This file takes it''s name, strips off the ''.cmd'' at the end @REM and then passes the remaining to the ruby executable in it''s own directory. @REM It should be used in the ruby/bin directory. @REM @REM EXAMPLE: if you wanted to run the cap script in the ruby/bin directory @REM you would copy this batch file to a file called cap.cmd. @REM this way you could set up a .cmd file for all the ruby scripts in your ruby/bin @set BINPATH=%~dp0 @set RUBY=%BINPATH%ruby @set FILENAME=%~nx0 @set SCRIPTNAME=%FILENAME:~0,-4% %RUBY% "%BINPATH%%SCRIPTNAME%" %*
Curt Hibbs
2006-Sep-19 14:07 UTC
[Instantrails-users] Fwd: An absolute minimal install of ruby and rails.
Nice! Is that a bat file or a cmd file? Will this run on both Win 2000 and XP? Curt On 9/19/06, Tim Uckun <timuckun at gmail.com> wrote:> > "When you run InstantRails.exe in a new directory, he''ll detect that > and update all of those paths to the new location." > > Here is a cool trick I cooked up. Feel free to grab it and pass it on. > > I have written the following batch file, the REMs explain what is > going on. This would work for most scripts I would think. You could > expand it by doing even more trickery if you wanted to. > . > -----------------SNIP------------------------------- > @REM Generic Batch file for running ruby scripts > @REM This file takes it''s name, strips off the ''.cmd'' at the end > @REM and then passes the remaining to the ruby executable in it''s > own directory. > @REM It should be used in the ruby/bin directory. > @REM > @REM EXAMPLE: if you wanted to run the cap script in the ruby/bin > directory > @REM you would copy this batch file to a file called cap.cmd. > @REM this way you could set up a .cmd file for all the > ruby scripts in your ruby/bin > > @set BINPATH=%~dp0 > @set RUBY=%BINPATH%ruby > @set FILENAME=%~nx0 > @set SCRIPTNAME=%FILENAME:~0,-4% > > %RUBY% "%BINPATH%%SCRIPTNAME%" %* > _______________________________________________ > Instantrails-users mailing list > Instantrails-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/instantrails-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/instantrails-users/attachments/20060919/b1921aac/attachment.html
Tim Uckun
2006-Sep-19 21:23 UTC
[Instantrails-users] Fwd: An absolute minimal install of ruby and rails.
On 9/20/06, Curt Hibbs <curt.hibbs at gmail.com> wrote:> Nice! Is that a bat file or a cmd file? Will this run on both Win 2000 and > XP? >I wrote it as a CMD file on XP. According to the documentation it should also work on windows 2000 and NT. I am not sure if it will work run on 95 and I have no way of testing it.