Hi,
I''m new to Masterview, Ruby and Rails and I''m trying to use
this to
provide a web front end to an Oracle database.
I''m particularly interested in using Nvu to modify the presentational
aspect and this is where I''m having the problem.
I''ve installed the complete stack (ruby 1.8.2 (2004.12.25), rails
1.1.4,
masterview 0.2.4 and tidy version 14 Feb 2006) on my Windows XP box and
I can successfully generate a Masterview version of the web pages.
The problem comes when I try to modify a page in Nvu without Tidy
enabled I get the following when I start the server.
O:\client>ruby script/server
=> Booting WEBrick...
INFO MasterView: MasterView Admin pages enabled
ERROR MasterView: Failure to parse template. Exception=Missing end tag
for ''link'' (got "head")
Line:
Position:
Last 80 unconsumed characters:
<body> <!-- ###### Header ###### --> <div
id="header">
INFO MasterView: Adding hook to allow MasterView to check for templates
that have changed when processing a request
INFO MasterView: Adding hooks to enable Rails to read erb directly from
MasterView
INFO MasterView: MasterView plugin initialized - Version 0.2.4
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2006-08-05 10:36:13] INFO WEBrick 1.3.1
[2006-08-05 10:36:13] INFO ruby 1.8.2 (2004-12-25) [i386-mswin32]
[2006-08-05 10:36:13] INFO WEBrick::HTTPServer#start: pid=3788 port=3000
ERROR MasterView: Failure to parse template. Exception=Missing end tag
for ''link'' (got "head")
Line:
Position:
Last 80 unconsumed characters:
<body> <!-- ###### Header ###### --> <div
id="header">
I assume from this that I need to enable Tidy, but when I do that I get
this :-
O:\client>ruby script/server
=> Booting WEBrick...
INFO MasterView: MasterView Admin pages enabled
o:/ruby/lib/ruby/1.8/dl/import.rb:125:in `symbol'': can''t find
the symbol
`tidyCreate'' (RuntimeError)
from o:/ruby/lib/ruby/1.8/dl/import.rb:144:in `import''
from o:/ruby/lib/ruby/1.8/dl/import.rb:61:in `extern''
from
o:/ruby/lib/ruby/gems/1.8/gems/tidy-1.1.2/lib/tidy/tidylib.rb:17:in
`load''
from o:/ruby/lib/ruby/gems/1.8/gems/tidy-1.1.2/lib/tidy.rb:46:in
`path=''
from
o:/ruby/lib/ruby/gems/1.8/gems/masterview-0.2.4/lib/masterview/filter_helpers.rb:4:in
`tidy''
from
o:/ruby/lib/ruby/gems/1.8/gems/masterview-0.2.4/lib/masterview/io.rb:320:in
`read''
from
o:/ruby/lib/ruby/gems/1.8/gems/masterview-0.2.4/lib/masterview/io.rb:334:in
`read''
from
o:/ruby/lib/ruby/gems/1.8/gems/masterview-0.2.4/lib/masterview/parser.rb:517:in
`parse_mio''
... 37 levels...
from
o:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require__''
from
o:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require''
from
o:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require''
from script/server:3
Tidy works fine from the command line.
Any help would welcome, as I''m really keen to get deeper into this.
Thanks
Robin Kitchin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3202 bytes
Desc: S/MIME Cryptographic Signature
Url :
http://rubyforge.org/pipermail/masterview-users/attachments/20060805/f161afc1/attachment.bin
Jeff Barczewski
2006-Aug-05 14:35 UTC
[Masterview-users] Problems with Masterview and Tidy
Robin,
I believe the problem is missing the tidy gem or not having the tidy
path set properly in the masterview config. So I will outline the
steps for you to check.
And yes, I love using NVU to WYSIWYG pages, but unfortunately it
outputs invalid xhtml, like putting <br> or <link> tags without the
closing /> . Maybe I should look into patching that myself, so we
wouldn''t have these problems. There is a setting in the preferences
that says save xhtml but it doesn''t seem to do anything, arrgggh.
I also wish that I could make it easier for having tidy automatically
installed, I''ll put that as a todo item as well, to see if I can make
that easier or automatic.
Anyway back to the problem. Since NVU makes invalid pages, one can
either run them through tidy manually or have masterview do it when it
is reading the file. The second way is preferred so that you don''t
have to keep doing the extra manual step.
To properly configure masterview to use tidy, check that these steps
have been taken.
1) Install Tidy and verify operation (sounds like you have done this)
2) edit your config/masterview/settings.rb and set the config parameter
config.default_parser_options = { :tidy => true, :escape_erb => true }
or
config.default_parser_options[:tidy] = true # this way simply toggles on tidy
3) also in settings.rb, set the tidy path to point to your tidy library or exe
so uncomment one of these (use first on unix/linux/mac, second on windows) and
be sure to specify the path or in the case of the windows exe make sure that
tidy is in your path, you can add the tidy bin path to your PATH system variable
or copy tidy to somewhere like c:\windows\system32 which is already in the
path. You can verify by pulling up a command prompt, cd to your rails app, and
try typing tidy to see if it finds your path.
It looks like you are on windows from log info, so you would be making sure
tidy is in your path and uncommenting the second line (for windows) like below.
#config.tidy_path = ''/usr/lib/libtidy.so'' # *nix
config.tidy_path = ''tidy.exe'' # Win32 (assumes on system
PATH)
Let me know if this does or doesn''t solve your problems and I can look
further into it. I will also take an action item to look into making
this easier or more automatic and/or fixing NVU :-)
Blessings,
Jeff
On 8/5/06, Robin Kitchin <robin.kitchin at internet.lu>
wrote:> Hi,
>
> I''m new to Masterview, Ruby and Rails and I''m trying to
use this to
> provide a web front end to an Oracle database.
>
> I''m particularly interested in using Nvu to modify the
presentational
> aspect and this is where I''m having the problem.
>
> I''ve installed the complete stack (ruby 1.8.2 (2004.12.25), rails
1.1.4,
> masterview 0.2.4 and tidy version 14 Feb 2006) on my Windows XP box and
> I can successfully generate a Masterview version of the web pages.
>
> The problem comes when I try to modify a page in Nvu without Tidy
> enabled I get the following when I start the server.
>
> O:\client>ruby script/server
> => Booting WEBrick...
> INFO MasterView: MasterView Admin pages enabled
> ERROR MasterView: Failure to parse template. Exception=Missing end tag
> for ''link'' (got "head")
> Line:
> Position:
> Last 80 unconsumed characters:
> <body> <!-- ###### Header ###### -->
<div id="header">
> INFO MasterView: Adding hook to allow MasterView to check for templates
> that have changed when processing a request
> INFO MasterView: Adding hooks to enable Rails to read erb directly from
> MasterView
> INFO MasterView: MasterView plugin initialized - Version 0.2.4
> => Rails application started on http://0.0.0.0:3000
> => Ctrl-C to shutdown server; call with --help for options
> [2006-08-05 10:36:13] INFO WEBrick 1.3.1
> [2006-08-05 10:36:13] INFO ruby 1.8.2 (2004-12-25) [i386-mswin32]
> [2006-08-05 10:36:13] INFO WEBrick::HTTPServer#start: pid=3788 port=3000
> ERROR MasterView: Failure to parse template. Exception=Missing end tag
> for ''link'' (got "head")
> Line:
> Position:
> Last 80 unconsumed characters:
> <body> <!-- ###### Header ###### -->
<div id="header">
>
> I assume from this that I need to enable Tidy, but when I do that I get
> this :-
>
> O:\client>ruby script/server
> => Booting WEBrick...
> INFO MasterView: MasterView Admin pages enabled
> o:/ruby/lib/ruby/1.8/dl/import.rb:125:in `symbol'': can''t
find the symbol
> `tidyCreate'' (RuntimeError)
> from o:/ruby/lib/ruby/1.8/dl/import.rb:144:in `import''
> from o:/ruby/lib/ruby/1.8/dl/import.rb:61:in `extern''
> from
> o:/ruby/lib/ruby/gems/1.8/gems/tidy-1.1.2/lib/tidy/tidylib.rb:17:in
`load''
> from o:/ruby/lib/ruby/gems/1.8/gems/tidy-1.1.2/lib/tidy.rb:46:in
> `path=''
> from
>
o:/ruby/lib/ruby/gems/1.8/gems/masterview-0.2.4/lib/masterview/filter_helpers.rb:4:in
> `tidy''
> from
> o:/ruby/lib/ruby/gems/1.8/gems/masterview-0.2.4/lib/masterview/io.rb:320:in
> `read''
> from
> o:/ruby/lib/ruby/gems/1.8/gems/masterview-0.2.4/lib/masterview/io.rb:334:in
> `read''
> from
>
o:/ruby/lib/ruby/gems/1.8/gems/masterview-0.2.4/lib/masterview/parser.rb:517:in
> `parse_mio''
> ... 37 levels...
> from
> o:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require__''
> from
> o:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require''
> from
>
o:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
> `require''
> from script/server:3
>
> Tidy works fine from the command line.
>
> Any help would welcome, as I''m really keen to get deeper into
this.
>
> Thanks
>
> Robin Kitchin
>
>
> _______________________________________________
> Masterview-users mailing list
> Masterview-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/masterview-users
>
>
>