Giter Club home page Giter Club logo

Comments (5)

staringispolite avatar staringispolite commented on September 28, 2024 1

Oh interesting. I just forked master here, and got it working fine off mysql locally: https://github.com/staringispolite/TwitterHypeMan

Starting to think forking master may have been the wrong way to go about things? :)

(And yes, Heroku lets you add key/value pairs to the environment) Ruby gets at them via ENV[key]

from chatterbot.

staringispolite avatar staringispolite commented on September 28, 2024

Oops, fixed this but still unable to run on Heroku. This particular error was because of an incorrect Procfile. Should say something like

worker: bundle exec ruby mybot.rb

However, the script is still trying to configure itself over CLI, presumably because it's not connecting to the DB. Any advice on the best way to deploy to heroku would be helpful. I'm thinking my options are:

  • Change the config loading logic to look for db_uri in the Heroku config vars
  • Commit my YML file to a public repo (...dangerous to say the least)

from chatterbot.

muffinista avatar muffinista commented on September 28, 2024

FYI, the beta version of the gem doesn't support MySQL at all. For 1.0, can you specify environment variables for a Heroku instance? I think you can. If so, you could run the bot with something like:

CHATTERBOT_DB="mysql://foo" bundle exec ruby mybot.rb

I'm contemplating ways to add SQL support back, but it was a drag to support and made the configuration inflexible.

from chatterbot.

muffinista avatar muffinista commented on September 28, 2024

It depends on exactly what you need to do. If you're running your bot via the Streaming API, then you don't need to persist anything, and it should be fine running on Heroku. If you want to run it as a cron job, or if there's any data you need to store, then the master branch might not work too well for you.

I have a thought about how to handle the persistence problem, I'll see if I can get some code going in the next few days.

from chatterbot.

staringispolite avatar staringispolite commented on September 28, 2024

Cool! I ended up switching to the streaming API for the reasons you said just to get a working version up (great minds!)

@alexbaldwin and I added some config stuff for local vs heroku environments, so that I wouldn't have to push my Twitter key/secret/etc into my public git repo - happy to send a PR if you're interested.

I only wanted persistence so it wouldn't miss an @-mention. (Say, if I have downtime, or if Heroku sleeps the dyno). It seems like the streaming API would only send it @-mentions as they happen, so if it's down when a tweet happens, it'll never process that tweet. Not the biggest deal, but would be nice.

from chatterbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.