我正在运行Manjaro Linux 18.0.4。我似乎不小心卸载了一些Ruby gem,或者通过执行 ctrl + c 中断了安装。
我尝试使用以下方法卸载所有gems:
gem uninstall -aIx
并弹出错误代码:
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::RDoc
我还尝试通过pamac卸载Ruby本身。
我想重新开始。最好的方法是什么?
答案 0 :(得分:2)
var
idHttp : TIdHTTPEx;
url : string;
slTemp : TStringList;
memoryStream : TMemoryStream;
begin
idHttp := TIdHTTPEx.Create(nil); // parent class is TIdHTTP, inherited to be able to execute HTTPS
slTemp := TStringList.Create;
memoryStream := TStringStream.Create;
try
idHttp.Request.ContentType := 'application/json';
url := 'https://safebrowsing.googleapis.com/v4/threatMatches:find?key=' + GOOGLE_SAFE_BROWSING_API_KEY + ' HTTP/1.1';
slTemp.Text := '{"client":{"clientId":"iGame","clientVersion":"1.0.0"},"threatInfo":{"threatTypes":"MALWARE","platformTypes":"WINDOWS","threatEntryTypes":"URL","threatEntries":[{"url":"http://www.hyxyg.com/default.php"},{"url":"https://jsonlint.com/"}]}}';
idHttp.Post(url, slTemp, memoryStream);
memo1.Text := memoryStream.ToString;
finally
memoryStream.Free;
slTemp.Free;
idHttp.Free;
end;
end;
是我完全想重新开始时要遵循的内容。
因此,类似于var
idHttp : TIdHTTPEx; // parent class is TIdHTTP, inherited to be able to execute HTTPS
url : string;
requestBody : TStream;
sTemp : string;
begin
url := 'https://safebrowsing.googleapis.com/v4/threatMatches:find?key=' + GOOGLE_SAFE_BROWSING_API_KEY + ' HTTP/1.1';
//url := 'https://httpbin.org/post';
idHttp := TIdHTTPEx.Create(nil);
requestBody := nil;
try
idHttp.Request.Accept := 'application/json';
idHttp.Request.ContentType := 'application/json';
sTemp := '{"client":{"clientId":"iGame","clientVersion":"1.0.0"},"threatInfo":{"threatTypes":"MALWARE","platformTypes":"WINDOWS","threatEntryTypes":"URL","threatEntries":[{"url":"http://www.hyxyg.com/default.php"},{"url":"https://jsonlint.com/"}]}}';
//sTemp := '{"日本語":42}';
requestBody := TStringStream.Create(sTemp, TEncoding.UTF8);
sTemp := idHttp.Post(url, requestBody);
memo1.Text := sTemp + sLineBreak + sLineBreak + idHttp.ResponseText;
finally
requestBody.Free;
idHttp.Free;
end;
end;
注意:sudo apt-get purge <packages>
也将删除其配置文件。
我总是建议人们使用sudo apt-get purge ruby rubygems
答案 1 :(得分:0)
要解决此错误,请尝试安装这些gems
gem install rdoc
gem update rake