PDA

View Full Version : Running ruby scripts


DrPepper836
December 18th, 2008, 11:31 PM
How exactly do you run a .rb ruby script file outside of a program like geany or netbeans? Is there a way to do it with a launcher or an executable text file?

geraldm
December 19th, 2008, 12:55 AM
Use an executable text file. Execute it from an xterm terminal.

The script must have as its first line the shebang + path_to_ruby


Gerald

GregTheGerg
February 19th, 2009, 01:02 PM
What would the proper shebang be? Thanks! ^_^

Tek-E
February 19th, 2009, 01:55 PM
I know very little about ruby programming and any programming in ruby that I do is not under ubuntu. But im going to take a guess at ./ ??
I might be wrong though, so I would check with someone else if this fails.

geraldm
February 21st, 2009, 12:42 AM
The program permission must be executable. The first line
(could be #!/usr/local/bin/ruby OR #!/usr/bin/env ruby) Filename ends in ".rb"

#!/usr/bin/ruby
puts "hello"