Doesn't work in the production server
lepek opened this issue · 5 comments
Here is what happens if I run this locally in my workstation:
bundle exec rake maintenance:start
Created tmp/maintenance.yml
Run `rake maintenance:end` to stop maintenance mode
And this is what happens when I run it in the production server:
RAILS_ENV=production bundle exec rake maintenance:start
rake aborted!
Don't know how to build task 'maintenance:start'
(See full trace by running task with --trace)
All the other rake tasks works in production, it has to be something related with the environment, could you put some light here so I can research a little bit?
That is strange. It could be a naming conflict with a gem you have in your production group I suppose.
If you put load 'tasks/maintenance.rake'
in your Rakefile
does it work?
I assume you're using Rails. I see RAILS_ENV
in your example. Which version?
If I try to load it from the Rakefile it doesn't work:
RAILS_ENV=production bundle exec rake maintenance:start
rake aborted!
LoadError: cannot load such file -- tasks/maintenance.rake
....
Some info about the stack:
bundle exec rake about
About your application's environment
Rails version 4.2.0
Ruby version 2.1.2-p95 (x86_64-linux)
RubyGems version 2.2.2
Rack version 1.5
JavaScript Runtime Node.js (V8)
Middleware Rack::Sendfile, ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x0055ee707318b0>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, Rack::Head, Rack::ConditionalGet, Rack::ETag, Warden::Manager
I don't see Turnout in your middleware list either so it seems like it's more than just a rake issue.
This is a dumb question, I know, but are you sure you don't have the turnout gem in just your development group in your Gemfile
?
It really looks like it is just not installed in production.
Exactly. You can close the issue. I just found the problem in capistrano failling the last time it was deployed!
That explains it. Thanks for the update.