我正在尝试将博客从 Tumblr 迁移到 Octopress。
当我在 octopress 目录中运行时
ruby -rubygems -e 'require "jekyll/migrators/tumblr"; Jekyll::Tumblr.process("http://example.org", format="md")'
它开始运行,但随后提示它所在的文件夹
/usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/convertible.rb:27:in `read': No such file or directory - /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/migrators/../_posts/tumblr/2012-08-28-how-to-add-your-picture-to-google-results.md (Errno::ENOENT)
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/convertible.rb:27:in `read_yaml'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/post.rb:39:in `initialize'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:124:in `new'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:124:in `block in rewrite_urls_and_redirects'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:119:in `map'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:119:in `rewrite_urls_and_redirects'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:30:in `process'
from -e:1:in `<main>'
最佳答案
这是一个对我有用的快速而肮脏的修复(显然,如果您没有 root 访问权限,则不适用),但它可以完成工作。
以下是您的错误消息供引用:
/usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/convertible.rb:27:in `read': \
No such file or directory - \
/usr/lib/ruby/gems/1.9.1/gems/jekyll0.11.2/lib/jekyll/migrators/../_posts/tumblr/2012-08-28-how-to-add-your-picture-to-google-results.md (Errno::ENOENT)
异常中的完整路径是:
/usr/lib/ruby/gems/1.9.1/gems/jekyll0.11.2/lib/jekyll/migrators/../_posts/tumblr/2012-08-28-如何添加你的图片-to-google-results.md
解决方案如下:
1. cd to /usr/lib/ruby/gems/1.9.1/gems/jekyll0.11.2/lib/jekyll/migrators/
2. cd ..
3. ln -s %{DIRECTORY_WHERE__posts_LIVES}
4. Re-run your migration command
只需创建此符号链接(symbolic link)即可解决问题,但这是一个明显且彻底的黑客攻击。
关于ruby - 将 Tumblr 迁移到 octopress (Jekyll) - 在错误的目录中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12187026/