小编Pyt*_*ord的帖子

OSX 10.7.5 - Ruby on Rails LoadError:无法打开库'sodium':dlopen(sodium,5)

输入rake db后:create i get:

LoadError: Could not open library 'sodium': dlopen(sodium, 5): image not found.
Could not open library 'libsodium.dylib': dlopen(libsodium.dylib, 5): image not found
Run Code Online (Sandbox Code Playgroud)

这是一些更多的输出.

/Users/Mao/.rvm/gems/ruby-2.0.0-p451/gems/ffi-1.9.3/lib/ffi/library.rb:133:in `block in ffi_lib'
/Users/Mao/.rvm/gems/ruby-2.0.0-p451/gems/ffi-1.9.3/lib/ffi/library.rb:100:in `map'
/Users/Mao/.rvm/gems/ruby-2.0.0-p451/gems/ffi-1.9.3/lib/ffi/library.rb:100:in `ffi_lib'
/Users/Mao/.rvm/gems/ruby-2.0.0-p451/gems/rbnacl-3.1.1/lib/rbnacl/sodium.rb:12:in `extended'
/Users/Mao/.rvm/gems/ruby-2.0.0-p451/gems/rbnacl-3.1.1/lib/rbnacl/sodium/version.rb:8:in `extend'
/Users/Mao/.rvm/gems/ruby-2.0.0-p451/gems/rbnacl-3.1.1/lib/rbnacl/sodium/version.rb:8:in `<module:Version>'
/Users/Mao/.rvm/gems/ruby-2.0.0-p451/gems/rbnacl-3.1.1/lib/rbnacl/sodium/version.rb:5:in `<module:Sodium>'
/Users/Mao/.rvm/gems/ruby-2.0.0-p451/gems/rbnacl-3.1.1/lib/rbnacl/sodium/version.rb:4:in `<module:RbNaCl>'
/Users/Mao/.rvm/gems/ruby-2.0.0-p451/gems/rbnacl-3.1.1/lib/rbnacl/sodium/version.rb:3:in `<top (required)>'
Run Code Online (Sandbox Code Playgroud)

ruby macos gem ruby-on-rails dlopen

6
推荐指数
1
解决办法
3835
查看次数

手动向网站发送GET请求.302重定向错误

我目前正在使用java进行Web scraper.我通过设置tcp连接和使用printerwriter手动发送GET请求.

我可以连接到大多数网站,如yahoo.com或cracked.com并收到回复,但我无法连接到我的目标网站 - vinylengine.com.它总是会返回302错误.

我已经将我的发送请求与我的浏览器进行了比较,它们几乎相同.

我的标题:

GET / HTTP/1.1
Host: www.vinylengine.com
Run Code Online (Sandbox Code Playgroud)

我的回复:

HTTP/1.1 302 Found
Date: Thu, 06 Jun 2013 19:27:00 GMT
Server: Apache
Location: http://www.nakedresource.com/
Cache-Control: max-age=1209600
Expires: Thu, 20 Jun 2013 19:27:00 GMT
Content-Length: 213
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://www.nakedresource.com/">here</a>.</p>
</body></html>
Run Code Online (Sandbox Code Playgroud)

浏览器标题:

GET http://www.vinylengine.com/ HTTP/1.1
Host: www.vinylengine.com
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, …
Run Code Online (Sandbox Code Playgroud)

java redirect get http request

5
推荐指数
1
解决办法
4656
查看次数

在C++中,if语句后跟分号而不是大括号是什么意思?

我最近看到了一些vp8示例解码器代码.

for(y=0; y<img->d_h >> (plane?1:0); y++) {
    int iLength = img->d_w >> (plane?1:0);
    iFrameCursor += iLength;

    if(fwrite(buf, 1, iLength, outfile)); //This semicolon
        buf += img->stride[plane];
}
Run Code Online (Sandbox Code Playgroud)

知道if语句是什么意思吗?

c++ if-statement

2
推荐指数
1
解决办法
527
查看次数

C++ UDP.为什么recvfrom()没有阻塞?

我正在使用UDP编写一些简单的客户端/服务器代码.该程序工作正常,但如果我只启动客户端,recvfrom方法不会阻止.但是,当我删除sendto方法时,recvfrom开始阻塞.怎么知道发生了什么?

这是客户端代码:

    int server_length;                      /* Length of server struct */
    char send_buffer[256] = "hi";           /* Data to send */
    time_t current_time;                    /* Time received */

    while(true)
    {

        /* Tranmsit data to get time */
        server_length = sizeof(struct sockaddr_in);
        if (sendto(m_oSocket, send_buffer, (int)strlen(send_buffer) + 1, 0, (struct sockaddr *)&m_oServer, server_length) == -1)
        {
            fprintf(stderr, "Error transmitting data.\n");
            continue;
        }

        /* Receive time */

        if (recvfrom(m_oSocket, (char *)&current_time, (int)sizeof(current_time), 0, (struct sockaddr *)&m_oServer, &server_length) < 0)
        {
            fprintf(stderr, "Error receiving data.\n");
            continue; …
Run Code Online (Sandbox Code Playgroud)

c++ client udp winsock blocking

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

c++ ×2

blocking ×1

client ×1

dlopen ×1

gem ×1

get ×1

http ×1

if-statement ×1

java ×1

macos ×1

redirect ×1

request ×1

ruby ×1

ruby-on-rails ×1

udp ×1

winsock ×1