phallstrom / slackistrano

Slack integration for Capistrano deployments.
MIT License
374 stars 74 forks source link

Include rake to avoid rails server to crash on bootstrap + move triggers from code to deploy.rb of the project #10

Closed jameslafa closed 8 years ago

jameslafa commented 9 years ago

I had problem starting my server with the current implementation.

lib/slackistrano/tasks/slack.rake:2:in<top (required)>': undefined method namespace' for main:Object (NoMethodError)

It apprends that require 'rake' was needed.

But then the hooks after 'deploy:starting', 'slack:deploy:starting' were not accepted anymore:

<top (required)>': undefined method after' for main:Object (NoMethodError)

So I decided to removed the trigger from the configuration set :slack_run_starting, ->{ true } and propose to had the hooks manually inside the deploy.rb like the other gems are doing.

It works fine for me, so I propose the pull request. However, feel free not to merge it, I solve my own problem and it doesn't mean that it's the best way for everyone using it.

phallstrom commented 9 years ago

I don't think I'll merge this as no one else has reported a problem with this. I'd be more curious to know why it's happening to you though in the first place. Happy to discuss that.

vyorkin commented 9 years ago

maybe I had the same problem today, for anyone else who'll come here: you could just add it to Gemfile like this gem 'slackistrano', require: false

phallstrom commented 8 years ago

I think the underlying issue is how where I'm loading the rake tasks. Instead of having that be in lib/slackistrano.rb which gets loaded when the gem is loaded I need to put it somewhere else such as lib/slackistrano/capistrano.rb and then have folks adjust their Capfile to require 'slackistrano/capistrano'. I'll look at addressing that, which should solve your original issue, but not require you to manually specify the hooks.