![]() ![]() ![]() ![]() Once you have completed a script, it's common to create a ~/bin directory, add this to your PATH, and move your completed script here for running on a day-to-day basis. Running an executable Ruby script that is located in the current directory looks like this: Specify the directory of your script each time you run it.Add the current directory to your PATH ( not recommended).Create your Ruby scripts in a directory that is already in your PATH.However, for security reasons, Unix-like operating systems do not search the current directory for executables unless it happens to be listed in your PATH environment variable. Now, you can run your Ruby script without typing in the word ruby. Hence, you can still run the Ruby script on operating systems such as Windows whose shell does not support shebang lines. The shebang line is ignored by Ruby – since the line begins with a hash, Ruby treats the line as a comment. The other common place to find the ruby executable is /usr/local/bin/ruby. If your ruby executable is not in the /usr/bin directory, change the shebang line to point to the correct path. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |