imathis / octopress

Octopress is an obsessively designed framework for Jekyll blogging. It’s easy to configure and easy to deploy. Sweet huh?
http://github.com/imathis/octopress
9.31k stars 2.62k forks source link

syntax highlight error ('rake generate' error) #350

Closed ghost closed 12 years ago

ghost commented 12 years ago

I encountered an issue similar to https://github.com/imathis/octopress/issues/251 under Archlinux X86-64. Archlinux does not have a lib64. It has /usr/lib and /usr/lib32...Also, The default python interpreter is python3, so I added RubyPython.configure :python_exe => 'python2.7' in pygments_code.rb.

I read https://github.com/tmm1/pygments.rb/issues/10. Creating symbol link, as suggested in that issue, cannot resolve my problem , since all libpy* have already under /usr/lib.

I have tried both ruby-1.9.2-head and ruby-1.9.3-head, both produced similar error message.

My _config.yml (Basically default configuration)

# ----------------------- #
#      Main Configs       #
# ----------------------- #

url: http://capsensitive.github.com
title: Titile
subtitle: A blogging framework for hackers.
author: Author
simple_search: http://google.com/search
description:

# Default date format is "ordinal" (resulting in "July 22nd 2007")
# You can customize the format as defined in
# http://www.ruby-doc.org/core-1.9.2/Time.html#method-i-strftime
# Additionally, %o will give you the ordinal representation of the day
date_format: "ordinal"

# RSS / Email (optional) subscription links (change if using something like Feedburner)
subscribe_rss: /atom.xml
subscribe_email:
# RSS feeds can list your email address if you like
email:

# ----------------------- #
#    Jekyll & Plugins     #
# ----------------------- #

# If publishing to a subdirectory as in http://site.com/project set 'root: /project'
root: /
permalink: /blog/:year/:month/:day/:title/
source: source
destination: public
plugins: plugins
code_dir: downloads/code
category_dir: blog/categories
markdown: rdiscount
pygments: false # default python pygments have been replaced by pygments.rb

paginate: 10          # Posts per page on the blog index
pagination_dir: blog  # Directory base for pagination URLs eg. /blog/page/2/
recent_posts: 5       # Posts in the sidebar Recent Posts section
excerpt_link: "Read on →"  # "Continue reading" link text at the bottom of excerpted articles

titlecase: true       # Converts page and post titles to tilecase

# list each of the sidebar modules you want to include, in the order you want them to appear.
# To add custom asides, create files in /source/_includes/custom/asides/ and add them to the list like 'custom/asides/custom_aside_name.html'
default_asides: [asides/recent_posts.html, asides/github.html, asides/twitter.html, asides/delicious.html, asides/pinboard.html, asides/googleplus.html]

# Each layout uses the default asides, but they can have their own asides instead. Simply uncomment the lines below
# and add an array with the asides you want to use.
# blog_index_asides:
# post_asides:
# page_asides:

Error message (ruby-1.9.3-head)

## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from /home/user/.sync/Dropbox/src/octopress/_config.yml
Building site: source -> public
/home/user/.rvm/gems/ruby-1.9.2-head/gems/ffi-1.0.11/lib/ffi/library.rb:121:in `block in ffi_lib': Could not open library 'lib.so': lib.so: cannot open shared object file: No such file or directory (LoadError)
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/ffi-1.0.11/lib/ffi/library.rb:88:in `map'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/ffi-1.0.11/lib/ffi/library.rb:88:in `ffi_lib'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/rubypython-0.5.3/lib/rubypython/python.rb:29:in `'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/rubypython-0.5.3/lib/rubypython/python.rb:21:in `'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/rubypython-0.5.3/lib/rubypython.rb:261:in `load'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/rubypython-0.5.3/lib/rubypython.rb:261:in `reload_library'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/rubypython-0.5.3/lib/rubypython.rb:104:in `start'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/pygments.rb-0.2.4/lib/pygments/ffi.rb:8:in `start'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/pygments.rb-0.2.4/lib/pygments/ffi.rb:82:in `highlight'
from /home/user/.sync/Dropbox/src/octopress/plugins/pygments_code.rb:27:in `pygments'
from /home/user/.sync/Dropbox/src/octopress/plugins/pygments_code.rb:17:in `highlight'
from /home/user/.sync/Dropbox/src/octopress/plugins/backtick_code_block.rb:37:in `block in render_code_block'
from /home/user/.sync/Dropbox/src/octopress/plugins/backtick_code_block.rb:13:in `gsub'
from /home/user/.sync/Dropbox/src/octopress/plugins/backtick_code_block.rb:13:in `render_code_block'
from /home/user/.sync/Dropbox/src/octopress/plugins/octopress_filters.rb:12:in `pre_filter'
from /home/user/.sync/Dropbox/src/octopress/plugins/octopress_filters.rb:27:in `pre_render'
from /home/user/.sync/Dropbox/src/octopress/plugins/post_filters.rb:112:in `block in pre_render'
from /home/user/.sync/Dropbox/src/octopress/plugins/post_filters.rb:111:in `each'
from /home/user/.sync/Dropbox/src/octopress/plugins/post_filters.rb:111:in `pre_render'
from /home/user/.sync/Dropbox/src/octopress/plugins/post_filters.rb:166:in `do_layout'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/jekyll-0.11.0/lib/jekyll/post.rb:189:in `render'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/jekyll-0.11.0/lib/jekyll/site.rb:193:in `block in render'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/jekyll-0.11.0/lib/jekyll/site.rb:192:in `each'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/jekyll-0.11.0/lib/jekyll/site.rb:192:in `render'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/jekyll-0.11.0/lib/jekyll/site.rb:40:in `process'
from /home/user/.rvm/gems/ruby-1.9.2-head/gems/jekyll-0.11.0/bin/jekyll:250:in `'
from /home/user/.rvm/gems/ruby-1.9.2-head/bin/jekyll:19:in `load'
from /home/user/.rvm/gems/ruby-1.9.2-head/bin/jekyll:19:in `
'

gem infomation (rubypython is 0.5.3)

albino (1.3.3)
blankslate (2.1.2.4)
bundler (1.0.21 ruby)
chunky_png (1.2.5)
classifier (1.3.3)
compass (0.11.6)
directory_watcher (1.4.1)
fast-stemmer (1.0.0)
ffi (1.0.11)
fssm (0.2.7)
haml (3.1.4)
jekyll (0.11.0)
kramdown (0.13.4)
liquid (2.2.2)
maruku (0.6.0)
posix-spawn (0.3.6)
pygments.rb (0.2.4)
rack (1.4.0)
rake (0.9.2.2, 0.9.2)
rb-fsevent (0.4.3.1)
rdiscount (1.6.8)
RedCloth (4.2.9)
rubypants (0.2.0)
rubypython (0.5.3)
sass (3.1.12)
sinatra (1.2.6)
stringex (1.3.0)
syntax (1.0.0)
tilt (1.3.3)
albino (1.3.3)
blankslate (2.1.2.4)
bundler (1.0.21 ruby)
chunky_png (1.2.5)
classifier (1.3.3)
compass (0.11.6)
directory_watcher (1.4.1)
fast-stemmer (1.0.0)
ffi (1.0.11)
fssm (0.2.7)
haml (3.1.4)
jekyll (0.11.0)
kramdown (0.13.4)
liquid (2.2.2)
maruku (0.6.0)
posix-spawn (0.3.6)
pygments.rb (0.2.4)
rack (1.4.0)
rake (0.9.2.2, 0.9.2)
rb-fsevent (0.4.3.1)
rdiscount (1.6.8)
RedCloth (4.2.9)
rubypants (0.2.0)
rubypython (0.5.3)
sass (3.1.12)
sinatra (1.2.6)
stringex (1.3.0)
syntax (1.0.0)
tilt (1.3.3)
warmwaffles commented 12 years ago

I too am receiving this error under ArchLinux x86

warmwaffles commented 12 years ago

Here is the error output for me under ruby 1.9.2

warmwaffles@~/Code/octopress (master): rake generate
## Generating Site with Jekyll
identical source/stylesheets/screen.css 
Configuration from /home/warmwaffles/Code/octopress/_config.yml
Building site: source -> public
  File "<string>", line 1
    import sys; print sys.executable
                        ^
SyntaxError: invalid syntax
sh: - : invalid option
Usage:  sh [GNU long option] [option] ...
    sh [GNU long option] [option] script-file ...
GNU long options:
    --debug
    --debugger
    --dump-po-strings
    --dump-strings
    --help
    --init-file
    --login
    --noediting
    --noprofile
    --norc
    --posix
    --protected
    --rcfile
    --restricted
    --verbose
    --version
Shell options:
    -irsD or -c command or -O shopt_option      (invocation only)
    -abefhkmnptuvxBCHP or -o option
sh: - : invalid option
Usage:  sh [GNU long option] [option] ...
    sh [GNU long option] [option] script-file ...
GNU long options:
    --debug
    --debugger
    --dump-po-strings
    --dump-strings
    --help
    --init-file
    --login
    --noediting
    --noprofile
    --norc
    --posix
    --protected
    --rcfile
    --restricted
    --verbose
    --version
Shell options:
    -irsD or -c command or -O shopt_option      (invocation only)
    -abefhkmnptuvxBCHP or -o option
/home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/ffi-1.0.11/lib/ffi/library.rb:121:in `block in ffi_lib': Could not open library 'lib.so': lib.so: cannot open shared object file: No such file or directory (LoadError)
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/ffi-1.0.11/lib/ffi/library.rb:88:in `map'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/ffi-1.0.11/lib/ffi/library.rb:88:in `ffi_lib'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/rubypython-0.5.3/lib/rubypython/python.rb:29:in `<module:Python>'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/rubypython-0.5.3/lib/rubypython/python.rb:21:in `<top (required)>'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/rubypython-0.5.3/lib/rubypython.rb:261:in `load'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/rubypython-0.5.3/lib/rubypython.rb:261:in `reload_library'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/rubypython-0.5.3/lib/rubypython.rb:104:in `start'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/pygments.rb-0.2.4/lib/pygments/ffi.rb:8:in `start'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/pygments.rb-0.2.4/lib/pygments/ffi.rb:82:in `highlight'
    from /home/warmwaffles/Code/octopress/plugins/pygments_code.rb:24:in `pygments'
    from /home/warmwaffles/Code/octopress/plugins/pygments_code.rb:14:in `highlight'
    from /home/warmwaffles/Code/octopress/plugins/backtick_code_block.rb:37:in `block in render_code_block'
    from /home/warmwaffles/Code/octopress/plugins/backtick_code_block.rb:13:in `gsub'
    from /home/warmwaffles/Code/octopress/plugins/backtick_code_block.rb:13:in `render_code_block'
    from /home/warmwaffles/Code/octopress/plugins/octopress_filters.rb:12:in `pre_filter'
    from /home/warmwaffles/Code/octopress/plugins/octopress_filters.rb:27:in `pre_render'
    from /home/warmwaffles/Code/octopress/plugins/post_filters.rb:112:in `block in pre_render'
    from /home/warmwaffles/Code/octopress/plugins/post_filters.rb:111:in `each'
    from /home/warmwaffles/Code/octopress/plugins/post_filters.rb:111:in `pre_render'
    from /home/warmwaffles/Code/octopress/plugins/post_filters.rb:166:in `do_layout'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/jekyll-0.11.2/lib/jekyll/post.rb:189:in `render'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/jekyll-0.11.2/lib/jekyll/site.rb:193:in `block in render'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/jekyll-0.11.2/lib/jekyll/site.rb:192:in `each'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/jekyll-0.11.2/lib/jekyll/site.rb:192:in `render'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/jekyll-0.11.2/lib/jekyll/site.rb:40:in `process'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/gems/jekyll-0.11.2/bin/jekyll:250:in `<top (required)>'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/bin/jekyll:19:in `load'
    from /home/warmwaffles/.rvm/gems/ruby-1.9.2-p290@octopress/bin/jekyll:19:in `<main>'
jgarber commented 12 years ago

I have a little hack to avoid rubypython and use a remote API at http://pygmentize.herokuapp.com/. Since you're presumably generating your production site and not rendering each page in just-in-time, the latency shouldn't be a problem.

http://jasongarber.com/blog/2012/01/10/deploying-octopress-to-heroku-with-a-custom-buildpack/

warmwaffles commented 12 years ago

@jgarber Thanks, I'll take a look into it. On Ubuntu and Linux Mint, I don't receive this error. It seems to only be secluded to the ArchLinux group.

rolinh commented 12 years ago

@jgarber I tried your solution (I run Archlinux 64-bit) and it did the trick. However, it is still a workaround but thanks a lot, it will do the trick until a proper fix in rubypython.

imathis commented 12 years ago

As this is a rubypython issue, I expect you'll want to post this issue there. I'll close this here since it isn't something I can fix on Octopress.