我正试图将一个博客从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>'

最佳答案

这里有一个快速和肮脏的修复,对我有效(不适用,如果你没有根访问,显然),但它将完成这项工作。
以下是您的错误消息供参考:

/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/../\u posts/tumblr/2012-08-28-how-to-add-your-picture-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

仅仅创建这个符号链接就解决了这个问题,但这显然是一个彻底的攻击。

关于ruby - 将Tumblr迁移到octopress(Jekyll)-错误的目录,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12187026/

10-11 07:55