我在Ubuntu 15.04 linux机箱上安装Ruby脚本的基础知识有问题。
可以在Github中找到该脚本的存储库。安装指南不是很详细。
我有Ruby 2.2.3p173和gem v2.4.5.1。我克隆了repo并做了一个bundle install
但是在执行脚本时我遇到了错误。
如何正确安装此脚本并能够从任何地方运行它?
错误:
root@box15990:/usr/local/bin/youtube-multiple-dl/bin# ruby youtube-multiple-dl -h
/usr/local/bin/youtube-multiple-dl/db/database.rb:32:in `initialize': No such file or directory @ rb_sysopen - config/database.yml(Errno::ENOENT)
from /usr/local/bin/youtube-multiple-dl/db/database.rb:32:in `open'
from /usr/local/bin/youtube-multiple-dl/db/database.rb:32:in `config'
from /usr/local/bin/youtube-multiple-dl/db/database.rb:26:in `connect'
from youtube-multiple-dl:5:in `<main>'
答案 0 :(得分:1)
运行数据库迁移任务:
$ rake db:migrate
不要从bin目录运行它,而是在项目根目录中运行它:
$ bin/youtube-multiple-dl
示例输出:
➜ youtube-multiple-dl git:(master) bin/youtube-multiple-dl -l
ID | URL | STATUS | INFOS |
(队列中没有任何内容。)
➜ youtube-multiple-dl git:(master) bin/youtube-multiple-dl -s
[Worker(host:TD1000557.local pid:20020)] Starting job worker
I, [2015-11-11T12:04:25.859733 #20020] INFO -- : 2015-11-11T12:04:25-0500: [Worker(host:TD1000557.local pid:20020)] Starting job worker
然后,您可以添加要从同一目录中的新术语窗口下载的视频:
➜ youtube-multiple-dl git:(master) bin/youtube-multiple-dl -a https://www.youtube.com/watch\?v\=FRcb3CC7ayU
您启动它的终端将显示如下内容:
waiting for download to start...
[Worker(host:TD1000557.local pid:20080)] Job YoutubeMultipleDL::Download#call_downloader_without_delay (id=1) FAILED (0 prior attempts) with RuntimeError: download failed
E, [2015-11-11T12:05:55.796843 #20080] ERROR -- : 2015-11-11T12:05:55-0500: [Worker(host:TD1000557.local pid:20080)] Job YoutubeMultipleDL::Download#call_downloader_without_delay (id=1) FAILED (0 prior attempts) with RuntimeError: download failed
不知道为什么它不起作用,youtube-dl
和youtube-multiple-dl
对我来说都是新的。