I had my webhost install the syntax gem.> gem list --local|grep syntaxsyntax (1.0.0) Syntax is Ruby library for performing simple syntax highlighting. But when I try to use it I get errors. Using the docs at http://syntax.rubyforge.org/chapter-1.html#s2 I added that block of code to one of my controllers: require ''syntax/convertors/html'' convertor = Syntax::Convertors::HTML.for_syntax "ruby" html = convertor.convert( File.read( "program.rb" ) ) puts html It errors out on the require call: No such file to load -- syntax/convertors/html app/controllers/pastes_controller.rb:1 generated/routing/recognition.rb:4:in `recognize_path'' Makes me think there is some pathign issue. So I tried the full path to the file: require ''/usr/lib/ruby/gems/1.8/gems/syntax-1.0.0/lib/syntax/convertors/html'' But that just generates more errors upstream when the html.rb file tries to require the abstract.rb with require ''syntax/convertors/abstract''. My host is looking into it but doesn''t know what the issue is at the moment. Any ideas? -- Greg Donald Zend Certified Engineer MySQL Core Certification http://destiney.com/
What is ''generated/routing/recognition.rb'' It looks like it might have overridden #require? On 7/13/05, Greg Donald <destiney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I had my webhost install the syntax gem. > > > gem list --local|grep syntax > syntax (1.0.0) > Syntax is Ruby library for performing simple syntax highlighting. > > But when I try to use it I get errors. Using the docs at > http://syntax.rubyforge.org/chapter-1.html#s2 > I added that block of code to one of my controllers: > > > require ''syntax/convertors/html'' > convertor = Syntax::Convertors::HTML.for_syntax "ruby" > html = convertor.convert( File.read( "program.rb" ) ) > puts html > > > It errors out on the require call: > > No such file to load -- syntax/convertors/html > > app/controllers/pastes_controller.rb:1 > generated/routing/recognition.rb:4:in `recognize_path'' > > > Makes me think there is some pathign issue. So I tried the full path > to the file: > > require ''/usr/lib/ruby/gems/1.8/gems/syntax-1.0.0/lib/syntax/convertors/html'' > > But that just generates more errors upstream when the html.rb file > tries to require the abstract.rb with require > ''syntax/convertors/abstract''. > > > My host is looking into it but doesn''t know what the issue is at the > moment. Any ideas? > > > -- > Greg Donald > Zend Certified Engineer > MySQL Core Certification > http://destiney.com/ > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Wednesday 13 July 2005 12:13 pm, Greg Donald wrote:> It errors out on the require call: > > No such file to load -- syntax/convertors/htmlI''m going to ask the obvious ... did you load the rubygems package before using the gem? You need to do one of several things: (1) Explicitly require rubygems (e.g. require ''rubygems'') (2) Explicitly require rubygems in the command line (e.g. ruby -rubygems script.rb) (3) Implicitly require rubygems by setting an environment variable: (e.g. set RUBY_OPT=rubygems) See http://docs.rubygems.org/read/chapter/3#page70 for details. -- -- Jim Weirich jim-Fxty1mrVU9GlFc2d6oM/ew@public.gmane.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
On 7/14/05, Jim Weirich <jim-Fxty1mrVU9GlFc2d6oM/ew@public.gmane.org> wrote:> On Wednesday 13 July 2005 12:13 pm, Greg Donald wrote: > > It errors out on the require call: > > > > No such file to load -- syntax/convertors/html > > I''m going to ask the obvious ... did you load the rubygems package before > using the gem? You need to do one of several things: > > (1) Explicitly require rubygems (e.g. require ''rubygems'') > (2) Explicitly require rubygems in the command line (e.g. ruby -rubygems > script.rb) > (3) Implicitly require rubygems by setting an environment variable: (e.g. set > RUBY_OPT=rubygems)require ''rubygems'' require ''syntax/convertors/html'' produces the same errors. -- Greg Donald Zend Certified Engineer MySQL Core Certification http://destiney.com/
try require ''rubgems'' require_gem ''syntax/convertors/html'' (or maybe it''s just require_gem ''syntax'') -PJ On 7/14/05, Greg Donald <destiney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 7/14/05, Jim Weirich <jim-Fxty1mrVU9GlFc2d6oM/ew@public.gmane.org> wrote: > > On Wednesday 13 July 2005 12:13 pm, Greg Donald wrote: > > > It errors out on the require call: > > > > > > No such file to load -- syntax/convertors/html > > > > I''m going to ask the obvious ... did you load the rubygems package before > > using the gem? You need to do one of several things: > > > > (1) Explicitly require rubygems (e.g. require ''rubygems'') > > (2) Explicitly require rubygems in the command line (e.g. ruby -rubygems > > script.rb) > > (3) Implicitly require rubygems by setting an environment variable: (e.g. set > > RUBY_OPT=rubygems) > > require ''rubygems'' > require ''syntax/convertors/html'' > > produces the same errors. > > > -- > Greg Donald > Zend Certified Engineer > MySQL Core Certification > http://destiney.com/ > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 7/14/05, PJ Hyett <pjhyett-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> try > require ''rubgems'' > require_gem ''syntax/convertors/html'' (or maybe it''s just require_gem ''syntax'')I get a similar error when trying this variation: Could not find RubyGem syntax/convertors/html (> 0.0.0) -- Greg Donald Zend Certified Engineer MySQL Core Certification http://destiney.com/