WordPress 到 Jekyll 脚本抛出错误

发布于 2024-11-01 18:31:14 字数 1999 浏览 0 评论 0原文

我已经为这个问题苦苦挣扎了一天左右,但无法弄清楚发生了什么。我正在尝试运行一个脚本将我的 Wordpress .sql 导入 Jekyll 并将所有内容转换为 Markdown。但每次我运行脚本(在 Mac 和 Ubuntu 上)时都会收到错误。我不知道该怎么办。这是我的终端输出和 gem 列表:

jason@ubuntu:~$ ruby -r './wordpress.rb' -e 'Jekyll::WordPress.process( "#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': LoadError: no such file to load -- mysql (Sequel::AdapterNotFound)
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/adapters/mysql.rb:4
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `k_require'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:249:in `tsk_require'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:72:in `check_requiring_thread'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:69:in `synchronize'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:69:in `check_requiring_thread'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:249:in `tsk_require'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/database/connecting.rb:25:in `adapter_class'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/database/connecting.rb:63:in `connect'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:119:in `connect'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:282:in `adapter_method'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:289:in `mysql'
    from ./wordpress.rb:35:in `process'
    from -e:1
jason@ubuntu:~$ gem list

*** LOCAL GEMS ***

classifier (1.3.3)
directory_watcher (1.4.0)
fast-stemmer (1.0.0)
jekyll (0.10.0)
liquid (2.2.2)
maruku (0.6.0)
sequel (3.22.0)
syntax (1.0.0)

我正在使用 Paul Stamatiou 的改编脚本。提前感谢您的任何建议!

I've been wrestling with this problem for a day or so and cannot figure out what's going on. I'm trying to run a script to import my Wordpress .sql into Jekyll and convert everything to markdown. But every time I run the script (on both Mac and Ubuntu) I'm getting an error. I'm at a loss of what to do. Here's my terminal output and gem list:

jason@ubuntu:~$ ruby -r './wordpress.rb' -e 'Jekyll::WordPress.process( "#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': LoadError: no such file to load -- mysql (Sequel::AdapterNotFound)
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/adapters/mysql.rb:4
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `k_require'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:249:in `tsk_require'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:72:in `check_requiring_thread'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:69:in `synchronize'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:69:in `check_requiring_thread'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:249:in `tsk_require'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/database/connecting.rb:25:in `adapter_class'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/database/connecting.rb:63:in `connect'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:119:in `connect'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:282:in `adapter_method'
    from /var/lib/gems/1.8/gems/sequel-3.22.0/lib/sequel/core.rb:289:in `mysql'
    from ./wordpress.rb:35:in `process'
    from -e:1
jason@ubuntu:~$ gem list

*** LOCAL GEMS ***

classifier (1.3.3)
directory_watcher (1.4.0)
fast-stemmer (1.0.0)
jekyll (0.10.0)
liquid (2.2.2)
maruku (0.6.0)
sequel (3.22.0)
syntax (1.0.0)

I'm using Paul Stamatiou's adapted script. Thanks ahead of time for any suggestions!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愁杀 2024-11-08 18:31:14

如果您关注实际的错误消息:

LoadError: no such file to load -- mysql

很明显您需要安装 mysql gem:

gem install mysql

If you focus on the actual error message:

LoadError: no such file to load -- mysql

It's fairly obvious that you need to install the mysql gem:

gem install mysql
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文