2

我正在尝试将博客从 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>'
4

2 回答 2

2

这是一个对我有用的快速而肮脏的修复程序(显然,如果您没有 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-how-to-add-your-picture-to-谷歌结果.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

只需创建此符号链接即可解决问题,但这是一个明显且完全的 hack。

于 2012-12-03T18:22:51.477 回答
0

文件是否/usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/_posts/tumblr/2012-08-28-how-to-add-your-picture-to-google-results.md存在?如果不是,也许您可​​以先将您的帖子移动到该文件夹​​,这只是一种简单的解决方法。

于 2012-11-16T03:59:41.493 回答