Jump to content

Alfred stopped finding files on Google Drive File Stream


Recommended Posts

5 hours ago, alfredpanda said:

Could this high CPU from Ruby be the cache rebuilding with :gdlaunchd?

 

It’s possible, but there’s no good way to avoid that, the list needs to be built. Though I can change the cache saving to happen less often—let’s say once a day instead.


You’ll need to :gdlaunchd once to remove the old one and then do it again to install the new one. Note that removing it deletes the cache and adding it builds it.

Link to comment
22 minutes ago, vitor said:

 

It’s possible, but there’s no good way to avoid that, the list needs to be built. Though I can change the cache saving to happen less often—let’s say once a day instead.


You’ll need to :gdlaunchd once to remove the old one and then do it again to install the new one. Note that removing it deletes the cache and adding it builds it.

Okay understood. Thank you so much - really appreciate it :)

Link to comment
On 8/26/2021 at 6:10 PM, vitor said:

@millerstevew Specifically, see how you’re getting the because it is not a compatible arch error but it’s checking /Library/Ruby? So it’s checking the system’s own installation but the architecture is wrong? Doesn’t make sense, seems like an oddity in your setup.

 

@vitor, I'm finally getting a chance to look into this. You are right. It looks like my new computer is trying to use the wrong architecture for Ruby to rub your workflow. 

 

I'm not a programmer, so maybe you could help me sort through what I've learned. 

 

I used migration assistant to move from my old Intel MacBook Pro to my new M1 MacBook Air. I thought this might be the issue at first (cruft coming over), but I'm less convinced of that now. 

 

This post from January suggests that there's a problem with the pre-installed (yet also deprecated) version of Ruby on macOS. The post explains that the Universal Ruby binary assumes an x86_64 host_cpu even though it's a Universal binary. The author says that's because RbConfig is compiled using x86_64 and that the only solution is to run a newer version of Ruby. I don't know enough to evaluate what the author is saying. Running the following command on my computer:

 

ruby -e 'require "rbconfig"; pp RbConfig::CONFIG' | grep "host"

 

does return the following results: 

 

 "host_os"=>"darwin20",
 "host_vendor"=>"apple",
 "host_cpu"=>"x86_64",
 "host"=>"x86_64-apple-darwin20",
 "host_alias"=>"",

 

This seems suspicious. A couple of questions:

 

1. Are you using the default install of Ruby on your M1 machine?

2. If you are, do you get the same results?

 

