Ultraviolet gem issues resolved!
Posted by jacqui maher on December 30, 2007 at 01:19 PM
I finally figured out what the problem was with Ultraviolet. If you get this error message:
1 Textpow::ParsingError
2 (Parsing error in ^to \w+: wrong number of arguments (2 for 0)):
It is probably due to incompatibilities among some combination of your oniguruma C library, oniguruma, textpow, and ultraviolet gems, rubygems, and ruby the language itself.
Here’s my setup, running in Ubuntu, that works:
1 jacqui@brighter~ $ ruby -v
2 ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux]
3 jacqui@brighter~ $ gem -v
4 1.0.1
5 jacqui@brighter~ $ gem list # snippet
6 oniguruma (1.1.0)
7 textpow (0.10.0)
8 ultraviolet (0.10.1)
9 jacqui@brighter~ $ onig-config --version
10 5.9.1
I’ll fix the overflow problem (related to code spilling out behind the sidebar) later.
ultraviolet
Posted by jacqui maher on December 28, 2007 at 11:28 PM
No one knows how to fix my ultraviolet/simple highlight issues? Really?
Ugh!
problems getting ultraviolet syntax highlighting working
Posted by jacqui maher on December 24, 2007 at 06:17 PM
I thought some syntax highlighting on the code I post in this blog would be nice. So, when I found the SimpleHighlight plugin for Simplelog I was happy - now I wouldn’t even have to write any CSS for it:)
It’s not that simple, apparently.
I thought I’d post this in the hopes that someone recognizes the error. I’ve googled and poked around in the code and as far as I can tell it’s due to an incompatibility between the gems (namely textpow) and the oniguruma gem/c library.
For what it’s worth, I ended up following along with these instructions in my attempt to get it all working; I still get the same error.
Rails trace (the top few lines at least):
1 Textpow::ParsingError (Parsing error in ^to \w+: wrong number of arguments (2 for 0)): 2 /usr/lib/ruby/gems/1.8/gems/textpow-0.10.0/lib/textpow/syntax.rb:92:in `initialize' 3 /usr/lib/ruby/gems/1.8/gems/textpow-0.10.0/lib/textpow/syntax.rb:86:in `initialize' 4 /usr/lib/ruby/gems/1.8/gems/textpow-0.10.0/lib/textpow/syntax.rb:75:in `load' 5 /usr/lib/ruby/gems/1.8/gems/ultraviolet-0.10.1/lib/uv.rb:23:in `init_syntaxes' 6 /usr/lib/ruby/gems/1.8/gems/ultraviolet-0.10.1/lib/uv.rb:22:in `init_syntaxes' 7 /usr/lib/ruby/gems/1.8/gems/ultraviolet-0.10.1/lib/uv.rb:67:in `parse' 8 /vendor/plugins/simple_highlight/lib/simple_highlight.rb:40:in `create_clean_content' 9 /vendor/plugins/simple_highlight/lib/simple_highlight.rb:22:in `create_clean_content' 10 /app/models/post.rb:247:in `before_validation_on_create' 11 /app/models/post.rb:267:in `before_validation_on_update'
irb after reinstalling everything again:
1 irb(main):011:0> puts Uv.parse( input, "xhtml", "html", true, "slush_poppies") 2 /usr/lib/ruby/gems/1.8/gems/textpow-0.10.0/lib/textpow/syntax.rb:92:in `initialize': Parsing error in ^to \w+: wrong number of arguments (2 for 0) (Textpow::ParsingError) 3 from /usr/lib/ruby/gems/1.8/gems/textpow-0.10.0/lib/textpow/syntax.rb:86:in `initialize' 4 from /usr/lib/ruby/gems/1.8/gems/textpow-0.10.0/lib/textpow/syntax.rb:75:in `load' 5 from /usr/lib/ruby/gems/1.8/gems/ultraviolet-0.10.1/lib/uv.rb:23:in `init_syntaxes' 6 from /usr/lib/ruby/gems/1.8/gems/ultraviolet-0.10.1/lib/uv.rb:22:in `init_syntaxes' 7 from /usr/lib/ruby/gems/1.8/gems/ultraviolet-0.10.1/lib/uv.rb:67:in `parse'