grindcrank / twitter_ebooks

Better twitterbots for all your friends~alive and polling
MIT License
12 stars 6 forks source link

Uninitialized constant when consuming the json #3

Closed simonszu closed 6 years ago

simonszu commented 6 years ago

I am currently trying to change from twitter_ebooks to your version of the gem. Unfortunately i am running into an issue when i order the ebooks command to consume the json i have fetched with ebooks archive:

/usr/local/bundle/gems/twitter_ebooks_poll-3.2.0/bin/ebooks:98:in `block in consume': uninitialized constant Ebooks::CLI::APP_PATH (NameError)                                                                                        
app_1  |        from /usr/local/bundle/gems/twitter_ebooks_poll-3.2.0/bin/ebooks:94:in `each'                                                                                                                                                  
app_1  |        from /usr/local/bundle/gems/twitter_ebooks_poll-3.2.0/bin/ebooks:94:in `consume'                                                                                                                                               
app_1  |        from /usr/local/bundle/gems/twitter_ebooks_poll-3.2.0/bin/ebooks:426:in `command'                                                                                                                                              
app_1  |        from /usr/local/bundle/gems/twitter_ebooks_poll-3.2.0/bin/ebooks:449:in `<top (required)>'                                                                                                                                     
app_1  |        from /usr/local/bundle/bin/ebooks:23:in `load'                                                                                                                                                                                 
app_1  |        from /usr/local/bundle/bin/ebooks:23:in `<main>' 

(please ignore the app_1 | prefixes, they are resulting from docker-compose up when running my ebooks container`.

I do not have this exception when i just use the old gem. For migration, @Cheatha told me that just changing the gem install should be sufficient, but it looks like it isn't. Maybe you can look into it?

grindcrank commented 6 years ago

It will take me a while to get into this. I will have pull up a Docker environment. In your Dockerfile, you use Ruby 2.5 - what happens if you switch to 2.4? I never tried the lib with Ruby > 2.4 ...

simonszu commented 6 years ago

I'll check this later on. However, I doubt that it will make a difference, since it works quite good with the original gem.

I also am a little confused, since from what i saw in your commits, you haven't touched the specific parts of the code very much, so I am surprised that just changing the gem is causing such a huge difference.

grindcrank commented 6 years ago

Nope, unfortunately it is not in the version. I tried this using 2.5 via rvm - works.

grindcrank commented 6 years ago

But what I did change indeed was the way the bots.rb is loaded. And apparently your ebooks script breaks exactly at this point.

grindcrank commented 6 years ago

Aaaaah, shoot me. I did not check all ebooks commands (I only started the bot in testing my hastily build hack) - APP_PATH is everywhere in there. I'll fix this.

grindcrank commented 6 years ago

Should work again, please try.