In response to this, I installed Homebrew and its most recent version of Ruby. (Along the way, I realized that I also needed to update something with my shell. I don't remember what Terminal was saying specifically, but it noted that running the following command was necessary.)

 

chsh -s /bin/zsh

 

Once I did this, I could properly update my $PATH to make use of Homebrew's version of Ruby. 

 

Final question:

 

3. If I use Homebrew's version of Ruby, should your script work?

 

Thanks again for the hard work and help. 

Link to comment
On 8/28/2021 at 8:40 PM, millerstevew said:

1. Are you using the default install of Ruby on your M1 machine?

 

The Workflow is, and that’s what matters.

 

On 8/28/2021 at 8:40 PM, millerstevew said:

2. If you are, do you get the same results?

 

No. I get the correct architecture.

 

On 8/28/2021 at 8:40 PM, millerstevew said:

3. If I use Homebrew's version of Ruby, should your script work?

 

No. The Workflow uses the system’s installation on purpose. Not only is it more consistent across machines, there are so many language managers that it would be infeasible to support them.

 

That your configuration is using the wrong architecture is a macOS bug, and you should report that to Apple via Feedback Assistant.

 

On 8/28/2021 at 8:40 PM, millerstevew said:

I used migration assistant to move from my old Intel MacBook Pro to my new M1 MacBook Air. I thought this might be the issue at first (cruft coming over), but I'm less convinced of that now.

 

I wouldn’t be. I have zero trust in Apple not mucking up that process. I always do clean installs, never direct upgrades, precisely because of that.


This might work to fix your case. Try it with either the Homebrew-installed gem or without it. Between each try, you’d have to delete the directory at "${HOME}/Library/Application Support/Alfred/Workflow Data/com.vitorgalvao.alfred.googledrive"Open a terminal and paste this, followed by ↵:


mkdir -p "${HOME}/Library/Application Support/Alfred/Workflow Data/com.vitorgalvao.alfred.googledrive"
gem install sqlite3 --no-document --install-dir "${HOME}/Library/Application Support/Alfred/Workflow Data/com.vitorgalvao.alfred.googledrive/sqlite3"

Link to comment

I just tried building the cache and was running into an error. I eventually found that the error was due to `gem install pathname` failing. Finally, I realized my ruby already has `pathname` as a default library, and I was able to get the workflow working by changing the code to:

 

```

require 'pathname'

gemfile do
  source 'https://rubygems.org'
  gem 'json'
  gem 'sqlite3'
end

```

 

In other words, I moved pathname from being a gem to simply being required.

 

The SQLite solution also works quite well despite the fact that with no exclusions it is a (relatively) massive 32MB database. It would be really nice to exclude some folders when we get around to that.

 

One functionality I would also love to have is a way to filter only for folders. Maybe this is possible already? How would I create a workflow called `gdf` that filters the results to only show directories?

Link to comment
1 hour ago, tylerw said:

I just tried building the cache and was running into an error. I eventually found that the error was due to `gem install pathname` failing.

 

That should not be happening and I cannot reproduce. What exactly is the error?

 

1 hour ago, tylerw said:

despite the fact that with no exclusions it is a (relatively) massive 32MB database.

 

Well, you do have a lot of files. Nothing I can do on that front.

 

1 hour ago, tylerw said:

It would be really nice to exclude some folders when we get around to that.

 

Happy to report that’s already implemented, but I was saving it for the (imminent) official release of the Workflow.

 

1 hour ago, tylerw said:

One functionality I would also love to have is a way to filter only for folders.

 

That would be the proverbial kitchen sink. It’s a niche feature with one requester that would complicate the Workflow for everyone. The result should be approachable, not be a mini-Spotlight with more features than it has.

 

Not saying it’s never going to happen, but definitely not something for the first version.

 

1 hour ago, tylerw said:

How would I create a workflow called `gdf` that filters the results to only show directories?

 

Find the next if path.symlink? and add a next if path.file? underneath. And change the Workflow’s bundle ID.

Link to comment
3 hours ago, vitor said:

 

That should not be happening and I cannot reproduce. What exactly is the error?

 

 

Well, you do have a lot of files. Nothing I can do on that front.

 

 

Happy to report that’s already implemented, but I was saving it for the (imminent) official release of the Workflow.

 

 

That would be the proverbial kitchen sink. It’s a niche feature with one requester that would complicate the Workflow for everyone. The result should be approachable, not be a mini-Spotlight with more features than it has.

 

Not saying it’s never going to happen, but definitely not something for the first version.

 

 

Find the next if path.symlink? and add a next if path.file? underneath. And change the Workflow’s bundle ID.

That worked, thanks so much @vitor. Any suggestions on restricting scope to search a particular sub-directory within Google Drive?

 

For example, suppose I want `gdd` to search `/Volumes/GoogleDrive/My Drive/dev/` (this is just an example, not my exact use case, I'm actually looking to just make my gdf workflow customizable for where it searches)

Link to comment
18 hours ago, vitor said:

 

Change google_drive_path.


You didn’t tell me what your error was. That could be useful to help other people.

I wanted to change it dynamically so in the end I did this:

Filter = "#{filter}%"

Results = db.execute("SELECT fullpath FROM main WHERE #{Array.new(Query.length, 'basename LIKE ?').join(' AND ')} AND fullpath like ? ORDER BY accesstime DESC LIMIT ?;", Query, Filter, Limit).flatten

 

Here's the error I get when I run `gem install pathname` I've substituted my username with $USER

current directory: /Users/$USER/.gem/gems/pathname-0.1.0/ext/pathname
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210903-70329-wn4b37.rb extconf.rb
checking for rb_file_s_birthtime()... no
creating Makefile

current directory: /Users/$USER/.gem/gems/pathname-0.1.0/ext/pathname
make "DESTDIR=" clean

current directory: /Users/$USER/.gem/gems/pathname-0.1.0/ext/pathname
make "DESTDIR="
compiling pathname.c
pathname.c:388:12: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return rb_funcallv_kw(rb_cFile, id_read, 1+n, args, RB_PASS_CALLED_KEYWORDS);
           ^
pathname.c:388:12: note: did you mean 'rb_funcallv'?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1870:7: note: 'rb_funcallv' declared here
VALUE rb_funcallv(VALUE, ID, int, const VALUE*);
      ^
pathname.c:388:57: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
    return rb_funcallv_kw(rb_cFile, id_read, 1+n, args, RB_PASS_CALLED_KEYWORDS);
                                                        ^
pathname.c:429:12: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return rb_funcallv_kw(rb_cFile, id_write, 1+n, args, RB_PASS_CALLED_KEYWORDS);
           ^
pathname.c:429:58: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
    return rb_funcallv_kw(rb_cFile, id_write, 1+n, args, RB_PASS_CALLED_KEYWORDS);
                                                         ^
pathname.c:450:12: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return rb_funcallv_kw(rb_cFile, id_binwrite, 1+n, args, RB_PASS_CALLED_KEYWORDS);
           ^
pathname.c:450:61: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
    return rb_funcallv_kw(rb_cFile, id_binwrite, 1+n, args, RB_PASS_CALLED_KEYWORDS);
                                                            ^
pathname.c:472:12: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return rb_funcallv_kw(rb_cFile, id_readlines, 1+n, args, RB_PASS_CALLED_KEYWORDS);
           ^
pathname.c:472:62: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
    return rb_funcallv_kw(rb_cFile, id_readlines, 1+n, args, RB_PASS_CALLED_KEYWORDS);
                                                             ^
pathname.c:680:16: error: implicit declaration of function 'rb_block_call_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return rb_block_call_kw(rb_cFile, id_open, 1+n, args, 0, 0, RB_PASS_CALLED_KEYWORDS);
               ^
pathname.c:680:16: note: did you mean 'rb_block_call'?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1951:7: note: 'rb_block_call' declared here
VALUE rb_block_call(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE);
      ^
pathname.c:680:69: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
        return rb_block_call_kw(rb_cFile, id_open, 1+n, args, 0, 0, RB_PASS_CALLED_KEYWORDS);
                                                                    ^
pathname.c:683:16: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return rb_funcallv_kw(rb_cFile, id_open, 1+n, args, RB_PASS_CALLED_KEYWORDS);
               ^
pathname.c:683:61: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
        return rb_funcallv_kw(rb_cFile, id_open, 1+n, args, RB_PASS_CALLED_KEYWORDS);
                                                            ^
pathname.c:1099:16: error: implicit declaration of function 'rb_block_call_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return rb_block_call_kw(rb_cDir, id_glob, n, args, s_glob_i, klass, RB_PASS_CALLED_KEYWORDS);
               ^
pathname.c:1099:77: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
        return rb_block_call_kw(rb_cDir, id_glob, n, args, s_glob_i, klass, RB_PASS_CALLED_KEYWORDS);
                                                                            ^
pathname.c:1104:15: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        ary = rb_funcallv_kw(rb_cDir, id_glob, n, args, RB_PASS_CALLED_KEYWORDS);
              ^
pathname.c:1104:57: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
        ary = rb_funcallv_kw(rb_cDir, id_glob, n, args, RB_PASS_CALLED_KEYWORDS);
                                                        ^
pathname.c:1147:16: error: implicit declaration of function 'rb_block_call_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return rb_block_call_kw(rb_cDir, id_glob, n, args, glob_i, self, RB_PASS_KEYWORDS);
               ^
pathname.c:1147:74: error: use of undeclared identifier 'RB_PASS_KEYWORDS'
        return rb_block_call_kw(rb_cDir, id_glob, n, args, glob_i, self, RB_PASS_KEYWORDS);
                                                                         ^
pathname.c:1152:15: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        ary = rb_funcallv_kw(rb_cDir, id_glob, n, args, RB_PASS_KEYWORDS);
              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [pathname.o] Error 1

make failed, exit code 2

 

It seems to me that pathname is a built-inclass

Worst case you can just do something like?

begin
  require 'pathname'
rescue LoadError
  puts "gem 'pathname' is not installed"
  system("gem install pathname")
end

 

Link to comment

@vitor I'd just like to point out how amazing it is that, Google Drive use-case aside, you've built an entire replacement for spotlight written in SQLite on top of Alfred!!! 

 

I've now been able to switch out some File Filters for your Script Filter in custom workflows I use, with capabilities like restricting the file type to directories and restricting the scope to particular subdirectories (using the filter variable above).

 

Theoretically, any of us could use this on top of our whole OS drive by changing the path to '~/' and completely disable spotlight indexing!

 

 

Link to comment
On 8/30/2021 at 6:48 AM, vitor said:

This might work to fix your case. Try it with either the Homebrew-installed gem or without it. Between each try, you’d have to delete the directory at "${HOME}/Library/Application Support/Alfred/Workflow Data/com.vitorgalvao.alfred.googledrive"Open a terminal and paste this, followed by ↵:

 

mkdir -p "${HOME}/Library/Application Support/Alfred/Workflow Data/com.vitorgalvao.alfred.googledrive"
gem install sqlite3 --no-document --install-dir "${HOME}/Library/Application Support/Alfred/Workflow Data/com.vitorgalvao.alfred.googledrive/sqlite3"

 

 

Neither the Homebrew-installed version or the native version work with this suggestion. I've become convinced that this is the result of the Time Machine migration. When I have the time, I'll do a clean install of macOS. in the meantime, thanks for the assistance @vitor. I look forward to using your workflow once I sort out the issues on my end.

Link to comment
1 hour ago, tylerw said:

Theoretically, any of us could use this on top of our whole OS drive by changing the path to '~/' and completely disable spotlight indexing!

 

That's not particularly good idea, tbh. For one thing, locate (which does exactly that) is already installed, it just needs enabling.

 

But more than that, scanning the entire tree is an inferior way to index a real volume. It would be a much better idea to use FSEvents to index filesystem changes in real time as they happen, not re-scan the entire tree every X minutes or hours. The index would always be up to date, and in most cases the load on the system and especially disk(s) would be much lower.

Edited by deanishe
Link to comment
On 8/26/2021 at 6:10 PM, vitor said:

@millerstevew Specifically, see how you’re getting the because it is not a compatible arch error but it’s checking /Library/Ruby? So it’s checking the system’s own installation but the architecture is wrong? Doesn’t make sense, seems like an oddity in your setup.

 

I reinstall macOS and did not do a migration from time machine. I'm getting the following error when I try to run the :gdrebuildcache command. @vitor, I hate to keep bugging you, especially since this was working fine on my previous machine. Any thoughts? 

 

[20:29:33.777] Google Drive[Keyword] Processing complete
[20:29:33.782] Google Drive[Keyword] Passing output '' to Arg and Vars
[20:29:33.783] Google Drive[Arg and Vars] Processing complete
[20:29:33.783] Google Drive[Arg and Vars] Passing output '' to Run Script
[20:29:37.008] ERROR: Google Drive[Run Script] /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/installer/parallel_installer.rb:201:in `handle_error': Gem::Ext::BuildError: ERROR: Failed to build gem native extension. (Bundler::InstallError)

    current directory: /Users/steve/Library/Application Support/Alfred/Workflow Data/com.vitorgalvao.alfred.googledrive/sqlite3/gems/pathname-0.1.0/ext/pathname
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210905-20014-4q5iat.rb extconf.rb
checking for rb_file_s_birthtime()... no
creating Makefile

current directory: /Users/steve/Library/Application Support/Alfred/Workflow Data/com.vitorgalvao.alfred.googledrive/sqlite3/gems/pathname-0.1.0/ext/pathname
make "DESTDIR=" clean

current directory: /Users/steve/Library/Application Support/Alfred/Workflow Data/com.vitorgalvao.alfred.googledrive/sqlite3/gems/pathname-0.1.0/ext/pathname
make "DESTDIR="
compiling pathname.c
pathname.c:388:12: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return rb_funcallv_kw(rb_cFile, id_read, 1+n, args, RB_PASS_CALLED_KEYWORDS);
           ^
pathname.c:388:12: note: did you mean 'rb_funcallv'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1870:7: note: 'rb_funcallv' declared here
VALUE rb_funcallv(VALUE, ID, int, const VALUE*);
      ^
pathname.c:388:57: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
    return rb_funcallv_kw(rb_cFile, id_read, 1+n, args, RB_PASS_CALLED_KEYWORDS);
                                                        ^
pathname.c:429:12: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return rb_funcallv_kw(rb_cFile, id_write, 1+n, args, RB_PASS_CALLED_KEYWORDS);
           ^
pathname.c:429:58: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
    return rb_funcallv_kw(rb_cFile, id_write, 1+n, args, RB_PASS_CALLED_KEYWORDS);
                                                         ^
pathname.c:450:12: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return rb_funcallv_kw(rb_cFile, id_binwrite, 1+n, args, RB_PASS_CALLED_KEYWORDS);
           ^
pathname.c:450:61: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
    return rb_funcallv_kw(rb_cFile, id_binwrite, 1+n, args, RB_PASS_CALLED_KEYWORDS);
                                                            ^
pathname.c:472:12: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return rb_funcallv_kw(rb_cFile, id_readlines, 1+n, args, RB_PASS_CALLED_KEYWORDS);
           ^
pathname.c:472:62: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
    return rb_funcallv_kw(rb_cFile, id_readlines, 1+n, args, RB_PASS_CALLED_KEYWORDS);
                                                             ^
pathname.c:680:16: error: implicit declaration of function 'rb_block_call_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return rb_block_call_kw(rb_cFile, id_open, 1+n, args, 0, 0, RB_PASS_CALLED_KEYWORDS);
               ^
pathname.c:680:16: note: did you mean 'rb_block_call'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/ruby.h:1951:7: note: 'rb_block_call' declared here
VALUE rb_block_call(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE);
      ^
pathname.c:680:69: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
        return rb_block_call_kw(rb_cFile, id_open, 1+n, args, 0, 0, RB_PASS_CALLED_KEYWORDS);
                                                                    ^
pathname.c:683:16: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return rb_funcallv_kw(rb_cFile, id_open, 1+n, args, RB_PASS_CALLED_KEYWORDS);
               ^
pathname.c:683:61: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
        return rb_funcallv_kw(rb_cFile, id_open, 1+n, args, RB_PASS_CALLED_KEYWORDS);
                                                            ^
pathname.c:1099:16: error: implicit declaration of function 'rb_block_call_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return rb_block_call_kw(rb_cDir, id_glob, n, args, s_glob_i, klass, RB_PASS_CALLED_KEYWORDS);
               ^
pathname.c:1099:77: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
        return rb_block_call_kw(rb_cDir, id_glob, n, args, s_glob_i, klass, RB_PASS_CALLED_KEYWORDS);
                                                                            ^
pathname.c:1104:15: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        ary = rb_funcallv_kw(rb_cDir, id_glob, n, args, RB_PASS_CALLED_KEYWORDS);
              ^
pathname.c:1104:57: error: use of undeclared identifier 'RB_PASS_CALLED_KEYWORDS'
        ary = rb_funcallv_kw(rb_cDir, id_glob, n, args, RB_PASS_CALLED_KEYWORDS);
                                                        ^
pathname.c:1147:16: error: implicit declaration of function 'rb_block_call_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return rb_block_call_kw(rb_cDir, id_glob, n, args, glob_i, self, RB_PASS_KEYWORDS);
               ^
pathname.c:1147:74: error: use of undeclared identifier 'RB_PASS_KEYWORDS'
        return rb_block_call_kw(rb_cDir, id_glob, n, args, glob_i, self, RB_PASS_KEYWORDS);
                                                                         ^
pathname.c:1152:15: error: implicit declaration of function 'rb_funcallv_kw' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        ary = rb_funcallv_kw(rb_cDir, id_glob, n, args, RB_PASS_KEYWORDS);
              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [pathname.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/steve/Library/Application Support/Alfred/Workflow Data/com.vitorgalvao.alfred.googledrive/sqlite3/gems/pathname-0.1.0 for inspection.
Results logged to /Users/steve/Library/Application Support/Alfred/Workflow Data/com.vitorgalvao.alfred.googledrive/sqlite3/extensions/universal-darwin-20/2.6.0/pathname-0.1.0/gem_make.out

An error occurred while installing pathname (0.1.0), and Bundler cannot continue.
Make sure that `gem install pathname -v '0.1.0' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  pathname
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/installer/parallel_installer.rb:106:in `call'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/installer/parallel_installer.rb:78:in `call'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/installer.rb:289:in `install_in_parallel'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/installer.rb:197:in `install'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/installer.rb:92:in `block in run'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/process_lock.rb:12:in `block in lock'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/process_lock.rb:9:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/process_lock.rb:9:in `lock'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/installer.rb:73:in `run'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/installer.rb:25:in `install'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/inline.rb:62:in `block in gemfile'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/settings.rb:143:in `temporary'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/inline.rb:61:in `gemfile'
	from /Users/steve/Dropbox/Apps/Alfred/Alfred.alfredpreferences/workflows/user.workflow.51393A5B-89D2-416D-9EDE-822BE20BF39D/rebuild_cache:7:in `<main>'
[20:29:37.024] Google Drive[Run Script] Processing complete
[20:29:37.025] Google Drive[Run Script] Passing output '' to Conditional
[20:29:37.026] Google Drive[Conditional] Processing complete
[20:29:37.027] Google Drive[Conditional] Passing output '' to Post Notification

 

Link to comment

If that does work and Google doesn’t make a launchd daemon to work around the issue, maybe we can. That StackExchange answer is from July and already has a “not as permanent as I thought” edit so not jumping into that solution just yet.

 

Either way, the Workflow has been ready for about a week with some changes, including support for multiple Google Drive paths. It also (tries to) uses the included SQLIte gem, so it might solve your issue @millerstevew.

 

Pinging @alfredpanda because you asked to be notified of the release.

 

 

Link to comment
On 9/9/2021 at 7:31 PM, vitor said:

maybe we can

 

I think the last piece of the puzzle for a flawless experience is using FSEvents to update the index database.

 

If the user has fswatch installed via Homebrew, perhaps you could set up a launch agent to update the database as files are added and removed, instead of having to crawl the entire volume each time? That hammers the CPU and can still take a long time on large drives.

Edited by deanishe
Markdown -> BB Code
Link to comment
2 hours ago, vitor said:

I’d prefer to find a solution which would work out of the box, even if it meant including a compiled binary which doesn’t seem simple with fswatch.

 

Doesn't the system Ruby have bindings to macOS APIs? The system Pythons always have the 3rd-party bindings pre-installed (not that Python is an out-of-the-box solution any more…)

 

I'd probably write that part in Go or Swift. JXA's no good, as you'd probably want at least a couple of threads.

 

In any case, the fswatch feature could be optional for people for whom a full re-index is problematic.

 

Link to comment

Hi

 

I recently downloaded Alfred and have been using Google Drive File Stream. I've read over most of the posts but am still new and learning. I haven't purchased a powerpack yet. 

 

Does Vitor's workflow allow us to search for files in our google shared drives? 

 

Is there another workaround? 

Link to comment
On 9/21/2021 at 4:58 PM, millerstevew said:

 

It does. This is exactly what I use it for. The only important detail is to change the directory from "My Drive" to your Google Drive folder when you set up the workflow. 

How do I rename the drive? And do I have to do something different to include the shared drive?

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