bigcartel / dugway

Easily build and test Big Cartel themes.
https://developers.bigcartel.com/api/themes
MIT License
149 stars 22 forks source link

locale': undefined method `[]' for nil:NilClass #191

Open 8biteric opened 2 years ago

8biteric commented 2 years ago

Hey gang... trying to get Dugway running locally and failing. I have been able to get it to run in the past, but no go on the server locally today. I think it's gagging on this error:

/Library/Ruby/Gems/2.3.0/gems/dugway-1.0.4/lib/dugway/store.rb:127:in locale': undefined method[]' for nil:NilClass (NoMethodError)

Which points to this code in store.rb:

    def locale
      currency['locale']
    end

I'm admittedly a bit of a dinosaur when it comes to coding – I'm a PHP guy – so I'm not quite up to speed on Ruby. Obviously Dugway isn't finding what it's looking for with currency.

I'll bet this is a quick fix. Any ideas?

8biteric commented 2 years ago

I was able to get things running by declaring locale right in the definition:

def locale
    "en-US"
end
brettchalupa commented 2 years ago

@8biteric thanks for sharing this & glad you found a way to bypass the issue. I will do some investigating into it and see what I can do to fix it. Was there a longer stack trace? Just curious about some more info to help dig into the cause.