db:migrate fails with hipchat configured
asachs opened this issue · comments
Andre Sachs commented
Following the instructions to enable hipchat and i get the following message back from heroku when i try run a db:migrate:
Unknown chat service: "hipchat". Available services are campfire
my config.ru looks like :
require "janky"
require "janky/chat_service/hipchat"
Janky.setup(ENV)
run Janky.app
and the heroku config looks like (secret values removed) :
DATABASE_URL => postgres://xxx@ec2-50-19-113-83.compute-1.amazonaws.com/xxx
GEM_PATH => vendor/bundle/ruby/1.9.1
JANKY_BASE_URL => http://clue-janky.herokuapp.com/
JANKY_BUILDER_DEFAULT => http://jxxx@ns2.clue.co.za/
JANKY_CHAT => hipchat
JANKY_CHAT_DEFAULT_ROOM => xxx
JANKY_CHAT_HIPCHAT_TOKEN => xxx
JANKY_CONFIG_DIR => /app/config
JANKY_GITHUB_HOOK_SECRET => xxx
JANKY_GITHUB_PASSWORD => xxx
JANKY_GITHUB_USER => clue-janky
JANKY_HUBOT_PASSWORD => xxx
JANKY_HUBOT_USER => hubot
LANG => en_US.UTF-8
PATH => bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
RACK_ENV => production
SHARED_DATABASE_URL => postgres://xxx@ec2-50-19-113-83.compute-1.amazonaws.com/xxx
Any ideas ?
Thanks and regards,
Andre
Simon Rozet commented
Okay I see what's up. You need to require the hipchat adapter in the Rakefile
as well. Like this:
diff --git a/Rakefile b/Rakefile
index d29e236..28dbfbf 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,3 +1,4 @@
require "janky"
+require "janky/chat_service/hipchat"
Janky.setup(ENV)
require "janky/tasks"
I'll try to think of a better solution.
Andre Sachs commented
Ohh awesome, thanks ! That got the migrations running.
Simon Rozet commented
I updated the gist so that the Rakefile
and config.ru
share the same environment. This is the diff:
diff --git a/Rakefile b/Rakefile
index d29e236..231ff1a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,3 +1,2 @@
-require "janky"
-Janky.setup(ENV)
+require File.expand_path("../config/environment", __FILE__)
require "janky/tasks"
diff --git a/config.ru b/config.ru
index 8963ba7..e38a46c 100644
--- a/config.ru
+++ b/config.ru
@@ -1,3 +1,2 @@
-require "janky"
-Janky.setup(ENV)
+require File.expand_path("../config/environment", __FILE__)
run Janky.app
diff --git a/config/environment.rb b/config/environment.rb
new file mode 100644
index 0000000..2c954b5
--- /dev/null
+++ b/config/environment.rb
@@ -0,0 +1,2 @@
+require "janky"
+Janky.setup(ENV)
Released 0.9.11 as well.