dreamcat4 / plist4r

Plist4r - Read, write and edit plists in ruby
http://dreamcat4.github.com/plist4r
Other
6 stars 1 forks source link

Unable to install plist4r-1.2.2 on OS X 10.8.4 #3

Open mthole-old opened 11 years ago

mthole-old commented 11 years ago

Trying to do a 'gem install plist4r' fails on Mac OS X 10.8.4 for me:

[~] mthole $ gem install plist4r
Building native extensions.  This could take a while...
ERROR:  Error installing plist4r:
    ERROR: Failed to build gem native extension.

    /usr/local/Cellar/ruby/2.0.0-p0/bin/ruby extconf.rb
creating Makefile

make
compiling osx_plist/plist.c
osx_plist/plist.c:105:32: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                rb_raise(ePropertyListError, (char *)errBuffer);
                                             ^       ~~~~~~~~~
osx_plist/plist.c:97:40: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                        int len = CFStringGetLength(error)*2+1;
                            ~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
osx_plist/plist.c:150:10: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                        len = RSTRING_LEN(buffer);
                            ~ ^~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/ruby/2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:864:6: note: expanded from macro 'RSTRING_LEN'
     RSTRING_EMBED_LEN(str) : \
     ^~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/ruby/2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:860:6: note: expanded from macro 'RSTRING_EMBED_LEN'
     (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
osx_plist/plist.c:150:10: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                        len = RSTRING_LEN(buffer);
                            ~ ^~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/ruby/2.0.0-p0/include/ruby-2.0.0/ruby/ruby.h:865:28: note: expanded from macro 'RSTRING_LEN'
     RSTRING(str)->as.heap.len)
     ~~~~~~~~~~~~~~~~~~~~~~^~~
4 warnings generated.
linking shared-object plist4r/backend/osx_plist/ext/osx_plist.bundle

make install
/usr/bin/install -c -m 0755 osx_plist.bundle /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/plist4r-1.2.2/lib/plist4r/backend/osx_plist/ext
install: /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/plist4r-1.2.2/lib/plist4r/backend/osx_plist/ext: No such file or directory
make: *** [install-so] Error 71

Gem files will remain installed in /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/plist4r-1.2.2 for inspection.
Results logged to /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/plist4r-1.2.2/ext/gem_make.out

I also ran the verbose/backtrace/debug version, here:

https://gist.github.com/mikethole/5762299

dreamcat4 commented 11 years ago

Not sure the why error. Probably something new has changed in Ruby 2.0. The specific error is not an intuitive one.

install: /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/plist4r-1.2.2/lib/plist4r/backend/osx_plist/ext: No such file or directory

Yet then:

"Results logged to /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/plist4r-1.2.2/ext/gem_make.out"

Wasn't that same folder the error reported didn't exist?

Anyway. I can't fix. But there is a possible work around. It's a plugin and hence not mandatory / necessary.

If you can edit this file:

https://github.com/dreamcat4/plist4r/blob/master/ext/extconf.rb

Then just don't compile the C extension.

Replace the line: create_makefile("plist4r/backend/osx_plist/ext/osx_plist","osx_plist")

With: create_makefile("","null")

And re-install as a locally-built gem.