Ubuntu Forums Archive Viewer

Running ruby scripts

Archived thread 1015532 from Packaging and Compiling Programs. Markdown source: Packaging_and_Compiling_Programs/thread_1015532_Running_ruby_scripts.md

Original URL About this archive
#1

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?

#2

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

#3

What would the proper shebang be? Thanks! ^_^

#4

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.

#5

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"