taw / magic-preconstructed-decks

Magic: the Gathering Preconstructed Decks
6 stars 9 forks source link

Build Errors #5

Closed ZeldaZach closed 5 years ago

ZeldaZach commented 5 years ago

Been fiddling around with this, but can't seem to figure out what's up.

ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

$ brew install bundle
$ bundle install --path vendor/bundle
$ bundle install
$ bundle exec bin/build_jsons decks.json
bundler: failed to load command: bin/build_jsons (bin/build_jsons)
NoMethodError: undefined method `compact' for {:name=>"Aquastrand Spider", :count=>1, :foil=>nil}:Hash
  /Users/zachary/Desktop/magic-preconstructed-decks/lib/deck.rb:37:in `block in card_data'
  /Users/zachary/Desktop/magic-preconstructed-decks/lib/deck.rb:32:in `map'
  /Users/zachary/Desktop/magic-preconstructed-decks/lib/deck.rb:32:in `card_data'
  bin/build_jsons:24:in `add_deck'
  bin/build_jsons:51:in `validate_and_add_deck'
  bin/build_jsons:142:in `block in build'
  bin/build_jsons:140:in `each'
  bin/build_jsons:140:in `build'
  bin/build_jsons:154:in `<top (required)>'
taw commented 5 years ago

This one is pretty obvious, Hash#compact was added in ruby 2.4. That's from 2016. Don't use 2015 software ;-)

(it's also very simple fix to install backports if you absolutely need to run it on ruby 2.3, I just never test on old rubies)

ZeldaZach commented 5 years ago

Ran with ruby 2.5.3, but same issues came about. Tried reinstalling bundler too and clearing its old cache, but it still registered as 2.3.0 when installed via gem.

taw commented 5 years ago

You get error about compact in ruby 2.5?

Probably something wrong with your installation, but I added hash-polyfill gem to this so it can run on ruby 2.3.

ZeldaZach commented 5 years ago

Appreciated