add warning about common setup error manifesting in uninitialized constant Oink

This commit is contained in:
Jonne Haß 2012-01-31 21:56:01 +01:00
parent f1de7f9be1
commit de4c9a1289

View file

@ -1,3 +1,12 @@
if Rails.env == 'development'
Rails.application.middleware.use(Oink::Middleware, :logger => Rails.logger)
end
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