Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not clear that require "<plugin>" should not be used in stages; warning doesn't help #1905

Closed
mattbrictson opened this issue Jul 12, 2017 · 4 comments

Comments

@mattbrictson
Copy link
Member

From @ethicalmohit in #1904 (comment)


I was confused with the below message, As which plugin it is taking about and was ignoring it almost because it says its just a warning. It says that the problem is with deploy.rb, I was looking into it. [The offending file was actually deploy/dev.rb (a stage).] Later on, I tried adding another thing which required many other plugins to be included in Capfile and it works. It seems to be the convention than a rule.

WARNING: load:defaults has already been invoked and can no longer be modified.
Check that you haven't loaded a Capistrano plugin in deploy.rb by mistake.
Plugins must be loaded in the Capfile to initialize properly.
@leehambley
Copy link
Member

Thanks for picking this up @mattbrictson - maybe we should simply prevent the behaviour and exit with a fatal error. Something akin to the growing trend of making compiler warnings fatal.

Maybe we simply blow up if someone reaches that line, and explain why?

@mattbrictson
Copy link
Member Author

Yes, this warning has been in Capistrano for a few versions now, so it is probably safe to promote it to a fatal error. Ideally it would also print the offending file and line number (e.g. in deploy/production.rb), although that might be more difficult.

@will-in-wi
Copy link
Contributor

@mattbrictson
Copy link
Member Author

Maybe the thing to do here is to change WARNING to ERROR in the text. It is not really a warning if it causes an uncaught exception. 😄

will-in-wi added a commit that referenced this issue Oct 12, 2017
Clarify message when require is in wrong config file. Fixes #1905
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants