zhaocai / alfred2-ruby-template

Alfred 2 Workflow Ruby Template
http://zhaocai.github.com/alfred2-ruby-template/
144 stars 37 forks source link

Not working in Mavericks #8

Closed ulken closed 3 years ago

ulken commented 10 years ago

Stumbled upon this project while debugging a workflow built upon this template which was not working (anymore). I could not locate any significant differences and thus tried to run the basic test code in a fresh template, which did not work either.

Looking further into the issue, I discovered a slight change from your example projects:

($LOAD_PATH << File.expand_path("..", __FILE__)).uniq!

at the top of Ruby files which required local dependencies, referenced relative to the project folder.

The template lacks this line and thus crashes when looking for bundle/bundler/setup. At least for me, on Mavericks running Ruby 2.0.0.

Just thought I'd let you know.

ulken commented 10 years ago

Or point to: http://www.alfredforum.com/topic/3173-ruby-workflows-in-mavericks/page-2#entry19642

benjaminwood commented 10 years ago

@ulken were you able to make the template work by adding ($LOAD_PATH << File.expand_path("..", __FILE__)).uniq! to main_with_rescue_feedback.rb and main.rb? I'm not having any luck.

@zhaocai - might you be able to update this for ruby 2.0? Thanks for your work on this!

ulken commented 10 years ago

@benjaminwood I also prepended LANG=en_US.UTF-8 to the Script Filter/Run Script as per Shell Script Locale in Mavericks.

You may have to reinstall some of your gems for 2.0.0 if you are coming from 1.8 or the like.

A tip is to not run the scripts through the Alfred dialog while developing/debugging, but through a terminal, to get easier access to error messages.

ulken commented 10 years ago

Another tip, as I hinted in my initial post, is to look closer into some of @zhaocai's own, actively developed workflows and get some inspiration there. I mean, he's gone through the whole process himself and you might be able to pick up what necessary changes he carried out. Browse the commit history for example.

Good luck!

benjaminwood commented 10 years ago

@ulken awesome! Thanks so much for the tips!

andersennl commented 9 years ago

Did you figure it out @benjaminwood ? I'm on Yosemite and can't get Alfred to show any response beneath its search bar for my workflow. I added these 3 lines from @zhaocai script, but it didn't fix the problem.

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
($LOAD_PATH << File.expand_path("..", __FILE__)).uniq!
benjaminwood commented 9 years ago

@andersennl it seems the old workflow I was working on last year doesn't work in Yosemite either. Though, I think part of my workaround was to use ruby 1.8.x back then... which doesn't ship with Yosemite.

This project hasn't been updated since 2013, I think it needs some attention if it's going to be compatible with modern osx/ruby versions.

andersennl commented 9 years ago

@benjaminwood thanks again for looking into this project again after all this time. I didn't realize that it isn't compatible to the new versions of Ruby and Yosemite. Thanks again for your help.

benjaminwood commented 9 years ago

@andersennl no problem. Cheers :beers:

estiens commented 9 years ago

Any work on getting a ruby workflow wrapper that will work with Ruby 2?

ricburton commented 9 years ago

@benjaminwood do you have any suggestions for good tutorials on writing Ruby-based workflows on Yosemite?

benjaminwood commented 9 years ago

@ricburton - No, sadly I haven't had the time to look for alternatives. I know this project is very dead though- hasn't been touched since 2013. If you find something more current, let us know!

andersennl commented 9 years ago

@ricburton I had a hard time finding good tutorials/examples myself and finally just looked directly at the scripts from others to figure out how they work. I think the hardest part is to know how to generate the proper xml output. This is a small repo I worked on which has a xml output: https://github.com/andersennl/dict.cc Basically the xml has to have this format: example

ricburton commented 9 years ago

I found this super helpful: http://buddylreno.github.io/adventures-with-alfred-a-basic-ruby-workflow/

I built my balance checker using Plaid.com’s API :) https://cloudup.com/inXRxgQs7AZ

Richard

On 19 August 2015 at 00:22, Nikolaj Andersen notifications@github.com wrote:

@ricburton https://github.com/ricburton I had a hard time finding good tutorials/examples myself and finally just looked directly at the scripts from others to figure out how they work. I think the hardest part is to know how to generate the proper xml output. This is a small repo I worked on which has a xml output: https://github.com/andersennl/dict.cc Basically the xml has to have this format: example https://github.com/andersennl/dict.cc/blob/master/scripts/dictionary.rb#L142-L148

— Reply to this email directly or view it on GitHub https://github.com/zhaocai/alfred2-ruby-template/issues/8#issuecomment-132473400 .

benjaminwood commented 9 years ago

@ricburton very cool, nice work.

Also, I had never heard of plaid. Cool stuff!

Does your workflow handle plaid auth yet? If so, are you going to open source/share it? I'd try it out!

ricburton commented 9 years ago

Yeah it’s using Plaid Auth. I’ll definitely open source it in the next two weeks. I have 10 days left in San Francisco and 3 more interviews so I’m a little busy right now :)

If you’d like it sooner, feel free to email me directly on i@rb.cm and I’ll pop it your way.

Richard

On 19 August 2015 at 15:29, Benjamin Wood notifications@github.com wrote:

@ricburton https://github.com/ricburton very cool, nice work.

Also, I had never heard of plaid. Cool stuff!

Does your workflow handle plaid auth yet? If so, are you going to open source/share it? I'd try it out!

— Reply to this email directly or view it on GitHub https://github.com/zhaocai/alfred2-ruby-template/issues/8#issuecomment-132808086 .