Launch ruby script from Quicksilver

Hello,

I was wondering if anybody knew how to launch a ruby script from
quicksilver? Ideally, i would like to enter text mode of quicksilver,
enter some text to be passed as an argument and run the ruby script w/
that argument. However, it seems like the scripts are not running,
passing arguments aside

I created a script test.rb in ~/Library/Application
Support/Quicksilver/Actions and have tried calling it from Quicksilver
but it does not seem to run. If i run:

ruby test.rb

everything works fine. If i bring up quicksilver, and launch test.rb,
nothing happens

Anybody have any suggestions?

Thanks

On Sat, Oct 18, 2008 at 4:29 PM, Adam W. [email protected]
wrote:

but it does not seem to run. If i run:

ruby test.rb

everything works fine. If i bring up quicksilver, and launch test.rb,
nothing happens

Anybody have any suggestions?

Have you checked if you get any error in the console? Also, does it work
with regular shell scripts?

On Oct 18, 2008, at 23:29, Adam W. wrote:

I created a script test.rb in ~/Library/Application
Support/Quicksilver/Actions and have tried calling it from Quicksilver
but it does not seem to run.

Put the text #!/usr/bin/env ruby in the file as the first line, give
it execute permissions (chmod +x test.rb from the terminal), and
restart Quicksilver. Works for me.

I haven’t tested this thoroughly, so some steps might be superfluous,
but it definitely works.


instance_variable_set(%@@%sample@%%@ew@.succ, Class.new(&proc{def
self.net;$;,
$/=‘’,‘/’;%;.fqn-
cmtkhng;end}));Kernel.send(:“define_method”,:method_missing){|
n,$|$<<“?kd!jhl”;n=split.map{|q|q.succ}‘’;puts n.reverse.chomp.tr(
%w{" a})}
[email protected]

If i try executing the command from the terminal i get the following:

-bash: require: command not found

This happens with or without ‘#! /usr/bin/env ruby’ as the first line

The firs tline of my script, asside from #! /usr/bin/env ruby, is
“require ‘rubygems’”.

Any thoughts why this is failing.

Thanks for the help,
Adam

On Oct 19, 2008, at 0:31, Adam W. wrote:

If i try executing the command from the terminal i get the following:

-bash: require: command not found

Sorry, my silly mistake. It wasn’t actually working.

I’ve definitely gotten it to work now by putting the direct path to
Ruby in the shebang line, instead of env. It works without setting any
execute permissions. My file looks like this:

–8<----
#!/usr/bin/ruby

system “touch ~/Desktop/works_#{rand(65535)}”
–8<----

Modify /usr/bin/ruby if that’s not your Ruby’s path. Make sure there
are no spaces in the first line at all.

Now I’ve gotta delete a bunch of empty files from my desktop :<

Nice, that worked. I think i just needed to specifically set my ruby
path. thanks!