我在我的虚拟机ubuntu12.04lts中安装了openssl.
当我运行gem命令时,它会出错.
错误:执行gem时(Gem :: Exception)
无法使用openssl.安装openSSL并重建ruby(首选)或使用非HTTPs源
我还测试了irb模式下的openssl.它给出了错误.
Loaderror:无法
从/usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55"require" 加载此类文件--openssl
我有openssl
$openssl version
OpenSSL 1.0.1 14 mar 2012
Run Code Online (Sandbox Code Playgroud)
如何修复错误?
我在程序中使用wget来使用HTTP协议获取一些文件。在这里,我需要设置安全性,因此我们将HTTP协议移至HTTPS。
更改为HTTPS后如何执行wget。我的意思是如何在两台机器之间建立信任的连接,然后执行wget。
我想确保只能从某些系统执行wget。
以下陈述有何不同?
#(not working)
File.exists?("path to file")
#(working)
::File.exists?("path to file")
Run Code Online (Sandbox Code Playgroud)
我在Ruby的Chef框架中使用了上面的语句.
在下面的servlet中,我想添加内容类型和字符集编码.
public class FBOAuth extends HttpServlet {
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
this.response.setContentType("application/json");
this.response.setCharacterEncoding("UTF-8");
...
Run Code Online (Sandbox Code Playgroud)
我使用以下命令编译此servlet.
$ javac -classpath json.jar FBOAuth.java
Run Code Online (Sandbox Code Playgroud)
FBOAuth.java:24: error: cannot find symbol
this.response.setContentType("application/json");
^
symbol: variable response
FBOAuth.java:25: error: cannot find symbol
this.response.setCharacterEncoding("UTF-8");
^
symbol: variable response
2 errors
Run Code Online (Sandbox Code Playgroud) ruby ×2
certificate ×1
chef-infra ×1
java ×1
openssl ×1
rubygems ×1
servlets ×1
ssl ×1
this ×1
wget ×1