# Launch ruby script from Quicksilver

**URL:** <https://www.ruby-forum.com/t/launch-ruby-script-from-quicksilver/151259>\
**Category:** Ruby\
**Created:** [October 18, 2008, 11:29pm UTC](https://www.ruby-forum.com/t/launch-ruby-script-from-quicksilver/151259 "2008-10-18T23:29:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [October 18, 2008, 11:29pm UTC](https://www.ruby-forum.com/t/launch-ruby-script-from-quicksilver/151259/1 "2008-10-18T23:29:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [October 18, 2008, 11:55pm UTC](https://www.ruby-forum.com/t/launch-ruby-script-from-quicksilver/151259/2 "2008-10-18T23:55:50Z")

</div>

On Sat, Oct 18, 2008 at 4:29 PM, Adam W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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?

---

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [October 19, 2008, 12:00am UTC](https://www.ruby-forum.com/t/launch-ruby-script-from-quicksilver/151259/3 "2008-10-19T00:00:31Z")

</div>

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](http://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})}  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [October 19, 2008, 12:32am UTC](https://www.ruby-forum.com/t/launch-ruby-script-from-quicksilver/151259/4 "2008-10-19T00:32:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [October 19, 2008, 12:47am UTC](https://www.ruby-forum.com/t/launch-ruby-script-from-quicksilver/151259/5 "2008-10-19T00:47:21Z")

</div>

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 :\<

---

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [October 19, 2008, 1:13am UTC](https://www.ruby-forum.com/t/launch-ruby-script-from-quicksilver/151259/6 "2008-10-19T01:13:58Z")

</div>

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