发表文章

[Ruby] 在 LXC 容器上运行的问题。 Issue running on LXC container.[iqdbs]

Iratu 2017-10-9 29

您好, 我移动的东西到不同的容器, 似乎不能让这个运行, 我已经得到了所有正确的设置, 我已经测试了它与普通 PC 和它的工作正常, 不断得到这个错误:

Did you mean?  Set:
	/var/www/iqdbs/releases/20170814210329/lib/iqdb/server.rb:57:in `block in download'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tempfile.rb:295:in `open'
	/var/www/iqdbs/releases/20170814210329/lib/iqdb/server.rb:56:in `download'
	/var/www/iqdbs/releases/20170814210329/lib/iqdb/server.rb:87:in `download_and_query'
	/var/www/iqdbs/releases/20170814210329/web/iqdbs.rb:27:in `block in <top (required)>'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1611:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1611:in `block in compile!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in `block (3 levels) in route!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:994:in `route_eval'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in `block (2 levels) in route!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1015:in `block in process_route'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1013:in `catch'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1013:in `process_route'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:973:in `block in route!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:972:in `each'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:972:in `route!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1085:in `block in dispatch!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `block in invoke'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `catch'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `invoke'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1082:in `dispatch!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in `block in call!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `block in invoke'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `catch'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `invoke'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in `call!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:895:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/logger.rb:15:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:212:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/head.rb:13:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/methodoverride.rb:22:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:182:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:2013:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1487:in `block in call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1787:in `synchronize'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1487:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/tempfile_reaper.rb:15:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/commonlogger.rb:33:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:219:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/chunked.rb:54:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/content_length.rb:15:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:562:in `process_client'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:658:in `worker_loop'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:508:in `spawn_missing_workers'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:132:in `start'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/bin/unicorn:126:in `<top (required)>'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/bin/unicorn:23:in `load'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/bin/unicorn:23:in `<top (required)>'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/cli/exec.rb:74:in `load'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/cli/exec.rb:74:in `kernel_load'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/cli/exec.rb:27:in `run'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/cli.rb:365:in `exec'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/cli.rb:22:in `dispatch'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/cli.rb:13:in `start'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/exe/bundle:30:in `block in <top (required)>'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/exe/bundle:22:in `<top (required)>'
	/home/danbooru/.rbenv/versions/2.3.1/bin/bundle:23:in `load'
	/home/danbooru/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>'
0.0.0.0(edited from my own IP) - - [14/Aug/2017:21:21:41 +0000] "GET /similar?key=SecretKey&url=http%3A%2F%2Fatfbooru.ninja%2Fdata%2Fpreview%2Fc85c754f522b7ea3b54676a5d4e1d97d.jpg HTTP/1.0" 500 30 0.0012
原文:

Hello, I was moving things to different containers and can't seem to get this to run, I've got it all correctly setup and I've tested it with a normal PC and it worked fine, keep getting this error:

Did you mean?  Set:
	/var/www/iqdbs/releases/20170814210329/lib/iqdb/server.rb:57:in `block in download'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tempfile.rb:295:in `open'
	/var/www/iqdbs/releases/20170814210329/lib/iqdb/server.rb:56:in `download'
	/var/www/iqdbs/releases/20170814210329/lib/iqdb/server.rb:87:in `download_and_query'
	/var/www/iqdbs/releases/20170814210329/web/iqdbs.rb:27:in `block in <top (required)>'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1611:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1611:in `block in compile!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in `block (3 levels) in route!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:994:in `route_eval'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in `block (2 levels) in route!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1015:in `block in process_route'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1013:in `catch'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1013:in `process_route'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:973:in `block in route!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:972:in `each'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:972:in `route!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1085:in `block in dispatch!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `block in invoke'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `catch'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `invoke'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1082:in `dispatch!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in `block in call!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `block in invoke'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `catch'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in `invoke'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in `call!'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:895:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/logger.rb:15:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:212:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/head.rb:13:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/methodoverride.rb:22:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:182:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:2013:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1487:in `block in call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1787:in `synchronize'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:1487:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/tempfile_reaper.rb:15:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/commonlogger.rb:33:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/sinatra-1.4.7/lib/sinatra/base.rb:219:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/chunked.rb:54:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/rack-1.6.5/lib/rack/content_length.rb:15:in `call'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:562:in `process_client'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:658:in `worker_loop'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:508:in `spawn_missing_workers'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/lib/unicorn/http_server.rb:132:in `start'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/gems/unicorn-5.2.0/bin/unicorn:126:in `<top (required)>'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/bin/unicorn:23:in `load'
	/var/www/iqdbs/shared/bundle/ruby/2.3.0/bin/unicorn:23:in `<top (required)>'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/cli/exec.rb:74:in `load'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/cli/exec.rb:74:in `kernel_load'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/cli/exec.rb:27:in `run'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/cli.rb:365:in `exec'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/cli.rb:22:in `dispatch'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/cli.rb:13:in `start'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/exe/bundle:30:in `block in <top (required)>'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
	/home/danbooru/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.15.3/exe/bundle:22:in `<top (required)>'
	/home/danbooru/.rbenv/versions/2.3.1/bin/bundle:23:in `load'
	/home/danbooru/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>'
