Closed whitlockjc closed 11 years ago
This bug has become such a pain that in my project, I have middleman-syntax disabled by default and only enabled during the build step. So you'll need to activate the middleman-syntax extension to reproduce.
That's a bummer. I've seen crashes from pygments.rb a few times (mostly related to not explicitly specifying a language and letting it try to autodetect). You could try middleman-syntax from master
and the newer pygments.rb, it might work better. Let me know if you figure anything else out.
It seems the problem with pygments.rb seg faulting with a null language was fixed in pygments.rb 0.3.0. I'm new to Ruby development so I'm not sure how to override the dependencies in the middleman-syntax gemspec so that I could even try to see if that fixes it. If it doesn't, we could just default to 'text' when the user doesn't specify a language instead of relying on pygments.rb to intelligently choose the language. Let me know if I can help.
I've also experienced a simliar issue. I'm using the following gemfile
source :rubygems
gem "middleman", "~>3.0.6"
gem "sass-media_query_combiner"
gem "middleman-blog"
# For feed.xml.builder
gem "builder", "~> 3.0.0"
# For code syntax
gem "redcarpet"
gem "middleman-syntax"
gem "pygments.rb", "~>0.2.13"
and this config.rb
###
# Compass
###
# Combine media queries at bottom of document
require 'sass-media_query_combiner'
# Change Compass configuration
compass_config do |config|
config.output_style = :expanded
end
set :css_dir, 'css'
set :js_dir, 'js'
set :images_dir, 'img'
activate :directory_indexes
page "/feed.xml", :layout => false
# Build-specific configuration
configure :build do
# For example, change the Compass output style for deployment
# activate :minify_css
# Minify Javascript on build
# activate :minify_javascript
# Enable cache buster
# activate :cache_buster
# Use relative URLs
activate :relative_assets
# Compress PNGs after build
# First: gem install middleman-smusher
# require "middleman-smusher"
# activate :smusher
# Or use a different image path
# set :http_path, "/Content/images/"
end
# Blog Settings
activate :blog do |blog|
blog.prefix = "blog"
blog.permalink = ":year/:title.html"
# blog.sources = ":year-:month-:day-:title.html"
# blog.taglink = "tags/:tag.html"
# blog.layout = "layout"
# blog.summary_separator = /(READMORE)/
# blog.summary_length = 250
# blog.year_link = ":year.html"
# blog.month_link = ":year/:month.html"
# blog.day_link = ":year/:month/:day.html"
# blog.default_extension = ".md"
blog.tag_template = "tag.html"
blog.calendar_template = "calendar.html"
# blog.paginate = true
# blog.per_page = 10
# blog.page_link = "page/:num"
end
activate :syntax
set :markdown_engine, :redcarpet
set :markdown, :fenced_code_blocks => true, :smartypants => true
I'm running rvm 1.16.17 with ruby 1.9.3p286
and I have the following gems installed:
*** LOCAL GEMS ***
activesupport (3.2.9, 3.2.8)
blankslate (3.1.2)
builder (3.0.4)
bundler (1.2.1)
chunky_png (1.2.6)
coffee-script (2.2.0)
coffee-script-source (1.3.3)
compass (0.12.2)
compass-rgbapng (0.1.1)
execjs (1.4.0)
ffi (1.2.0, 1.1.5, 1.0.11)
fssm (0.2.9)
haml (3.1.7)
hike (1.2.1)
http_router (0.10.2)
i18n (0.6.1)
json (1.7.5)
listen (0.5.3)
localtunnel (0.3)
maruku (0.6.1)
middleman (3.0.6)
middleman-blog (3.1.1)
middleman-core (3.0.6)
middleman-more (3.0.6)
middleman-sprockets (3.0.4)
middleman-syntax (1.0.0)
multi_json (1.3.7)
net-ssh (2.6.1)
net-ssh-gateway (1.1.0)
padrino-core (0.10.7)
padrino-helpers (0.10.7)
posix-spawn (0.3.6)
pygments.rb (0.3.2, 0.2.13)
rack (1.4.1)
rack-protection (1.2.0)
rack-test (0.6.2)
rake (0.9.2.2)
rb-fsevent (0.9.2)
rb-inotify (0.8.8)
redcarpet (2.2.2)
rubygems-bundler (1.1.0)
rubypython (0.5.3)
rvm (1.11.3.5)
sass (3.2.3, 3.2.1)
sass-media_query_combiner (0.0.2)
sheet (0.2.2)
sinatra (1.3.3)
sprockets (2.4.5)
sprockets-sass (0.8.0)
syntax (1.0.0)
thor (0.15.4)
tilt (1.3.3)
tzinfo (0.3.35)
uglifier (1.2.7)
url_mount (0.2.1)
yajl-ruby (1.1.0)
Running middleman server from the root of the project will work properly, UNTIL you hit a blog page or any page that contains code highlighting, at which point the server dies.
It does work when the :activate syntax
is placed into the build options.
Not really sure what's going on, but I'd be happy to supply some more info if you need it.
middleman-syntax 1.0.1 has been released which requires the newer pygments.rb. Should work fine with that.
Worked like a charm. Thanks!
I have a middleman app (https://github.com/whitlockjc/thoughtspark.org) and it will generate my website perfect but if I try to run the local server and access /node/26, the server will crash and I get an error report on OS X. To reproduce:
You'll see that the server sends an empty response and the server dies. Below is my crash report (I'm using RVM and Ruby 1.9.x, 'x' because I tried this with 1.9.2 and 1.9.3). Also, if you disable the syntax extension, everything runs properly. I'm not sure if the issue with middleman-syntax or if it's related to pygments.rb but I figure if I'm running into it, others might as well. Now for the crash report: