New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rake generate error #148

Closed
jfmercer opened this Issue Sep 12, 2011 · 10 comments

Comments

Projects
None yet
4 participants
@jfmercer

jfmercer commented Sep 12, 2011

When I run rake generate I get the following error. I'm using 1.9.2 installed via rvm. This error started as I tried to migrate my old WordPress files with the help of exitwp. Some weird UTF-8 encoding error might be at fault amongst my pile of newly generated markdown files. Maybe it's something else entirely. Any suggestions?

rake generate
## Generating Site with Jekyll
Configuration from /Users/mercer/Dropbox/Octopress/_config.yml
unchanged sass/screen.scss
Building site: source -> public
/Users/mercer/Dropbox/Octopress/plugins/raw.rb:11:in `gsub': invalid byte sequence in UTF-8 (ArgumentError)
    from /Users/mercer/Dropbox/Octopress/plugins/raw.rb:11:in `unwrap'
    from /Users/mercer/Dropbox/Octopress/plugins/octopress_filters.rb:17:in `post_filter'
    from /Users/mercer/Dropbox/Octopress/plugins/octopress_filters.rb:29:in `post_render'
    from /Users/mercer/Dropbox/Octopress/plugins/post_filters.rb:124:in `block in post_render'
    from /Users/mercer/Dropbox/Octopress/plugins/post_filters.rb:123:in `each'
    from /Users/mercer/Dropbox/Octopress/plugins/post_filters.rb:123:in `post_render'
    from /Users/mercer/Dropbox/Octopress/plugins/post_filters.rb:151:in `transform'
    from /Users/mercer/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/convertible.rb:84:in `do_layout'
    from /Users/mercer/Dropbox/Octopress/plugins/post_filters.rb:167:in `do_layout'
    from /Users/mercer/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/post.rb:189:in `render'
    from /Users/mercer/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:193:in `block in render'
    from /Users/mercer/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:192:in `each'
    from /Users/mercer/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:192:in `render'
    from /Users/mercer/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:40:in `process'
    from /Users/mercer/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/bin/jekyll:250:in `<top (required)>'
    from /Users/mercer/.rvm/gems/ruby-1.9.2-p290/bin/jekyll:19:in `load'
    from /Users/mercer/.rvm/gems/ruby-1.9.2-p290/bin/jekyll:19:in `<main>'
@imathis

This comment has been minimized.

Owner

imathis commented Sep 13, 2011

I'm guessing you imported from Wordpress or some other blogging platform. There's an issue with their export not being encoded properly. Another Octopress user had to specifically convert to utf-8 during his import process. Here is a gist of the script he used. Does this look helpful? https://gist.github.com/1133266#file_wp_xml_import.rb (notice line 44)

@imathis

This comment has been minimized.

Owner

imathis commented Sep 13, 2011

I know you're using exitwp, but perhaps there's a way you can tell it to do something similar.

@technogeeky

This comment has been minimized.

technogeeky commented Sep 13, 2011

@jfmercer

I'll take a detailed look if you'll post an example of the original wordpress doc (and the resulting markdown you got).

I doubt it's pandoc, since it's statically type checked.

@jfmercer

This comment has been minimized.

jfmercer commented Sep 13, 2011

@imathis Your suggestion did the trick! I used that script to get the markdown files & exitwp to grab the image links. Btw, that gist failed on Ruby 1.8.7, but with 1.9.2 it worked well.

@technogeeky Thx for the offer, but the problem appears to be solved.

@jfmercer jfmercer closed this Sep 13, 2011

@imathis

This comment has been minimized.

Owner

imathis commented Sep 13, 2011

Excellent. I'm glad you've gotten it sorted. I really want to do a better job of helping folks coming from wordpress. I issued a call here: https://twitter.com/octopress/status/113457746778664960 for help writing a guide for Wordpress switchers. If you're interested in helping out, a simple step by step list of tasks and tools would be a great start.

@jfmercer

This comment has been minimized.

jfmercer commented Sep 13, 2011

Sounds good. I need to complete this project of migrating my blog from
WordPress to Octopress, and then I can do a write-up on my blog & possibly
contribute to the Github documentation if that's warranted. The
documentation as is is excellent, and is a large part of the reason that I
chose Octopress. However, the toughest part so far has been the data
migration from WP to OP.

I'm not a Ruby hacker--or any kind of hacker, for that matter--so I can't
write the perfect script to liberate one's data from MySQL to
Jekyll/markdown. exitwp was a very good start. It's just the encodings--and
only the encodings--that screwed it up.

Ideally, we'd have something that could do the following with zero-config
from the end-user:

  1. Convert text
  2. Convert image, video, & other media links (in short, the Media Library)
  3. Preserve categories, tags, & slugs
  4. Convert pages & page content
  5. Convert comments

--jm

On Mon, Sep 12, 2011 at 9:21 PM, Brandon Mathis <
reply@reply.github.com>wrote:

Excellent. I'm glad you've gotten it sorted. I really want to do a better
job of helping folks coming from wordpress. I issued a call here:
https://twitter.com/octopress/status/113457746778664960 for help writing a
guide for Wordpress switchers. If you're interested in helping out, a simple
step by step list of tasks and tools would be a great start.

Reply to this email directly or view it on GitHub:
#148 (comment)

@imathis

This comment has been minimized.

Owner

imathis commented Sep 13, 2011

I'm thinking that the first step to automation is writing out a reliable set of steps for people to follow. Once that's been tested and improved, we'll be able to figure out which parts can be automated. Thanks for your willingness to help.

@citizen428

This comment has been minimized.

citizen428 commented Sep 24, 2011

I'm fairly impressed by Octopress and considering switching over my blog from WP. I'm not sure when I'll have time for this, but I'll definitely be willing to help with documentation once I get started.

@imathis

This comment has been minimized.

Owner

imathis commented Sep 24, 2011

Very cool @citizen428, Some folks are working on a WP guide right now: https://github.com/zan5hin/octopress/blob/wpmigration/source/docs/migration/index.markdown Once it's up, I'd love help validating and improving it.

@citizen428

This comment has been minimized.

citizen428 commented Sep 25, 2011

In fact I just went ahead and imported my WP content now. I used my own fork of the Ruby script you mentioned above:

https://gist.github.com/1240781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment