diff --git a/config/initializers/oink.rb b/config/initializers/oink.rb index c8a17b0fb..038dd3c5c 100644 --- a/config/initializers/oink.rb +++ b/config/initializers/oink.rb @@ -1,3 +1,12 @@ if Rails.env == 'development' - Rails.application.middleware.use(Oink::Middleware, :logger => Rails.logger) -end \ No newline at end of file + if defined?(Oink) + Rails.application.middleware.use(Oink::Middleware, :logger => Rails.logger) + else + $stderr.puts "WARNING:" + $stderr.puts " You run in development but Oink isn't available in your gems." + $stderr.puts " That most likely means you copied the bundle command from the installation guide" + $sterrr.puts " and didn't removed development from the --without parameter while having" + $stderr.puts " the intention to run under development mode. To fix this either switch to" + $stderr.puts " production mode or do a rm .bundle/config and run bundle install --without heroku" + end +end