> So, I appear to really need a config/database.yml file and > there doesn''t seem to be a sample on hand. This sounds like > the place where I ask AM to make good on his unwary promise.You''ll need something like the attached in the config directory :-) If you run ''rake migrate'' it will create the development database. If you want to run the tests run ''rake prepare_test_database'' (and ''rake purge_test_database'' afterwords). Cheers, Assaph -------------- next part -------------- A non-text attachment was scrubbed... Name: database.yml Type: application/octet-stream Size: 151 bytes Desc: not available Url : http://rubyforge.org/pipermail/instiki-users/attachments/20060122/f80b7788/database.obj
At 7:00 PM +1100 1/22/06, Assaph Mehr wrote:> You''ll need something like the attached in the config directory :-)I guessed it was about that simple, but I''ve gotten really tired of having my guesses land me in trouble. So, thanks!> If you run ''rake migrate'' it will create the development database. If > you want to run the tests run ''rake prepare_test_database'' (and ''rake > purge_test_database'' afterwords).I did this, with no errors reported. Then I tried instiki and got: % instiki => Instiki started on http://0.0.0.0:2500 => Ctrl-C to shutdown; call with --help for options [2006-01-22 00:55:36] INFO WEBrick 1.3.1 [2006-01-22 00:55:36] INFO ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0] [2006-01-22 00:55:36] INFO WEBrick::HTTPServer#start: pid=16154 port=2500 Unfortunately, although it responds to http://0.0.0.0:2500/ or http://localhost:2500, the result is a blank screen (and view source also shows up as empty). I tried the instructions in the README: % rm -f db/*.db % rake migrate (in /Local/_Private/Homes/rdm/pkgs/zip/instiki_head/instiki) % instiki => Instiki started on http://0.0.0.0:2500 => Ctrl-C to shutdown; call with --help for options [2006-01-22 00:58:00] INFO WEBrick 1.3.1 [2006-01-22 00:58:00] INFO ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0] [2006-01-22 00:58:00] INFO WEBrick::HTTPServer#start: pid=16196 port=2500 but I still got a blank screen. I tried running a plain "rake" and got a fair number of errors. Is this normal? % rake ... 1) Failure: test_html_diff_preserves_endlines_in_pre(DiffTest) [./test/unit/diff_test.rb:88]: ... 2) Error: test_wiki_word_linking(PageRendererTest): ... 3) Failure: test_revise_changes_references_from_wanted_to_linked_for_new_pages(PageTest) [./test/unit/page_test.rb:107]: ... 4) Failure: test_new_page_linked_from_mother_page(WebTest) [./test/unit/web_test.rb:69]: ... 5) Failure: test_orphaned_pages(WebTest) [./test/unit/web_test.rb:85]: ... 6) Error: test_pages_by_match(WebTest): ... 7) Error: test_pages_by_revision(WebTest): ... 8) Failure: test_references(WebTest) [./test/unit/web_test.rb:24]: ... 114 tests, 720 assertions, 5 failures, 3 errors ... Loaded suite /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake/rake_test_loader Started ... ruby(16448,0xa000ed68) malloc: *** vm_allocate(size=1349320704) failed (error code=3) ruby(16448,0xa000ed68) malloc: *** error: can''t allocate region ruby(16448,0xa000ed68) malloc: *** set a breakpoint in szone_error to debug ruby(16448,0xa000ed68) malloc: *** vm_allocate(size=1069056) failed (error code=3) ruby(16448,0xa000ed68) malloc: *** error: can''t allocate region ruby(16448,0xa000ed68) malloc: *** set a breakpoint in szone_error to debug ruby(16448,0xa000ed68) malloc: *** vm_allocate(size=1069056) failed (error code=3) ruby(16448,0xa000ed68) malloc: *** error: can''t allocate region ruby(16448,0xa000ed68) malloc: *** set a breakpoint in szone_error to debug ruby(16448,0xa000ed68) malloc: *** vm_allocate(size=1069056) failed (error code=3) ruby(16448,0xa000ed68) malloc: *** error: can''t allocate region ruby(16448,0xa000ed68) malloc: *** set a breakpoint in szone_error to debug ruby(16448,0xa000ed68) malloc: *** vm_allocate(size=1069056) failed (error code=3) ruby(16448,0xa000ed68) malloc: *** error: can''t allocate region ruby(16448,0xa000ed68) malloc: *** set a breakpoint in szone_error to debug [FATAL] failed to allocate memory rake aborted! Test failures (See full trace by running task with --trace) Somehow, this doesn''t seem right... -r -- Technical editing and writing, programming, and web development: http://www.cfcl.com/rdm/resume Contact information: rdm at cfcl.com, +1 650-873-7841
> % instiki > => Instiki started on http://0.0.0.0:2500 > => Ctrl-C to shutdown; call with --help for options > [2006-01-22 00:55:36] INFO WEBrick 1.3.1 > [2006-01-22 00:55:36] INFO ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0] > [2006-01-22 00:55:36] INFO WEBrick::HTTPServer#start: pid=16154 port=2500 > > Unfortunately, although it responds to http://0.0.0.0:2500/ or > http://localhost:2500, the result is a blank screen (and view source > also shows up as empty). I tried the instructions in the README:I think that actually starts the production environment, for which you haven''t created the database. Either copy the dev.db to prod.db, or start it with: ruby script\server -e development> but I still got a blank screen. I tried running a plain "rake" and got > a fair number of errors. Is this normal?That''s all the tests failing. It sorta hangs on my Windows box (haven''t tested on *nix yet). The malloc ones which look particularly nasty are probably the cause of that. Sorry, but I haven''t looked in the HEAD for a while. My recommendation may have been inappropriate as it seems it''s been in this state from before Christmas. Cheers, Assaph
At 9:03 PM +1100 1/22/06, Assaph Mehr wrote:> I think that actually starts the production environment, for > which you haven''t created the database. Either copy the dev.db > to prod.db, or start it with: > > ruby script\server -e developmentThat appears to work. At least, I got the "Instiki Setup" screen. I was beginning to wonder if running this under Ruby 1.8.4 was the problem. Incidentally, is that likely to be an issue? If so, can I simply avoid it by saying: /usr/bin/ruby script/server -e development where this specifically starts up the OSX 1.8.2: % ruby -v ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0] % /usr/bin/ruby -v ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]> That''s all the tests failing. ...I gathered that (:-).> My recommendation may have been inappropriate as it > seems it''s been in this state from before Christmas.Could be. As a Ruby Nuby, I''m not really the person who should be trying to work on these problems (though it would certainly be a learning experience). Alexey, can you give us any idea of your plans? -r -- Technical editing and writing, programming, and web development: http://www.cfcl.com/rdm/resume Contact information: rdm at cfcl.com, +1 650-873-7841
Well, I filled in the "Instiki Setup" screen and then, kaboom! Specifically, http://0.0.0.0:2500/create_system displayed:> You have a nil object when you didn''t expect it! > The error occurred while evaluating nil.files_path > > RAILS_ROOT: . > > You have a nil object when you didn''t expect it! > The error occured while evaluating nil.files_path > > RAILS_ROOT: . > Application Trace | Framework Trace | Full Trace > #{RAILS_ROOT}/app/models/wiki_file.rb:49:in `content_path'' > #{RAILS_ROOT}/app/models/web.rb:86:in `create_files_directory'' > #{RAILS_ROOT}/app/models/wiki.rb:13:in `create_web'' > #{RAILS_ROOT}/app/models/wiki.rb:70:in `setup'' > #{RAILS_ROOT}/app/controllers/admin_controller.rb:17:in `create_system'' > > Request > > Parameters: {"web_name"=>"Ontiki", "password_check"=>"xxx", > "web_address"=>"ontiki", "password"=>"xxx"} > > Show session dump > > Response > Headers: {"cookie"=>[], "Content-Type"=>"text/html; charset=UTF-8", > "Cache-Control"=>"no-cache"} > > Application Trace | Framework Trace | Full Trace > #{RAILS_ROOT}/app/models/wiki_file.rb:49:in `content_path'' > #{RAILS_ROOT}/app/models/web.rb:86:in `create_files_directory'' > #{RAILS_ROOT}/app/models/wiki.rb:13:in `create_web'' > #{RAILS_ROOT}/app/models/wiki.rb:70:in `setup'' > #{RAILS_ROOT}/app/controllers/admin_controller.rb:17:in `create_system'' > > Request > > Parameters: {"web_name"=>"Ontiki", "password_check"=>"abc", > "web_address"=>"ontiki", "password"=>"abc"} > > Show session dump > > Response > Headers: {"cookie"=>[], "Content-Type"=>"text/html; charset=UTF-8", > "Cache-Control"=>"no-cache"}So, I decided to try "going with the flow": % rm -f db/*.db % rake migrate % cp db/dev.db db/prod.db % instiki This resulted in:> undefined method `files_path'' for nil:NilClass > > RAILS_ROOT: . > Application Trace | Framework Trace | Full Trace > #{RAILS_ROOT}/app/models/wiki_file.rb:49:in `content_path'' > #{RAILS_ROOT}/app/models/web.rb:86:in `create_files_directory'' > #{RAILS_ROOT}/app/models/wiki.rb:13:in `create_web'' > #{RAILS_ROOT}/app/models/wiki.rb:70:in `setup'' > #{RAILS_ROOT}/app/controllers/admin_controller.rb:17:in `create_system'' > instiki:6 > > Request > > Parameters: {"web_name"=>"Ontiki", "password_check"=>"abc", > "web_address"=>"ontiki", "password"=>"abc"} > > Show session dump > > Response > Headers: {"cookie"=>[], "Content-Type"=>"text/html; charset=UTF-8", > "Cache-Control"=>"no-cache"}So, recalling some noise about 1.8.4 and Rails being incompatible, I edited "instiki" to use /usr/bin/ruby. This allowed me to get to the "Creating Home Page" page! That page seemed to run OK, but I got a long list of nastygrams from the server:> instiki_h > => Instiki started on http://0.0.0.0:2500 > => Ctrl-C to shutdown; call with --help for options > [2006-01-22 15:40:23] INFO WEBrick 1.3.1 > [2006-01-22 15:40:23] INFO ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] > [2006-01-22 15:40:23] INFO WEBrick::HTTPServer#start: pid=27538 port=2500 > 127.0.0.1 - - [22/Jan/2006:15:40:38 PST] > "GET / HTTP/1.1" 302 99 > - -> / > 127.0.0.1 - - [22/Jan/2006:15:40:40 PST]"GET /create_system HTTP/1.1" 200 3620> - -> /create_system > 127.0.0.1 - - [22/Jan/2006:15:41:02 PST] > "POST /create_system HTTP/1.1" 302 105 > http://0.0.0.0:2500/create_system -> /create_system > 127.0.0.1 - - [22/Jan/2006:15:41:04 PST] > "GET /ontiki/new/HomePage HTTP/1.1" 200 3982 > http://0.0.0.0:2500/create_system -> /ontiki/new/HomePage > 127.0.0.1 - - [22/Jan/2006:15:41:22 PST] > "GET /create_system HTTP/1.1" 302 106 > - -> /create_system > 127.0.0.1 - - [22/Jan/2006:15:41:23 PST] > "GET /ontiki/show/HomePage HTTP/1.1" 302 105 > - -> /ontiki/show/HomePage > 127.0.0.1 - - [22/Jan/2006:15:41:24 PST] > "GET /ontiki/new/HomePage HTTP/1.1" 200 3858 > - -> /ontiki/new/HomePage > ./lib/bluecloth_tweaked.rb:85: warning: already initialized constant >Version > ./lib/bluecloth_tweaked.rb:88: warning: already initialized constant >SvnRev > ./lib/bluecloth_tweaked.rb:91: warning: already initialized constant SvnId > ./lib/bluecloth_tweaked.rb:94: warning: already initialized constant >SvnUrl > ./lib/bluecloth_tweaked.rb:100: warning: redefining constant >Struct::RenderState > ./lib/bluecloth_tweaked.rb:100: warning: already initialized constant >RenderStateIs this just more of the same sort of cruft that is causing the tests to yelp? Owell, at least I''m able to fool around... -r -- Technical editing and writing, programming, and web development: http://www.cfcl.com/rdm/resume Contact information: rdm at cfcl.com, +1 650-873-7841
Hi Rich,> So, recalling some noise about 1.8.4 and Rails being incompatible, I > edited "instiki" to use /usr/bin/ruby. This allowed me to get to the > "Creating Home Page" page!Just be aware that you''re running in production mode.> That page seemed to run OK, but I got a long list of nastygrams from > the server:> > "GET /ontiki/new/HomePage HTTP/1.1" 200 3858 > > - -> /ontiki/new/HomePage > > ./lib/bluecloth_tweaked.rb:85: warning: already initialized constant > >Version > > ./lib/bluecloth_tweaked.rb:88: warning: already initialized constant > >SvnRev > > ./lib/bluecloth_tweaked.rb:91: warning: already initialized constant SvnId > > ./lib/bluecloth_tweaked.rb:94: warning: already initialized constant > >SvnUrl > > ./lib/bluecloth_tweaked.rb:100: warning: redefining constant > >Struct::RenderState > > ./lib/bluecloth_tweaked.rb:100: warning: already initialized constant > >RenderState > > Is this just more of the same sort of cruft that is causing the tests to > yelp?Ignorable warnings :-) bluecloth_tweaked is, well, a tweaked version of BlueCloth (Markdown) for Instiki. When you require it it overrides certain perviously defined constants, which makes Ruby complain. HTH, Assaph
At 9:03 PM +1100 1/22/06, Assaph Mehr wrote:> start it with: > ruby script\server -e developmentI''d like to find a way to shoehorn this option into (my copy of) the instiki script, or put it into a setting somewhere, or ... I''m already using my own first line:> #!/usr/bin/ruby > #!/usr/bin/env ruby # disabled; 1.8.4 causes problems! > > # Executable file for a gem > # must be same as ./instiki.rb > > load File.dirname(__FILE__) + ''/script/server''Suggestions? Also, some questions: * Is this (SVN HEAD) version using Rails 1.0? (How would I tell?) * Does Rails have a problem with Ruby 1.8.4? (Certainly, this code does!) -r -- Technical editing and writing, programming, and web development: http://www.cfcl.com/rdm/resume Contact information: rdm at cfcl.com, +1 650-873-7841
> I''d like to find a way to shoehorn this option into > (my copy of) the instiki script, or put it into a > setting somewhereNormally you''d use the RAILS_ENV environment variable, but Instiki doesn''t use it properly. Here''s a patch to fix: --- server.orig 2006-01-23 20:54:09.921875000 +1100 +++ server 2006-01-23 20:55:06.453125000 +1100 @@ -6,7 +6,7 @@ OPTIONS = { :port => 2500, :ip => "0.0.0.0", - :environment => "production", + :environment => ENV["RAILS_ENV"] || "development", :server_root => File.expand_path(File.dirname(__FILE__) + "/../public/"), :server_type => WEBrick::SimpleServer } @@ -25,7 +25,7 @@ "Default: 0.0.0.0") { |OPTIONS[:ip]| } opts.on("-e", "--environment=name", String, "Specifies the environment to run this server under (test/development/production).", - "Default: development") { |OPTIONS[:environment]| } + "Default: #{OPTIONS[:environment]}") { |OPTIONS[:environment]| } opts.on("-d", "--daemon", "Make Instiki run as a Daemon (only works if fork is available -- meaning on *nix)." ) { OPTIONS[:server_type] = WEBrick::Daemon } @@ -38,7 +38,7 @@ opts.parse! end -ENV["RAILS_ENV"] = OPTIONS[:environment] +ENV["RAILS_ENV"] ||= OPTIONS[:environment] require File.dirname(__FILE__) + "/../config/environment" require ''webrick_server'' If you''re on Windows, override the instiki.cmd as well (or delete and run instiki.rb).> * Is this (SVN HEAD) version using Rails 1.0? > (How would I tell?)Look at the CHANGELOG, which says: Upgraded to Rails 0.14.3 (also know as 1.0 RC 4) So I think it should work OK with 1.0. You can also look at http://dev.instiki.org/timeline.> * Does Rails have a problem with Ruby 1.8.4? > (Certainly, this code does!)Not AFAIK. I know it had a problem with the (broken) 1.8.2 on OSX, but I think 1.8.4 is the recommended party line.
At 9:07 PM +1100 1/23/06, Assaph Mehr wrote:>> ... Here''s a patch to fix: ...Thanks!>> * Does Rails have a problem with Ruby 1.8.4? >> (Certainly, this code does!) > > Not AFAIK. I know it had a problem with the (broken) 1.8.2 > on OSX, but I think 1.8.4 is the recommended party line.Well, I definitely found that Instiki crashed and burned when I tried to run it on (my copy of) Ruby 1.8.4. If and when Instiki tests and runs cleanly on 1.8.2, we should revisit this. -r -- Technical editing and writing, programming, and web development: http://www.cfcl.com/rdm/resume Contact information: rdm at cfcl.com, +1 650-873-7841
I received a reasonably authoritative response (:-) to my query on the Ruby-talk list. So, I assume that any issues I had in using the svn HEAD Instiki on Ruby 1.8.4 were the result of (a) configuration problems or (b) oddities in the svn HEAD version of Instiki. Can anyone try the svn HEAD version of Instiki under Ruby 1.8.4 and report back? -r At 10:53 PM -0600 1/23/06, David Heinemeier Hansson wrote:>> I think I recall reading that there were some incompatibilities, >> but that was a while back. What''s the current situation? > > It works! ;)-- Technical editing and writing, programming, and web development: http://www.cfcl.com/rdm/resume Contact information: rdm at cfcl.com, +1 650-873-7841