The corporate proxy at my company seems to interfere with httpsconnections to rubygems.org connections (but not http), causing crashes when trying to set gems from the default gem source, https://rubygems.org . For this reason, I am trying to update my gem sources to replace the default source with an unsecured version of rubygems.org http. (And yes, I know the security implications of this.)
When I do this manually from the command line, everything works fine; I just need to go through the warning message:
$ gem sources --add http:
https:
Do you want to add this insecure source? [yn]
However, there seems to be no way around this prompt when running this command from an automated script. The command gemhas no option --yesor --force(as far as I know) and is trying to use yesto skip the prompt, it simply leads to the following error message:
$ yes | gem sources --add http:
ERROR: While executing gem ... (Gem::OperationNotSupportedError)
Not connected to a tty and no default specified
How can I go through a warning message to programmatically add http://rubygems.org as a source?
source
share