[racket] Frog/Pygments build error

From: Joe Gibbs Politz (joe at cs.brown.edu)
Date: Sun Oct 20 22:47:50 EDT 2013

Uh, yeah, this was an easy fix once I realized what was going on.
Hopefully at least my silly confusion leads to a Google-able answer
for someone in the future.

$ sudo easy_install --upgrade pygments

Got me the right pygments version.

Thanks, sorry for the bother.


On Sun, Oct 20, 2013 at 8:42 PM, Greg Hendershott
<greghendershott at gmail.com> wrote:
> Yeah, sorry, I was typing a correction when I saw your email come in:
>
> ---
>
> Sorry, scratch that. On the box I used above, I had some stuff
> leftover from Pygments HEAD. Therefore it's confusingly talking about
> 1.5. The Racket lexer was added between Pygments 1.5 and 1.6. You need
> the Pygments 1.6 release.
>
> Instead: On a clean, Ubuntu 12.04 x64 box with no Pygments dev stuff, I get:
>
> $ pygmentize -V
> Pygments version 1.6, (c) 2006-2013 by Georg Brandl.
>
> $ pygmentize -L | grep racket
> * racket, rkt:
>
> How I got that was using
>
> $ sudo easy_install Pygments
>
> just like you did. So if you got an older version, I'm not sure why on
> your particular Linux...?
>
>
> On Sun, Oct 20, 2013 at 8:39 PM, Joe Gibbs Politz <joe at cs.brown.edu> wrote:
>> OK, my version looks like yours, but seems to have less taste in languages:
>>
>> $ pygmentize -V
>> Pygments version 1.5, (c) 2006-2011 by Georg Brandl.
>> $ pygmentize -l racket
>> Error: no lexer for alias 'racket' found
>> $ pygmentize -l a-lexer-that-does-not-exist
>> Error: no lexer for alias 'a-lexer-that-does-not-exist' found
>>
>> On Sun, Oct 20, 2013 at 8:29 PM, Greg Hendershott
>> <greghendershott at gmail.com> wrote:
>>> First let's make sure your Pygments version is new enough to include
>>> the lexer for Racket.
>>>
>>> Can you try the following and let me know what it says, for you?
>>>
>>> $ pygmentize -V
>>> # I get: Pygments version 1.5, (c) 2006-2011 by Georg Brandl.
>>>
>>> $ pygmentize -l racket
>>> (+ 1 0)
>>> C-d
>>> # I get: (+ 1 0) colorized, but depends on your terminal; point is,
>>> it's not an error, unlike...
>>>
>>> $ pygmentize -l a-lexer-that-does-not-exist
>>> # I get: Error: no lexer for alias 'a-lexer-that-does-not-exist' found
>>>
>>>
>>> On Sun, Oct 20, 2013 at 7:53 PM, Joe Gibbs Politz <joe at cs.brown.edu> wrote:
>>>> Trying to get set up with Frog, hit the following:
>>>>
>>>> $ raco pkg install frog
>>>> $ mkdir scratch/frog-test
>>>> $ cd scratch/frog-test
>>>> $ raco frog --init
>>>> Frog 0.7
>>>> Configuration /home/joe/scratch/frog-test/.frogrc not found; using defaults.
>>>> Creating files in /home/joe/scratch/frog-test/:
>>>> /home/joe/scratch/frog-test/.frogrc
>>>> /home/joe/scratch/frog-test/_src/About.md
>>>> /home/joe/scratch/frog-test/_src/page-template.html
>>>> /home/joe/scratch/frog-test/_src/post-template.html
>>>> /home/joe/scratch/frog-test/_src/posts/2012-01-01-a-2012-blog-post.md
>>>> /home/joe/scratch/frog-test/css/
>>>> /home/joe/scratch/frog-test/js/
>>>> /home/joe/scratch/frog-test/img/
>>>> Project ready. Try `raco frog -bp` to build and preview.
>>>>
>>>> All good up to here, then...
>>>>
>>>> $ raco frog -b
>>>> Frog 0.7
>>>> Using configuration /home/joe/scratch/frog-test/.frogrc
>>>> Traceback (most recent call last):
>>>>   File "/home/joe/.racket/5.3.6/pkgs/installed/frog/frog/pipe.py",
>>>> line 44, in <module>
>>>>     lexer = get_lexer_by_name(line, encoding="guess")
>>>>   File "/usr/local/lib/python2.7/dist-packages/Pygments-1.5-py2.7.egg/pygments/lexers/__init__.py",
>>>> line 80, in get_lexer_by_name
>>>>     raise ClassNotFound('no lexer for alias %r found' % _alias)
>>>> pygments.util.ClassNotFound: no lexer for alias 'racket' found
>>>> Done generating files at 19:45
>>>>
>>>>
>>>> Is there some silly thing I've failed to do for setting up Pygments?
>>>> I had previously installed Pygments to use Jekyll for Github pages,
>>>> and I get the same message before and after a fresh
>>>>
>>>> $ sudo easy_install Pygments
>>>>
>>>> It could be my fault or some local install issue, but I figured I'd
>>>> see if anyone has hit this before.
>>>>
>>>> Thanks!
>>>> Joe

Posted on the users mailing list.