jensb / iphoto2xmp

Export an Apple iPhoto image library to a new directory (using hardlinks) with all metadata saved in XMP sidecar files.
GNU General Public License v3.0
34 stars 9 forks source link

Dependencies on Apple High Sierra? #15

Closed mlevin77 closed 5 years ago

mlevin77 commented 5 years ago

Instructions say sudo apt-get install ruby2.2 ruby2.2-dev libsqlite3-dev sudo gem2.2 install sqlite3 progressbar CFPropertyList

On Apple OS X High sierra, using Brew to install packages,

zzaappedd commented 5 years ago

I don't know what I'm doing, but I know what I've done ;) I installed Brew like this: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

then I did: \curl -L https://get.rvm.io | bash -s stable –ruby

then gem which rubygems gem install progressbar gem install find gem install fileutils gem install exifr gem install cfpropertylist gem install CFPropertyList

I decided that was enough and tried running it. Ran for a while until it stumbled on an error: iphoto2xmp.rb:597:inblock (2 levels) in

': undefined method []' for nil:NilClass (NoMethodError) and that's when I decided to come here and look for a solution. All of this may help you...or not. good luck getting out of iphoto. I'm going to Mylio, where are you going?

mlevin77 commented 5 years ago

Thanks!! here's my problem, right at the 1st line...

bash-3.2$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" /Library/Ruby/Site/2.0.0/rubygems.rb:1280:in register_default_spec': undefined methoddefault_gems_use_full_paths?' for Gem:Module (NoMethodError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:699:in block in load_defaults' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:647:inblock (2 levels) in each_spec' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:643:in each' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:643:inblock in each_spec' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:642:in each' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:642:ineach_spec' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:653:in each_default' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:698:inload_defaults' from /Library/Ruby/Site/2.0.0/rubygems.rb:1423:in <top (required)>' from <internal:gem_prelude>:1:inrequire' from :1:in `'

any ideas?? I'm going to DigiKam, if I can get the export working...

jensb commented 5 years ago

I haven't tested this on Apple High Sierra yet. Will do when I update my Macbook Pro (still running Sierra)...

mlevin77 commented 5 years ago

Here's what I see on High Sierra: % gem which rubygems /usr/local/lib/ruby/2.5.0/rubygems.rb

% gem install progressbar ERROR: While executing gem ... (Gem::Exception) Unable to require openssl, install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources

digiboule commented 5 years ago

This is what it took for me on Sierra, with brew already installed:

1) Update ruby to fix a 'tlsv1 alert protocol version' issue:

brew install ruby brew link --overwrite ruby (quit + restart terminal)

2) Install dependencies:

gem install progressbar gem install fileutils gem install exifr gem install CFPropertyList gem install sqlite3

3) Lastly, I had to fix an EXIFR error by changing line 24 of iphoto2xmp.rb from: require 'exifr'

to: require 'exifr/jpeg'

After that, everything worked.. hope this helps someone.

mlevin77 commented 5 years ago

Ok so for me on High Sierra this fails immediately:

bash-3.2$ gem install progressbar ERROR: While executing gem ... (Gem::Exception) Unable to require openssl, install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources bash-3.2$

any idea what this means??

digiboule commented 5 years ago

Hmm.. probably that your ruby is super old.

Try the "update ruby" step in my instructions above, or this:

https://stackoverflow.com/questions/37336573/unable-to-require-openssl-install-openssl-and-rebuild-ruby-preferred-or-use-n

mlevin77 commented 5 years ago

ah!! rvm reinstall 2.3.0 --with-openssl-dir=/usr/bin/openssl

seems to have helped, proceeding to follow your other directions. Thanks!

mlevin77 commented 5 years ago

ok so I was able to successfully do all the gem installs, but when I run the iphoto2xmp.rb code, I see:

Traceback (most recent call last): 2: from iphoto2xmp.rb:19:in <main>' 1: from /usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:inrequire' /usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- progressbar (LoadError)

is it because my required files are in a different location - how do I tell it where to look? For example, I had

bash-3.2$ gem install progressbar Fetching: progressbar-1.9.0.gem (100%) Successfully installed progressbar-1.9.0 Parsing documentation for progressbar-1.9.0 Installing ri documentation for progressbar-1.9.0 Done installing documentation for progressbar after 0 seconds 1 gem installed

so progressbar is somewhere - why can't it find it?

mlevin77 commented 5 years ago

Update. I figured out where these dependencies live, and I managed to get them into the path by inserting this code:

$LOAD_PATH.unshift('/Users/mlevin/.rvm/gems/ruby-2.5.0/gems/progressbar-1.9.0/lib/') $LOAD_PATH.unshift('/Users/mlevin/.rvm/gems/ruby-2.5.0/gems/progressbar-1.9.0/lib/ruby-progressbar/') $LOAD_PATH.unshift('/Users/mlevin/.rvm/gems/ruby-2.5.0/gems/sqlite3-1.3.13/') $LOAD_PATH.unshift('/Users/mlevin/.rvm/gems/ruby-2.5.0/gems/sqlite3-1.3.13/lib/')

so now it doesn't give me the "can't find required file" error, but I do see this:

Traceback (most recent call last): 6: from iphoto2xmp.rb:27:in <main>' 5: from /usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:inrequire' 4: from /usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' 3: from /Users/mlevin/.rvm/gems/ruby-2.5.0/gems/sqlite3-1.3.13/lib/sqlite3.rb:2:in<top (required)>' 2: from /Users/mlevin/.rvm/gems/ruby-2.5.0/gems/sqlite3-1.3.13/lib/sqlite3.rb:6:in rescue in <top (required)>' 1: from /usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:inrequire' /usr/local/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': incompatible library version - /Users/mlevin/.rvm/gems/ruby-2.5.0/gems/sqlite3-1.3.13/lib/sqlite3/sqlite3_native.bundle (LoadError)

what's this incompatible library version??

jensb commented 5 years ago

Check the updated README and iphoto2xmp.rb at 905b26a and see if this works for you. I got it working fine on MacOS 10.12.6 on my Macbook Pro without any further modifications.

Please reopen if you have further issues. Thanks for pointing out the EXIFR issue!