0.0.0.0(edited from my own IP) - - [14/Aug/2017:21:21:41 +0000] "GET /similar?key=SecretKey&url=http%3A%2F%2Fatfbooru.ninja%2Fdata%2Fpreview%2Fc85c754f522b7ea3b54676a5d4e1d97d.jpg HTTP/1.0" 500 30 0.0012
相关推荐
最新评论 (21)
r888888888 2017-10-9
1

你确定你没有造成打字错误吗?我看不到要设置的引用。

原文:

Are you sure you didn't cause a typo? I don't see a reference to Set.

Iratu 2017-10-9
2

我也不这样做, 我使用的是我的分叉, 这在我的其他系统的罚款。
https://github.com/Iratu/iqdbs

如果需要, 我可以让你进入那个容器。

原文:

Neither do I, I'm using the one I forked which works fine on my other system.
https://github.com/Iratu/iqdbs

I could give you access to that container if needed.

r888888888 2017-10-9
3

好象错误消息被截断了。

您可以做的是打开一个控制台并手动下载 URL, 如下所:

Iqdb::Server.default.download_and_query(url, nil, 5)

这可能会给你一个更好的错误信息。

原文:

Well it seems like the error message is truncated.

What you could do is open a console and download the URL manually like so:

Iqdb::Server.default.download_and_query(url, nil, 5)

That might give you a better error message.

Iratu 2017-10-9
4

我现在也得到了这个错误;
2017-08-15 23:41:48 - NameError - uninitialized constant Iqdb::Server::Net

我在日志中看到了它的弹出, 我不知道如何运行你给我的命令, 我会看它很快

原文:

I now get this error as well;
2017-08-15 23:41:48 - NameError - uninitialized constant Iqdb::Server::Net

I saw it popup in the logs, I'm not sure how to run that command you gave me I'll look it up soon

evazion 2017-10-9
5

irb -rnet/http是否工作?这听起来像是有什么东西搞砸了你的 ruby 安装和库没有被正确加载。

原文:

Does irb -rnet/http work? It sounds like something is messed up with your ruby install and libraries aren't being loaded properly.

Iratu 2017-10-9
6

不知道我在这里做什么

danbooru@iqdbs:/var/www/iqdbs/current$ irb -rnet/http
irb(main):001:0> Iqdb::Server.default.download_and_query('https://atfbooru.ninja/data/preview/28f19d14ea4d8234c4638461f2f92178.jpg', nil, 5)
NameError: uninitialized constant Iqdb
        from (irb):1
        from /home/danbooru/.rbenv/versions/2.3.1/bin/irb:11:in `<main>'
irb(main):002:0>
原文:

Not sure what I'm doing here.

danbooru@iqdbs:/var/www/iqdbs/current$ irb -rnet/http
irb(main):001:0> Iqdb::Server.default.download_and_query('https://atfbooru.ninja/data/preview/28f19d14ea4d8234c4638461f2f92178.jpg', nil, 5)
NameError: uninitialized constant Iqdb
        from (irb):1
        from /home/danbooru/.rbenv/versions/2.3.1/bin/irb:11:in `<main>'
irb(main):002:0>
r888888888 2017-10-9
7

要运行bundle exec rails console

原文:

you want to run bundle exec rails console

Iratu 2017-10-9
8
danbooru@iqdbs:/var/www/iqdbs/current$ bundle exec rails console
bundler: command not found: rails
Install missing gem executables with `bundle install`

是我现在得到的

原文:
danbooru@iqdbs:/var/www/iqdbs/current$ bundle exec rails console
bundler: command not found: rails
Install missing gem executables with `bundle install`

Is what I'm getting now

r888888888 2017-10-9
9

哦, 我的错, 这不是一个 Rails 应用程序。

