vasi / cloudflare-dns-backup-tool

Backup DNS settings from CloudFlare, and auto-push them to a git repo
BSD 2-Clause "Simplified" License
15 stars 3 forks source link

Support for modern ruby and gem versions. #1

Open sammcj opened 7 years ago

sammcj commented 7 years ago

When running with Ruby 2.3.3 after a bundle install:

samm at systems-samm-imac in ~/git/cloudflare-dns-backup-tool on master! ./cloudflare-backup.rb <redactedEMAIL> <redactedAPI> /Users/samm/Downloads/cfdns

Ignoring bigdecimal-1.3.1 because its extensions are not built.  Try: gem pristine bigdecimal --version 1.3.1
Ignoring json-1.8.6 because its extensions are not built.  Try: gem pristine json --version 1.8.6
/Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json/ext/parser.bundle: [BUG] Segmentation fault
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   the more detail of.

-- Control frame information -----------------------------------------------
c:0021 p:-17532676671356 s:0098 e:000097 TOP    [FINISH]
c:0020 p:---- s:0096 e:000095 CFUNC  :require
c:0019 p:0113 s:0092 e:000091 METHOD /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54
c:0018 p:0009 s:0082 e:000081 CLASS  /Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json/ext.rb:7
c:0017 p:0011 s:0080 e:000079 CLASS  /Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json/ext.rb:6
c:0016 p:0017 s:0078 e:000077 TOP    /Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json/ext.rb:3 [FINISH]
c:0015 p:---- s:0076 e:000075 CFUNC  :require
c:0014 p:0113 s:0072 e:000071 METHOD /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54
c:0013 p:0019 s:0062 e:000061 CLASS  /Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json.rb:59
c:0012 p:0017 s:0060 e:000059 TOP    /Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json.rb:55 [FINISH]
c:0011 p:---- s:0058 e:000057 CFUNC  :require
c:0010 p:0113 s:0054 e:000053 METHOD /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54
c:0009 p:0015 s:0044 e:000043 TOP    /Users/samm/.rvm/gems/ruby-2.3.3/gems/cloudflare-2.1.0/lib/cloudflare/connection.rb:22 [FINISH]
c:0008 p:---- s:0042 e:000041 CFUNC  :require
c:0007 p:0170 s:0038 e:000037 METHOD /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:69
c:0006 p:0007 s:0028 e:000027 TOP    /Users/samm/.rvm/gems/ruby-2.3.3/gems/cloudflare-2.1.0/lib/cloudflare.rb:21 [FINISH]
c:0005 p:---- s:0026 e:000025 CFUNC  :require
c:0004 p:0083 s:0022 e:000021 RESCUE /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:128
c:0003 p:0388 s:0019 e:000018 METHOD /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:39
c:0002 p:0007 s:0009 E:001590 EVAL   ./cloudflare-backup.rb:2 [FINISH]
c:0001 p:0000 s:0002 E:001368 TOP    [FINISH]

./cloudflare-backup.rb:2:in `<main>'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:39:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `require'
/Users/samm/.rvm/gems/ruby-2.3.3/gems/cloudflare-2.1.0/lib/cloudflare.rb:21:in `<top (required)>'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:69:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:69:in `require'
/Users/samm/.rvm/gems/ruby-2.3.3/gems/cloudflare-2.1.0/lib/cloudflare/connection.rb:22:in `<top (required)>'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json.rb:55:in `<top (required)>'
/Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json.rb:59:in `<module:JSON>'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json/ext.rb:3:in `<top (required)>'
/Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json/ext.rb:6:in `<module:JSON>'
/Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json/ext.rb:7:in `<module:Ext>'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'

-- C level backtrace information -------------------------------------------

-- Other runtime information -----------------------------------------------

* Loaded script: ./cloudflare-backup.rb

* Loaded features:

    0 enumerator.so
    1 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/enc/encdb.bundle
    2 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/enc/trans/transdb.bundle
    3 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/rbconfig.rb
    4 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/thread.rb
    5 /Library/Ruby/Site/2.0.0/rubygems/compatibility.rb
    6 /Library/Ruby/Site/2.0.0/rubygems/defaults.rb
    7 /Library/Ruby/Site/2.0.0/rubygems/deprecate.rb
    8 /Library/Ruby/Site/2.0.0/rubygems/errors.rb
    9 /Library/Ruby/Site/2.0.0/rubygems/version.rb
   10 /Library/Ruby/Site/2.0.0/rubygems/requirement.rb
   11 /Library/Ruby/Site/2.0.0/rubygems/platform.rb
   12 /Library/Ruby/Site/2.0.0/rubygems/basic_specification.rb
   13 /Library/Ruby/Site/2.0.0/rubygems/stub_specification.rb
   14 /Library/Ruby/Site/2.0.0/rubygems/util/stringio.rb
   15 /Library/Ruby/Site/2.0.0/rubygems/specification.rb
   16 /Library/Ruby/Site/2.0.0/rubygems/exceptions.rb
   17 /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_gem.rb
   18 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/monitor.rb
   19 /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb
   20 /Library/Ruby/Site/2.0.0/rubygems.rb
   21 /Library/Ruby/Site/2.0.0/rubygems/path_support.rb
   22 /Library/Ruby/Site/2.0.0/rubygems/dependency.rb
   23 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/socket.bundle
   24 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/socket.rb
   25 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb
   26 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/protocol.rb
   27 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/common.rb
   28 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/generic.rb
   29 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/ftp.rb
   30 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/http.rb
   31 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/https.rb
   32 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/ldap.rb
   33 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/ldaps.rb
   34 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/mailto.rb
   35 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri.rb
   36 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/zlib.bundle
   37 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/stringio.bundle
   38 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/exceptions.rb
   39 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/header.rb
   40 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/generic_request.rb
   41 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/request.rb
   42 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/requests.rb
   43 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/response.rb
   44 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/responses.rb
   45 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/proxy_delta.rb
   46 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/backward.rb
   47 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb
   48 /Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json/version.rb
   49 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/ostruct.rb
   50 /Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json/generic_object.rb
   51 /Users/samm/.rvm/gems/ruby-2.3.3/gems/json-2.0.3/lib/json/common.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
Don't forget to include the above Crash Report log file.
For details: http://www.ruby-lang.org/bugreport.html

I have tried removing the required gems and reinstalling them as well as using the system ruby of 2.0.0.

vasi commented 7 years ago

I just tried this with Ruby 2.3.3 from MacPorts, and it seemed to work fine:

$ bundle install --path vendor/bundle
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Resolving dependencies...
Installing json 1.8.6 with native extensions
Using bundler 1.12.5
Installing cloudflare 2.1.0
Bundle complete! 1 Gemfile dependency, 3 gems now installed.
Bundled gems are installed into ./vendor/bundle.
$ bundle exec ruby ./cloudflare-backup.rb $EMAIL $TOKEN backup

Can you give more information about where your Ruby comes from, and what happened when you tried to bundle install?