1

This is a very silly question...

I have a doubt regarding the ruby installation. Will the ruby be installed in a windows server if we copy the Ruby187 folder from another server and add that in the PATH of the environment variable?

Or Do we need to install the Ruby from the installer always, in order to install it ?

Thanks in advance

Doel
  • 962
  • 7
  • 14
  • Did you try already? Similar question: http://stackoverflow.com/questions/4692769/possible-to-copy-and-paste-a-whole-rails-application – knut Jun 22 '12 at 09:52

1 Answers1

1

I actually did something similar to this yesterday at work. A fellow co-worker, who does not have Ruby installed on their system, needs the ability to run my scripts while I am on vacation. So, I copied the entire Ruby folder from my C: to a shared network drive.

You will not only have to add the path to the Ruby folder to your PATH variable but you also may want to associate the Ruby extension .rb with Ruby. Not needed but just a thought.

One issue I ran into was here at work we don't have permission to alter our PATH variable manually. So, in order for my co-worker to launch the scripts I needed ran, I wrote a small C++ app that merely run a command line call to the Ruby interpreter and then to the script to run.

So, in short, yes, it is possible. =)

EDIT: In regards to why you would add the path to the Ruby installation to the PATH variable, it is so you can call Ruby from the command line with simply C:\>ruby some_script.rb. Without that added to your PATH, you'd need to type the entire path every time like C:\>C:\ruby192\bin\ruby some_script.rb. However, you'd still need to type "ruby" first.

In regards to the association of ".rb" files to the Ruby Interpreter, it is an option while installing Ruby on Windows using the installer provided at ruby-lang.org. With that, you would not need to type "ruby" before the script name on the command line. C:\>some_script.rb would work. I don't know exactly how to do this with a network version of Ruby but one way might be to right-click on a ".rb" file, choose "Open with..." and locate the Ruby.exe file in \ruby192\bin\ruby.exe.

I hope that explains what you were asking about in the comments.

Charles Caldwell
  • 16,649
  • 4
  • 40
  • 47
  • Thanks Charles, Just a small doubt, if I am able to edit the PATH variable, then we need not have to call the Ruby interpreter, is the understanding correct? And Regarding the "but you also may want to associate the Ruby extension .rb with Ruby. Not needed but just a thought."...can you pls explain on this point ?? – Doel Jun 25 '12 at 11:27
  • I appended further information to my answer. I hope it clarifies what I mentioned. – Charles Caldwell Jun 26 '12 at 01:23
  • Thanks a lot Charles.. In my current scenario, i son't want to run any standalone ruby app from the console. Ruby is needed to for rhodes/rhomobile app installed in that server, hence I guess the script to call the ruby interpreter would not be needed. – Doel Jun 26 '12 at 09:36