是否设置了。如果是这样, 你应该能够复制和粘贴3-12 行从网站/iqdbs. rb 到 IRB 终端 evazion 提及。然后, 您可以运行 Iqdb::Server 命令。

原文:

Oh my bad, this isn't a Rails app.

Did you setup the .env file? If so you should be able to copy and paste lines 3-12 from web/iqdbs.rb into the IRB terminal evazion mentioned. Then you can run the Iqdb::Server command.

r888888888 2017-10-9
10

您可以将./lib 预置为 iqdb 要求, 例如 require './lib/iqdb/server'

原文:

You can prepend ./lib to the iqdb requires so require './lib/iqdb/server' for example.

r888888888 2017-10-9
11

您可以要求 swam 进行响应/收集工作。然后, 您可以尝试Iqdb::Server.default.download_and_query('https://atfbooru.ninja/data/preview/28f19d14ea4d8234c4638461f2f92178.jpg', nil, 5)

原文:

You can require forwardable to make responses/collection work. You can then try Iqdb::Server.default.download_and_query('https://atfbooru.ninja/data/preview/28f19d14ea4d8234c4638461f2f92178.jpg', nil, 5)

Iratu 2017-10-9
12

似乎用这种方式..。

irb(main):001:0> require "dotenv"
=> true
irb(main):002:0> Dotenv.load
=> -snip-
irb(main):003:0>
irb(main):004:0* require "sinatra"
=> true
irb(main):005:0> require "json"
=> true
irb(main):006:0> require "forwardable"
=> true
irb(main):007:0> require "./lib/iqdb/responses/collection"
=> true
irb(main):008:0> require "./lib/iqdb/responses/error"
=> true
irb(main):009:0> require "./lib/iqdb/responses/responses"
=> true
irb(main):010:0> require "./lib/iqdb/server"
=> true
irb(main):011:0> require "./lib/iqdb/command"
=> true
irb(main):012:0> Iqdb::Server.default.download_and_query('https://atfbooru.ninja/data/preview/28f19d14ea4d8234c4638461f2f92178.jpg', nil, 5)
+0 20:10:24.279 Accepted normal connection from 127.0.0.1:29902
+0 20:10:24.346 Connection 127.0.0.1:29902 closing.
=> #<Iqdb::Responses::Collection:0x0055ab193a9480 @responses=[#<Iqdb::Responses::Response_000:0x0055ab193a9188>, #<Iqdb::Responses::Response_101:0x0055ab193a90e8 @key="matches", @value="5">, #<Iqdb::Responses::Response_200:0x0055ab193a8ee0 @imgid="00032a16", @score=99.999513, @width=128, @height=128>, #<Iqdb::Responses::Response_200:0x0055ab193a8c60 @imgid="00023e99", @score=68.062161, @width=150, @height=150>, #<Iqdb::Responses::Response_200:0x0055ab193a8a08 @imgid="0002b6b7", @score=67.065129, @width=115, @height=150>, #<Iqdb::Responses::Response_200:0x0055ab193a8738 @imgid="0000c8f6", @score=65.459684, @width=150, @height=113>, #<Iqdb::Responses::Response_200:0x0055ab193a84b8 @imgid="0001468e", @score=65.305331, @width=150, @height=149>, #<Iqdb::Responses::Response_000:0x0055ab193a8288>]>
irb(main):013:0>
原文:

Seems to work this way...

irb(main):001:0> require "dotenv"
=> true
irb(main):002:0> Dotenv.load
=> -snip-
irb(main):003:0>
irb(main):004:0* require "sinatra"
=> true
irb(main):005:0> require "json"
=> true
irb(main):006:0> require "forwardable"
=> true
irb(main):007:0> require "./lib/iqdb/responses/collection"
=> true
irb(main):008:0> require "./lib/iqdb/responses/error"
=> true
irb(main):009:0> require "./lib/iqdb/responses/responses"
=> true
irb(main):010:0> require "./lib/iqdb/server"
=> true
irb(main):011:0> require "./lib/iqdb/command"
=> true
irb(main):012:0> Iqdb::Server.default.download_and_query('https://atfbooru.ninja/data/preview/28f19d14ea4d8234c4638461f2f92178.jpg', nil, 5)
+0 20:10:24.279 Accepted normal connection from 127.0.0.1:29902
+0 20:10:24.346 Connection 127.0.0.1:29902 closing.
=> #<Iqdb::Responses::Collection:0x0055ab193a9480 @responses=[#<Iqdb::Responses::Response_000:0x0055ab193a9188>, #<Iqdb::Responses::Response_101:0x0055ab193a90e8 @key="matches", @value="5">, #<Iqdb::Responses::Response_200:0x0055ab193a8ee0 @imgid="00032a16", @score=99.999513, @width=128, @height=128>, #<Iqdb::Responses::Response_200:0x0055ab193a8c60 @imgid="00023e99", @score=68.062161, @width=150, @height=150>, #<Iqdb::Responses::Response_200:0x0055ab193a8a08 @imgid="0002b6b7", @score=67.065129, @width=115, @height=150>, #<Iqdb::Responses::Response_200:0x0055ab193a8738 @imgid="0000c8f6", @score=65.459684, @width=150, @height=113>, #<Iqdb::Responses::Response_200:0x0055ab193a84b8 @imgid="0001468e", @score=65.305331, @width=150, @height=149>, #<Iqdb::Responses::Response_000:0x0055ab193a8288>]>
irb(main):013:0>
r888888888 2017-10-9
13

