justinweiss / robut

A simple plugin-enabled HipChat bot
171 stars 48 forks source link

'initialize': uninitialized constant Robut::Storage::HashStore on initialization #45

Closed alex-espinoza closed 10 years ago

alex-espinoza commented 10 years ago

When trying to start up my bot with: "robut Chatfile" I am getting the following error:

vagrant@tricenix:~/app$ robut Chatfile
/usr/local/rvm/gems/ruby-2.1.2/gems/robut-0.5.2/lib/robut/connection.rb:68:in `initialize': uninitialized constant Robut::Storage::HashStore (NameError)
    from /usr/local/rvm/gems/ruby-2.1.2/gems/robut-0.5.2/bin/robut:14:in `new'
    from /usr/local/rvm/gems/ruby-2.1.2/gems/robut-0.5.2/bin/robut:14:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.1.2/bin/robut:23:in `load'
    from /usr/local/rvm/gems/ruby-2.1.2/bin/robut:23:in `<main>'
    from /usr/local/rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
    from /usr/local/rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'

Here is my Chatfile:

require 'robut/plugin/sayings'

Robut::Plugin.plugins << Robut::Plugin::Sayings

Robut::Connection.configure do |config|
  config.jid = "$ROOM_NAME@conf.btf.hipchat.com/bot"
  config.password = "$BOT_ACCOUNT_PASSWORD"
  config.nick = "Bot Nickname"
  config.room = "$ROOM_NAME@conf.btf.hipchat.com"
  config.mention_name = "botnickname"
  config.enable_private_messaging = false
  config.logger = Logger.new(STDOUT)
end

and my config.ru

require 'rubygems'
require 'bundler/setup'
Bundler.require :default

require 'robut'
require 'ostruct'
require 'logger'

load './Chatfile'

Robut::Web.set :connection, Robut::Connection.new.connect

run Robut::Web

I have tried leaving the config.password as a blank string as I don't know if it is the room's password or the bot account's password. But nowhere in the documentation does it say a bot account needs to be set up? Kind of confusing.

justinweiss commented 10 years ago

Sorry about that :-/

Yeah, Robut should have its own HipChat account. It acts like a normal user, listening for chat messages and responding.

For the HashStore thing, could you try including the file in your Chatfile?

require 'robut/storage/hash_store'

The plugins / storage engines aren't autoloaded, so you have to specify which one you want.

alex-espinoza commented 10 years ago

Ah, that seemed to do the trick. Is it cool if I send in a pull request to update the documentation a bit?

justinweiss commented 10 years ago

Absolutely! That’d be really helpful.

On Oct 15, 2014, at 9:20 AM, Alex Espinoza notifications@github.com wrote:

Ah, that seemed to do the trick. Is it cool if I send in a pull request to update the documentation a bit?

— Reply to this email directly or view it on GitHub https://github.com/justinweiss/robut/issues/45#issuecomment-59232958.