Jump to content

Ruby workflows in Mavericks


radioman

Recommended Posts

  • 2 weeks later...
  • 2 weeks later...

I've run into a couple of issues with workflows that worked before going to Mavericks.  Not sure if the workflows need tweaking, or if there is a compatibility issue, but here's a couple that I'm having trouble with:

 

https://github.com/neilrenicker/alfred-harvest

 

Trying to run the setup on this, you type "hv" <space> "setup", and then Alfred flips over to doing a Google search.  It's supposed to accept some arguments in order to set up authentication -- but it doesn't do that.

 

I've run into a similar problem with arguments using the Github workflow here:

 

https://github.com/zenorocha/alfred-workflows

 

This one definitely worked on 10.8 but upgrading to 10.9 has made the arguments work in strange ways.

Link to comment

I've run into a couple of issues with workflows that worked before going to Mavericks.  Not sure if the workflows need tweaking, or if there is a compatibility issue, but here's a couple that I'm having trouble with:

 

https://github.com/neilrenicker/alfred-harvest

 

Trying to run the setup on this, you type "hv" <space> "setup", and then Alfred flips over to doing a Google search.  It's supposed to accept some arguments in order to set up authentication -- but it doesn't do that.

 

I've run into a similar problem with arguments using the Github workflow here:

 

https://github.com/zenorocha/alfred-workflows

 

This one definitely worked on 10.8 but upgrading to 10.9 has made the arguments work in strange ways.

 

Are you sure that this isn't an issue with proper use of the workflow or something on the script side? I can't confirm the Harvest workflow but the Github one seems to be working in Mavericks for me.

Link to comment

I'm having this same issue.

 

This was working before Mavericks.

 

Let's use Recent Downloads (https://github.com/ddjfreedom/recent-downloads-alfred-v2) as an example.

 

I'll type "Rec", the Recent Downloads workflow displays below the Alfred prompt as before, I hit the down arrow, then enter, and at that point Alfred reverts to the default search.

 

In the terminal, the output of whereas ruby is /usr/bin/ruby

 

Thanks for looking into this!

Link to comment

I'm having this same issue.

 

This was working before Mavericks.

 

Let's use Recent Downloads (https://github.com/ddjfreedom/recent-downloads-alfred-v2) as an example.

 

I'll type "Rec", the Recent Downloads workflow displays below the Alfred prompt as before, I hit the down arrow, then enter, and at that point Alfred reverts to the default search.

 

In the terminal, the output of whereas ruby is /usr/bin/ruby

 

Thanks for looking into this!

 

Is your ruby install the default install with the OS or something custom built or installed from something like home-brew? The reason I ask is, I'm not a big ruby guy so I don't have any kind of special installation of it and the recent downloads workflow and a recent documents workflow I have both seem to work fine in Mavericks.

Link to comment

I'm having this same issue.

 

This was working before Mavericks.

 

Let's use Recent Downloads (https://github.com/ddjfreedom/recent-downloads-alfred-v2) as an example.

 

I'll type "Rec", the Recent Downloads workflow displays below the Alfred prompt as before, I hit the down arrow, then enter, and at that point Alfred reverts to the default search.

 

In the terminal, the output of whereas ruby is /usr/bin/ruby

 

Thanks for looking into this!

 

This is an issue with the workflows, not with Alfred. Mavericks comes with an updated version of Ruby (v2.0.0), which has some compatibility issues with code written for v1.8.7 (the version of Ruby included with prior releases of OS X).
 
It's likely there's an issue with encoding in those workflows, particularly if they're getting data from somewhere else (a file, an HTTP request, etc.). I made some hacky attempts to fix the Recent Downloads workflow (check the last few posts in the thread), but I still need to do some more testing there.
Link to comment

Is your ruby install the default install with the OS or something custom built or installed from something like home-brew? The reason I ask is, I'm not a big ruby guy so I don't have any kind of special installation of it and the recent downloads workflow and a recent documents workflow I have both seem to work fine in Mavericks.

 

I'm pretty sure that /usr/bin/ruby is the OS X copy. If I had installed ruby via home-brew it would be in /usr/local/Cellar/. Please correct me if I'm mistaken.

 

Clinton is right to point out that this is an extension/ruby issue. Thanks for that, Clinton.

 