你应该把这些亚马逊的秘密从你的评论中抹去。

如果是这样的话, 下一步就是调试这一过程。

bundle exec ruby web/iqdbs.rb
curl -D - http://localhost:4500

原文:

You should scrub those Amazon secrets from your comment.

If that works the next step is debugging the Sinatra process.

bundle exec ruby web/iqdbs.rb
curl -D - http://localhost:4500

Iratu 2017-10-9
14

是的, 我注意到他们, 当我张贴, 他们在那里不到2分钟。

danbooru@iqdbs:/var/www/iqdbs/current$ bundle exec ruby web/iqdbs.rb
[2017-08-16 20:17:40] INFO  WEBrick 1.3.1
[2017-08-16 20:17:40] INFO  ruby 2.3.1 (2016-04-26) [x86_64-linux]
== Sinatra (v1.4.7) has taken the stage on 4567 for development with backup from WEBrick
[2017-08-16 20:17:40] INFO  WEBrick::HTTPServer#start: pid=21301 port=4567
::1 - - [16/Aug/2017:20:17:54 +0000] "GET / HTTP/1.1" 302 - 0.0033
::1 - - [16/Aug/2017:20:17:54 UTC] "GET / HTTP/1.1" 302 0
danbooru@iqdbs:~$ curl -D - localhost:4500
curl: (7) Failed to connect to localhost port 4500: Connection refused
danbooru@iqdbs:~$ curl -D - localhost:4567
HTTP/1.1 302 Found
Content-Type: text/html;charset=utf-8
Location: http://localhost:4567/index.html
Content-Length: 0
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Server: WEBrick/1.3.1 (Ruby/2.3.1/2016-04-26)
Date: Wed, 16 Aug 2017 20:18:10 GMT
Connection: Keep-Alive
原文:

Yeah I noticed them when I posted it, they were there for less then 2 minutes.

danbooru@iqdbs:/var/www/iqdbs/current$ bundle exec ruby web/iqdbs.rb
[2017-08-16 20:17:40] INFO  WEBrick 1.3.1
[2017-08-16 20:17:40] INFO  ruby 2.3.1 (2016-04-26) [x86_64-linux]
== Sinatra (v1.4.7) has taken the stage on 4567 for development with backup from WEBrick
[2017-08-16 20:17:40] INFO  WEBrick::HTTPServer#start: pid=21301 port=4567
::1 - - [16/Aug/2017:20:17:54 +0000] "GET / HTTP/1.1" 302 - 0.0033
::1 - - [16/Aug/2017:20:17:54 UTC] "GET / HTTP/1.1" 302 0
danbooru@iqdbs:~$ curl -D - localhost:4500
curl: (7) Failed to connect to localhost port 4500: Connection refused
danbooru@iqdbs:~$ curl -D - localhost:4567
HTTP/1.1 302 Found
Content-Type: text/html;charset=utf-8
Location: http://localhost:4567/index.html
Content-Length: 0
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Server: WEBrick/1.3.1 (Ruby/2.3.1/2016-04-26)
Date: Wed, 16 Aug 2017 20:18:10 GMT
Connection: Keep-Alive
r888888888 2017-10-9
15

下一个步骤是测试麒麟工艺。假设这管用, 问题就在 nginx。

原文:

Well the next step is testing the unicorn process. Assuming that works, the problem is in nginx.

Iratu 2017-10-9
16

Nginx 似乎是工作精细, 我认为;

http://iqdbs.atfbooru.ninja/index.html

