Jump to content

Alfred2 workflow for google search suggestion, instant search, and current site search


Recommended Posts

 

It seems to be a Ruby error (I'm using 10.9 GM). This is the error when running from command line:

/usr/bin/ruby /Users/martin/Dropbox/Alfred_v2/Alfred.alfredpreferences/workflows/user.workflow.FD7614C1-3388-4F55-885A-5C04C0B50D3F/instant.rb test
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- alfred (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/martin/Dropbox/Alfred_v2/Alfred.alfredpreferences/workflows/user.workflow.FD7614C1-3388-4F55-885A-5C04C0B50D3F/instant.rb:20:in `<main>'

Any ideas on how to fix it?

 

Thanks

 

run `rake bundle:install` in the workflow folder. 10.9 upgraded the ruby version.

Link to comment

run `rake bundle:install` in the workflow folder. 10.9 upgraded the ruby version.

Thanks for helping out.

 

Running that command, gives me this error:

/Users/martin/Dropbox/Alfred_v2/Alfred.alfredpreferences/workflows/user.workflow.FD7614C1-3388-4F55-885A-5C04C0B50D3F on iMac.local: rake bundle:install --trace
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rake/application.rb:598:in `raw_load_rakefile'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rake/application.rb:89:in `block in load_rakefile'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rake/application.rb:160:in `standard_exception_handling'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rake/application.rb:88:in `load_rakefile'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rake/application.rb:72:in `block in run'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rake/application.rb:160:in `standard_exception_handling'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rake/application.rb:70:in `run'
/usr/bin/rake:37:in `<main>'
Link to comment

Sorry, I forget the package does not include the Rakefile. You need to Delete the existing workflow from Alfred 2, clone the repo from https://github.com/zhaocai/alfred2-google-workflow  to anywhere you like. Run `rake bundle:install && rake install` in the folder.

OK, so I did that, but now there's a new error :)

 

/Users/martin/Downloads/alfred2-google-workflow on iMac.local: rake bundle:install && rake install
cd google
bundle install --standalone --clean
fail to install gems (status = 127)
ln -sf /Users/martin/Downloads/alfred2-google-workflow/google /Users/martin/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/me.zhaowu.google
Link to comment

 

OK, so I did that, but now there's a new error :)

 

/Users/martin/Downloads/alfred2-google-workflow on iMac.local: rake bundle:install && rake install
cd google
bundle install --standalone --clean
fail to install gems (status = 127)
ln -sf /Users/martin/Downloads/alfred2-google-workflow/google /Users/martin/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/me.zhaowu.google

 

try to download the updated Google.alfredworkflow and import to Alfred 2

Link to comment

did it on purpose. Trust google to show up the best results. If I want to search in the browser, hit ⌘ + 3.

 

Works again. Excellent stuff, zhaowu.

 

The only thing which seems odd, is the option to show search results in browser, has moved from its usual position at #1 to #3 in the list:

 

YSIHFgF.png

Link to comment

Can you run `LANG=en_US.UTF-8 /usr/bin/ruby ./instant.rb test` in the Terminal, give me the output and ~/Library/Logs/Alfred-Workflow.log? I do not have 10.8 installed to test.

Thanks.

 

On Mac OS 10.8.5 only "g" works. Everything else reverts to default searches as soon as you type a query. (Works great on OS 10.9, however.)

Link to comment

Got it. This is output:

 

dyld: lazy symbol binding failed: Symbol not found: ___memccpy_chk
  Referenced from: /<removed>/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.FCBDF848-A9CC-4576-9686-1D3197B1273C/bundle/ruby/1.8/gems/json-1.8.1/lib/json/ext/generator.bundle
  Expected in: /usr/lib/libSystem.B.dylib


dyld: Symbol not found: ___memccpy_chk
  Referenced from: /<removed>/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.FCBDF848-A9CC-4576-9686-1D3197B1273C/bundle/ruby/1.8/gems/json-1.8.1/lib/json/ext/generator.bundle
  Expected in: /usr/lib/libSystem.B.dylib


[1]    91370 trace trap  LANG=en_US.UTF-8 /<removed>/ruby ./instant.rb test
Edited by glortho
Link to comment
  • 3 weeks later...

Hi, your workflow is great! Just want to change the gi search to German. I just changed the .com to .de, now it says in the instant.rb "arg      => URI.escape("http://www.google.de/search?as_q=#{query}&lr=lang_")" 

 

Is this correct? Anything else that I need to change? It unfortunately does not work at the moment, only provides outputs for the english google. Any help would be very much appreciated. 

 

Thanks! 

Link to comment
  • 2 months later...
  • 4 months later...
  • 10 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...