If I have any feedback for the Recent Downloads workflow, I'll put it in the other thread (http://www.alfredforum.com/topic/338-recent-downloads-with-feedback/page-3).

Link to comment

I'm pretty sure that /usr/bin/ruby is the OS X copy. If I had installed ruby via home-brew it would be in /usr/local/Cellar/. Please correct me if I'm mistaken.

 

Clinton is right to point out that this is an extension/ruby issue. Thanks for that, Clinton.

 

If I have any feedback for the Recent Downloads workflow, I'll put it in the other thread (http://www.alfredforum.com/topic/338-recent-downloads-with-feedback/page-3).

 

As mentioned above though, it shouldn't be an issue with the extension/workflow/alfred because it works perfectly fine for me in a fresh mavericks install. Both the Recent Downloads and Recent Documents (created by Clinton) are ruby based and work as expected.

Link to comment

As mentioned above though, it shouldn't be an issue with the extension/workflow/alfred because it works perfectly fine for me in a fresh mavericks install. Both the Recent Downloads and Recent Documents (created by Clinton) are ruby based and work as expected.

 

In that case, would you care to speculate as to why certain workflows would stop working after upgrading? Clinton's Ruby solution seems to make sense to me, but I would be happy to consider other possibilities.

Link to comment

In that case, would you care to speculate as to why certain workflows would stop working after upgrading? Clinton's Ruby solution seems to make sense to me, but I would be happy to consider other possibilities.

 

Clinton's answer does indeed sounds nice and plausible but the fact that they work flawlessly on a fresh Mavericks install somewhat eliminates that. If it were a difference in the ruby versions between Mavericks and previous versions of OSX, it would seem that I would still be experiencing the same issue. I can't say with certainty what the issue is but would lean toward something getting changed, moved, etc during the Mavericks upgrade process. I'm just making the point that Alfred and/or the workflow isn't the actual issue here. Could it be the code IN the workflow? Maybe, but I'm doubtful.

 

[Admin note: Renamed "Mavericks" thread to "Ruby workflows in Mavericks" as the discussion topic has become more specific]

Link to comment

So, I suspect there is a couple of things at play here.

 

I was able to modify my workflow so that it worked successfully via the command line calling the script directly.  To do this I had to re-bundle so that the path for Ruby 2.0.0 was correct.

 

However, it still fails as described via Alfred, again putting nothing in the logs.

Link to comment

I'm becoming less convinced that this is a Ruby problem at all, but an Alfred / Mavericks problem.  

 

If I run my Ruby script directly using the same path/command as Alfred it works fine.  However, from Alfred it immediately fails silently as described earlier in this thread.

 

If I go one step further and modify the workflow itself, for instance flip it to try and run the Ruby script with Python, I see exactly the same behaviour, and still nothing in the logs.

 

It seems that Alfred is immediately failing the execution of the script and not logging anything to the Alfred-Workflow.log.

Link to comment

I'm becoming less convinced that this is a Ruby problem at all, but an Alfred / Mavericks problem.  

 

If I run my Ruby script directly using the same path/command as Alfred it works fine.  However, from Alfred it immediately fails silently as described earlier in this thread.

 

If I go one step further and modify the workflow itself, for instance flip it to try and run the Ruby script with Python, I see exactly the same behaviour, and still nothing in the logs.

 

It seems that Alfred is immediately failing the execution of the script and not logging anything to the Alfred-Workflow.log.

 

I have a ticket to look into this a bit more deeply… but it's a bit strange that the reports of this aren't widespread, and that David is seeing the workflows run fine in their current state.

Link to comment

Is it possible that this is a permissions issue? I finally got around to doing a permissions repair (which I usually do once every major OS update) and I noticed that the permissions for the OS version of Ruby were "Repaired". 

 

How about trying an extremely basic script that just.. I don't know, echoes something back from ruby and shows a notification? That would allow you to verify that may help narrow things down a little. Also, check austin's suggestion and repair permissions. As mentioned before, I've seen multiple people talking about all kinds of oddities from their Mavericks upgrade. Who knows what all Apple did :)

Link to comment

Is it possible that this is a permissions issue? I finally got around to doing a permissions repair (which I usually do once every major OS update) and I noticed that the permissions for the OS version of Ruby were "Repaired". 

 

I think that this sounds like a very good idea!

Link to comment

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...