server {
  listen 80;
  listen 443 ssl;
  server_name iqdbs.atfbooru.ninja;


  if ($http_user_agent ~ WordPress) { return 444; }
  ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
  ssl_prefer_server_ciphers on;
  #ssl_dhparam /var/www/dhparams.pem;

  ssl_certificate /etc/letsencrypt/live/iqdbs.atfbooru.ninja/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/iqdbs.atfbooru.ninja/privkey.pem;


  root /var/www/iqdbs/current/web/public;
  index index.html;
  access_log /var/log/iqdbs/access.log;
  error_log /var/log/iqdbs/error.log;
  client_max_body_size 1024m;


  location @app_server {
    proxy_pass http://app_server;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_redirect off;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Forwarded-Proto http;
  }

  location / {
    try_files $uri @app_server;
  }
  error_page 404 /404.html;
  error_page 500 502 503 504 /500.html;
  error_page  497 https://$host$request_uri;
}

upstream app_server {
  server unix:/tmp/.unicorniqdbs.sock;
}
原文:

Nginx seems to be working fine I think;

http://iqdbs.atfbooru.ninja/index.html

server {
  listen 80;
  listen 443 ssl;
  server_name iqdbs.atfbooru.ninja;


  if ($http_user_agent ~ WordPress) { return 444; }
  ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
  ssl_prefer_server_ciphers on;
  #ssl_dhparam /var/www/dhparams.pem;

  ssl_certificate /etc/letsencrypt/live/iqdbs.atfbooru.ninja/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/iqdbs.atfbooru.ninja/privkey.pem;


  root /var/www/iqdbs/current/web/public;
  index index.html;
  access_log /var/log/iqdbs/access.log;
  error_log /var/log/iqdbs/error.log;
  client_max_body_size 1024m;


  location @app_server {
    proxy_pass http://app_server;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_redirect off;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Forwarded-Proto http;
  }

  location / {
    try_files $uri @app_server;
  }
  error_page 404 /404.html;
  error_page 500 502 503 504 /500.html;
  error_page  497 https://$host$request_uri;
}

upstream app_server {
  server unix:/tmp/.unicorniqdbs.sock;
}
r888888888 2017-10-9
17

如果你在一个港口运行独角兽, 你可以尝试卷曲的请求, 你粘贴在原来的意见?

原文:

If you're running Unicorn on a port can you try curling that with the GET request you pasted int he original comment?

Iratu 2017-10-9
18

出现相同的错误。

danbooru@iqdbs:/var/www/iqdbs/current$ curl -D - 'localhost:9080/similar?key=ATFBooruSecretKeyCantGuessthisIfIuseWeirdstuffLIEKthis&url=http%3A%2F%2Fatfbooru.ninja%2Fdata%2Fpreview%2Fc85c754f522b7ea3b54676a5d4e1d97d.jpg'
HTTP/1.1 500 Internal Server Error
Date: Wed, 16 Aug 2017 20:54:46 GMT
Connection: close
Content-Type: text/html;charset=utf-8
Content-Length: 30
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN

<h1>Internal Server Error</h1>d

2017-08-16 20:54:46 - NameError - uninitialized constant Iqdb::Server::Net

原文:

Appears to be the same error.

danbooru@iqdbs:/var/www/iqdbs/current$ curl -D - 'localhost:9080/similar?key=ATFBooruSecretKeyCantGuessthisIfIuseWeirdstuffLIEKthis&url=http%3A%2F%2Fatfbooru.ninja%2Fdata%2Fpreview%2Fc85c754f522b7ea3b54676a5d4e1d97d.jpg'
HTTP/1.1 500 Internal Server Error
Date: Wed, 16 Aug 2017 20:54:46 GMT
Connection: close
Content-Type: text/html;charset=utf-8
Content-Length: 30
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN

<h1>Internal Server Error</h1>d

2017-08-16 20:54:46 - NameError - uninitialized constant Iqdb::Server::Net

r888888888 2017-10-9
19

我想你可以尝试将 require 'net/http' 添加到 web/iqdbs. rb 和重启你的麒麟工艺。

原文:

I guess what you can try is adding require 'net/http' to web/iqdbs.rb and restart your unicorn processes.

Iratu 2017-10-9
20

这样做, 现在它的工作方式应该。

原文:

That did it, now it works like it should.

r888888888 2017-10-9
21

我在 456b625中推了一个修复程序

原文:

I pushed a fix in 456b625

返回
发表文章
Iratu
文章数
1
评论数
9
注册排名
60721