Skip to content
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

Invalid byte sequence error during rake generate #267

Closed
bbatsov opened this issue Nov 10, 2011 · 8 comments
Closed

Invalid byte sequence error during rake generate #267

bbatsov opened this issue Nov 10, 2011 · 8 comments

Comments

@bbatsov
Copy link

bbatsov commented Nov 10, 2011

I've recently converted my Jekyll blog to Octopress. The process was quite smooth, but then I ran into a very strange problem. When I run rake generate on my home mac - everything works fine. When I run it on my work macbook, however, I get this error:

➜  bbatsov.github.com git:(source) ✗ bundle exec rake generate
## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from /Users/bozhidar/projects/bbatsov.github.com/_config.yml
Building site: source -> public
/Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/convertible.rb:29:in `read_yaml': invalid byte sequence in US-ASCII (ArgumentError)
    from /Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/post.rb:39:in `initialize'
    from /Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:163:in `new'
    from /Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:163:in `block in read_posts'
    from /Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:161:in `each'
    from /Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:161:in `read_posts'
    from /Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:128:in `read_directories'
    from /Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:98:in `read'
    from /Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:38:in `process'
    from /Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/bin/jekyll:250:in `<top (required)>'
    from /Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/bin/jekyll:19:in `load'
    from /Users/bozhidar/.rvm/gems/ruby-1.9.2-p290/bin/jekyll:19:in `<main>'

I've googled a bit and saw that others have experienced the problem as well, but I didn't find a clear solution to the problem. I'm pretty sure that the YAML front matter of my posts is OK - nothing but English in it. And what's most puzzling is that on my two macs my setup is exactly the same (or at least it seems the same to me). Any ideas how should I proceed?

Thanks in advance for your help!

@fhemberger
Copy link
Contributor

Just set your locale in your ~/.profile and make sure it's set to UTF-8, e.g.:

LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8

@bbatsov
Copy link
Author

bbatsov commented Nov 10, 2011

That did it. Thanks!

@bbatsov bbatsov closed this as completed Nov 10, 2011
@franklouwers
Copy link

have the exact same issue at the moment, but setting the LANG and LC variables doesn't seem to help:

/Users/frank/.rvm/gems/ruby-1.9.3-p0/gems/jekyll-0.11.0/lib/jekyll/convertible.rb:29:in `read_yaml': invalid byte sequence in UTF-8 (ArgumentError)

@bbonamin
Copy link

Having the exact same issue, the ~/.profile trick does not work either.

@nvd
Copy link

nvd commented Aug 7, 2012

In my case, setting the LC_CTYPE exclusively, worked:

LC_CTYPE=en_US.UTF-8

*not sure why LC_ALL override doesn't work

@larryzhao
Copy link

Having the same issue now. Tried setting the 3 variables, but none of them worked.

@bbonamin
Copy link

Check if your text files have non-recognized characters, that fixed it for
me.

2012/8/31 Larry Zhao notifications@github.com

Having the same issue now. Tried setting the 3 variables, but none of them
worked.


Reply to this email directly or view it on GitHubhttps://github.com//issues/267#issuecomment-8194883.

@larryzhao
Copy link

@bbonamin Yes, I went down that road yesterday after post that comment and finally found the cause. Thanks. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants