Closed johnbeynon closed 11 years ago
What is the return of /usr/bin/ruby ./main/rb
?
what is the location of the workflow installed ?
So this is the output of /usr/bin/ruby ./main.rb in my workflow - it's just a clone of your template at the moment but it doesn't return anything via Alfred itself.
<items>
<item arg="/Users/john/Applications" autocomplete="Applications" type="file" uid="/Users/john/Applications" valid="yes">
<title>Applications</title>
<subtitle>/Users/john/Applications</subtitle>
<icon type="fileicon">/Users/john/Applications</icon>
</item>
<item arg="A test feedback Item" uid="" valid="yes">
<title>Just a Test</title>
<subtitle>feedback item</subtitle>
<icon>icon.png</icon>
</item>
<item arg="" autocomplete="failed" uid="" valid="no">
<title>Rescue Feedback Test</title>
<subtitle>rescue feedback item</subtitle>
<icon>icon.png</icon>
</item>
</items>
If I add the untouched clone of your template as a workflow (rake install) to Alfred I get this output - but the test keyword again tries to do a google fall back search.
<items>
<item arg="/Users/john/Applications" autocomplete="Applications" type="file" uid="/Users/john/Applications" valid="yes">
<title>Applications</title>
<subtitle>/Users/john/Applications</subtitle>
<icon type="fileicon">/Users/john/Applications</icon>
</item>
<item arg="A test feedback Item" uid="" valid="yes">
<title>Just a Test</title>
<subtitle>feedback item</subtitle>
<icon>icon.png</icon>
</item>
<item arg="" autocomplete="failed" uid="" valid="no">
<title>Rescue Feedback Test</title>
<subtitle>rescue feedback item</subtitle>
<icon>icon.png</icon>
</item>
</items>
If I remove this workflow and double click on the .alfredworkflow that is in the template it works.
I'm using the dropbox method here since I have my Alfred set to sync a folder in Google Drive in fact.
so it works as expected... I am kind of confused about what the issue is now.
no, what I'm saying is running the script manually the output you expect is generated but from a script filter in Alfred it doesn't - it just tries to do a fall back google search, for mine changes but also if I install the vanilla workflow into Alfred.
what are the keywords you typed?
'test feedback' - it's quite strange, If I copy the output from running the main.rb manually and paste that into the main.rb then I get Alfred showing it - so it's something in the main.rb that's erroring - I'm investigating myself.
update: It appears to be require "alfred"
that's causing the problem.
run rake bundle:install
to install alfred gem
tried that. doesn't help.
However, if I install the alfred-workflow gem into my system ruby then it works...my Gemfile is as follows.
source "https://rubygems.org"
gem "plist"
gem "logging"
gem "alfred-workflow", ">= 1.1.1"
and further investigation shows that my bundle\ruby\1.8\gems\alfred-workflow-x
folder is empty - which explains the problem
ok, so it looks like the problem here was RVM and system ruby getting in the way of each other. As long as I revert to using system ruby rvm use system
before I do the rake bundle:install
it looks like it's working now.
source "https://rubygems.org"
gem "plist"
gem "alfred-workflow"
check if the bundle folder contains alfred-workflow gem
├── [zhaocai 5.1K] README.md
├── [zhaocai 1.7K] Rakefile
├── [zhaocai 414K] alfred2-ruby-template.alfredworkflow
├── [zhaocai 154] config.yml
├── [zhaocai 102] screenshots
│ └── [zhaocai 46K] rescue\ feedback.png
└── [zhaocai 374] workflow
├── [zhaocai 65] Gemfile
├── [zhaocai 172] Gemfile.lock
├── [zhaocai 170] bundle
│ ├── [zhaocai 102] bundler
│ │ └── [zhaocai 404] setup.rb
│ └── [zhaocai 136] ruby
│ └── [zhaocai 272] 1.8
│ ├── [zhaocai 238] build_info
│ │ ├── [zhaocai 4] alfred-workflow-1.8.0.info
│ │ ├── [zhaocai 4] little-plugger-1.1.3.info
│ │ ├── [zhaocai 4] logging-1.8.1.info
│ │ ├── [zhaocai 4] multi_json-1.7.2.info
│ │ └── [zhaocai 4] plist-3.1.0.info
│ ├── [zhaocai 136] cache
│ │ ├── [zhaocai 18K] alfred-workflow-1.8.0.gem
│ │ └── [zhaocai 37K] plist-3.1.0.gem
│ ├── [zhaocai 68] doc
│ ├── [zhaocai 170] gems
│ │ ├── [zhaocai 544] alfred-workflow-1.8.0
│ │ │ ├── [zhaocai 76] Gemfile
│ │ │ ├── [zhaocai 1.7K] Gemfile.lock
│ │ │ ├── [zhaocai 770] Guardfile
│ │ │ ├── [zhaocai 771] History.txt
│ │ │ ├── [zhaocai 458] Manifest.txt
│ │ │ ├── [zhaocai 4.0K] README.md
│ │ │ ├── [zhaocai 1.1K] Rakefile
│ │ │ ├── [zhaocai 3.9K] alfred-workflow.gemspec
│ │ │ ├── [zhaocai 136] lib
│ │ │ │ ├── [zhaocai 238] alfred
│ │ │ │ │ ├── [zhaocai 136] feedback
│ │ │ │ │ │ ├── [zhaocai 632] file_item.rb
│ │ │ │ │ │ └── [zhaocai 3.5K] item.rb
│ │ │ │ │ ├── [zhaocai 1.6K] feedback.rb
│ │ │ │ │ ├── [zhaocai 2.1K] setting.rb
│ │ │ │ │ ├── [zhaocai 536] ui.rb
│ │ │ │ │ └── [zhaocai 38] version.rb
│ │ │ │ └── [zhaocai 4.0K] alfred.rb
│ │ │ ├── [zhaocai 170] spec
│ │ │ │ ├── [zhaocai 204] alfred
│ │ │ │ │ ├── [zhaocai 102] feedback
│ │ │ │ │ │ └── [zhaocai 602] item_spec.rb
│ │ │ │ │ ├── [zhaocai 2.9K] feedback_spec.rb
│ │ │ │ │ ├── [zhaocai 1.5K] setting_spec.rb
│ │ │ │ │ └── [zhaocai 361] ui_spec.rb
│ │ │ │ ├── [zhaocai 282] alfred_spec.rb
│ │ │ │ └── [zhaocai 1.3K] spec_helper.rb
│ │ │ └── [zhaocai 102] test
│ │ │ └── [zhaocai 102] workflow
│ │ │ └── [zhaocai 3.6K] info.plist
│ │ └── [zhaocai 272] plist-3.1.0
│ │ ├── [zhaocai 3.6K] CHANGELOG
│ │ ├── [zhaocai 1.1K] LICENSE
│ │ ├── [zhaocai 5.8K] README.rdoc
│ │ ├── [zhaocai 3.8K] Rakefile
│ │ ├── [zhaocai 136] lib
│ │ │ ├── [zhaocai 136] plist
│ │ │ │ ├── [zhaocai 6.4K] generator.rb
│ │ │ │ └── [zhaocai 4.5K] parser.rb
│ │ │ └── [zhaocai 359] plist.rb
│ │ └── [zhaocai 272] test
│ │ ├── [zhaocai 340] assets
│ │ │ ├── [zhaocai 4.8K] AlbumData.xml
│ │ │ ├── [zhaocai 2.5K] Cookies.plist
│ │ │ ├── [zhaocai 255] commented.plist
│ │ │ ├── [zhaocai 100] example_data.bin
│ │ │ ├── [zhaocai 9.3K] example_data.jpg
│ │ │ ├── [zhaocai 15K] example_data.plist
│ │ │ ├── [zhaocai 893] test_data_elements.plist
│ │ │ └── [zhaocai 335] test_empty_key.plist
│ │ ├── [zhaocai 3.5K] test_data_elements.rb
│ │ ├── [zhaocai 1.1K] test_generator.rb
│ │ ├── [zhaocai 1.5K] test_generator_basic_types.rb
│ │ ├── [zhaocai 1.4K] test_generator_collections.rb
│ │ └── [zhaocai 2.6K] test_parser.rb
│ └── [zhaocai 136] specifications
│ ├── [zhaocai 4.7K] alfred-workflow-1.8.0.gemspec
│ └── [zhaocai 725] plist-3.1.0.gemspec
├── [zhaocai 25K] icon.png
├── [zhaocai 3.6K] info.plist
├── [zhaocai 1.0K] main.rb
└── [zhaocai 364] main_with_rescue_feedback.rb
25 directories, 63 files
So I've followed the instructions and cloned the template, changed the config.yml and installed it into Alfred.
The keywords display but it never executes the ./main.rb file so I never get anything returned. It tries to do a fall back search against Google.
If I install the .alfredworkflow that is in the template that one works. I've compared the directories side by side with no obvious observations. I can run /usr/bin/ruby ./main/rb from the command line and I get XML returned so I'm a little stuck...
any ideas?
Thanks,
John