From dsusco at gmail.com Wed Jun 3 10:24:01 2009 From: dsusco at gmail.com (David Susco) Date: Wed, 3 Jun 2009 10:24:01 -0400 Subject: deployment Message-ID: <1bd79b4a0906030724p4ff49713gf209a4435138168f@mail.gmail.com> I have a few camping apps I'd like to start automatically if my server ever restarts. There's an init.d file that comes with mongrel_cluster that you can use for rails apps, is there anything out there for camping apps though? With the postamble containing all the configuration for the app, it seems that all the init.d file would have to do is execute the camping file. Has anyone done this/have any pointers? -- Dave From lists at groll.co.za Fri Jun 5 01:54:19 2009 From: lists at groll.co.za (Jonathan Groll) Date: Fri, 5 Jun 2009 07:54:19 +0200 Subject: deployment In-Reply-To: <1bd79b4a0906030724p4ff49713gf209a4435138168f@mail.gmail.com> References: <1bd79b4a0906030724p4ff49713gf209a4435138168f@mail.gmail.com> Message-ID: <20090605055419.GA1543@groll.co.za> Hi David, On Wed, Jun 03, 2009 at 10:24:01AM -0400, David Susco wrote: >I have a few camping apps I'd like to start automatically if my server >ever restarts. There's an init.d file that comes with mongrel_cluster >that you can use for rails apps, is there anything out there for >camping apps though? > >With the postamble containing all the configuration for the app, it >seems that all the init.d file would have to do is execute the camping >file. Has anyone done this/have any pointers? I know this is not exactly what you're asking since your question was mongrel based, but if you were to look at running camping 2.0 with passenger/rack you would get automatic restarts as well as working redirects. Plus you'd be able to also easily deploy rails apps (and even some python apps) with the same setup. Cheers, Jonathan From dsusco at gmail.com Fri Jun 5 09:19:15 2009 From: dsusco at gmail.com (David Susco) Date: Fri, 5 Jun 2009 09:19:15 -0400 Subject: deployment In-Reply-To: <20090605055419.GA1543@groll.co.za> References: <1bd79b4a0906030724p4ff49713gf209a4435138168f@mail.gmail.com> <20090605055419.GA1543@groll.co.za> Message-ID: <1bd79b4a0906050619g5283fei1cd37816ce9c8efa@mail.gmail.com> I haven't looked into Rack in depth, is there a camping/rack/mongrel tutorial out there? Dave On Fri, Jun 5, 2009 at 1:54 AM, Jonathan Groll wrote: > Hi David, > > On Wed, Jun 03, 2009 at 10:24:01AM -0400, David Susco wrote: >> >> I have a few camping apps I'd like to start automatically if my server >> ever restarts. There's an init.d file that comes with mongrel_cluster >> that you can use for rails apps, is there anything out there for >> camping apps though? >> >> With the postamble containing all the configuration for the app, it >> seems that all the init.d file would have to do is execute the camping >> file. Has anyone done this/have any pointers? > > I know this is not exactly what you're asking since your question was > mongrel based, but if you were to look at running camping 2.0 with > passenger/rack you would get automatic restarts as well as working > redirects. Plus you'd be able to also easily deploy rails apps (and > even some python apps) with the same setup. > Cheers, > Jonathan > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -- Dave From deveritt at innotts.co.uk Tue Jun 9 06:35:26 2009 From: deveritt at innotts.co.uk (Dave Everitt) Date: Tue, 9 Jun 2009 11:35:26 +0100 Subject: sqlite3 connection problem Message-ID: <4BF60F34-3581-4699-8BE0-C3B6858D4A0D@innotts.co.uk> Any feedback appreciated on the following. My most recent attempt to identify the issue is a minimal Ruby/SQLite/ActiveRecord script, Pastied here: http://pastie.textmate.org/492514 which brings up the following when run from the command line (an empty database file already exists): $ ./simple_db.rbx [SNIP]/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure': Could not find table 'users' (ActiveRecord::StatementInvalid) from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/ lib/active_support/core_ext/object/misc.rb:39:in `returning' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/ lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/ lib/active_record/connection_adapters/sqlite_adapter.rb:213:in `columns' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/ lib/active_record/base.rb:1276:in `columns' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/ lib/active_record/base.rb:3008:in `attributes_from_column_definition_without_lock' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/ lib/active_record/locking/optimistic.rb:66:in `attributes_from_column_definition' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/ lib/active_record/base.rb:2435:in `initialize' from ./simple_db.rbx:10:in `new' from ./simple_db.rbx:10 The adapted blog example code I want to run for my students as an example is Pastied at: http://pastie.org/492517 so I'd appreciate the identification of any glaring errors (currently Camping 1.5 under plain CGI): The errors in the server log read: [SNIP]/activerecord-2.3.2/lib/active_record/connection_adapters/ abstract_adapter.rb:212:in `log': SQLite3::SQLException: unable to open database file: CREATE TABLE "blogtiny_schema_infos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "version" float) (ActiveRecord::StatementInvalid) from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/connection_adapters/sqlite_adapter.rb:157:in `execute' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/connection_adapters/sqlite_adapter.rb:402:in `catch_schema_changes' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/connection_adapters/sqlite_adapter.rb:157:in `execute' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/connection_adapters/abstract/schema_statements.rb: 114:in `create_table' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/migration.rb:352:in `send' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/migration.rb:352:in `method_missing' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/migration.rb:328:in `say_with_time' from /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/migration.rb:328:in `say_with_time' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/migration.rb:348:in `method_missing' from (eval):71:in `create_schema' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/schema.rb:43:in `instance_eval' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/ active_record/schema.rb:43:in `define' from (eval):70:in `create_schema' from /Users/deveritt/Sites/cgi-bin/camping/blogtiny.rbx:71:in `create' from /Users/deveritt/Sites/cgi-bin/camping/blogtiny.rbx:77 [Thu May 28 12:18:13 2009] [error] [client 127.0.0.1] malformed header from script. Bad header=-- create_table("blogtiny_sche: /Users/ deveritt/Sites/cgi-bin/camping/blogtiny.rbx Note the odd truncation of 'blogtiny_sche' in the final line. And one dumb question: I don't have to 'require sqlite3-ruby', right? Dave From deveritt at innotts.co.uk Tue Jun 9 06:35:41 2009 From: deveritt at innotts.co.uk (Dave Everitt) Date: Tue, 9 Jun 2009 11:35:41 +0100 Subject: Camping tutorials for education? Message-ID: I'm planning to use Camping to teach the basics of frameworks, and encourage new arrivals from web design to take up Ruby instead of (say) defaulting to PHP. To do this, I need a foolproof set of instructions for both the technicians (who have to install on all the studio machines) and the students. To go further, I'd like to get an opinion on the following: 1. SQLIte/ActiveRecord I've had some trouble getting Camping to write to an SQLite database as it should (post 'sqlite3 connection problem' has the details). To prepare instructions, I need to understand exactly why this is happening (in case it happens on a student's machine), so I'll persist and get it solved, somehow. 2. Obtaining the definitive current stable version What's the consensus on the definitive stable version? And where is it? The bleeding edge download from http://gems.judofyr.net/ is at 1.9.316, yet Picnic includes Camping 2.0 (which I thought didn't exist yet), but if I 'gem update' my 1.5 version, Camping remains at 1.5? I hope you can understand the confusion (on behalf of my future students) here. 3. Rack At which version (see [2]) did Camping start depending on Rack (as stated at: http://github.com/why/camping/tree/master)? Just out of interest, is it still possible to run a Camping app without it? 4. Comparing servers Is there any consensus on running Camping with: Apache, Mongrel, fast_cgi, plain old CGI, etc.? Which is the most efficient, future- proof, quickest/easiest to set up, and is there any information that charts the methods and differences? In a production environment, the URLs are obviously an issue here, so some mod_rewrite (or -like) examples would also be good. With all this I also want to lower the entry bar to Camping for new users by attempting some nice, simple documentation just to get people going, which is the thing I've been struggling to do myself. Dave From kprojection at gmail.com Tue Jun 9 08:26:26 2009 From: kprojection at gmail.com (Eric Mill) Date: Tue, 9 Jun 2009 08:26:26 -0400 Subject: sqlite3 connection problem In-Reply-To: <4BF60F34-3581-4699-8BE0-C3B6858D4A0D@innotts.co.uk> References: <4BF60F34-3581-4699-8BE0-C3B6858D4A0D@innotts.co.uk> Message-ID: Are the permissions on the file set right? What happens if you try to access the file with rhe sqlite3 command line tool and run the query yourself? -- Eric On Tue, Jun 9, 2009 at 6:35 AM, Dave Everitt wrote: > Any feedback appreciated on the following. My most recent attempt to > identify the issue is a minimal Ruby/SQLite/ActiveRecord script, Pastied > here: http://pastie.textmate.org/492514 which brings up the following when > run from the command line (an empty database file already exists): > > $ ./simple_db.rbx > [SNIP]/active_record/connection_adapters/sqlite3_adapter.rb:29:in > `table_structure': Could not find table 'users' > (ActiveRecord::StatementInvalid) > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/object/misc.rb:39:in > `returning' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in > `table_structure' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite_adapter.rb:213:in > `columns' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1276:in > `columns' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:3008:in > `attributes_from_column_definition_without_lock' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/locking/optimistic.rb:66:in > `attributes_from_column_definition' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2435:in > `initialize' > ? ? ? ?from ./simple_db.rbx:10:in `new' > ? ? ? ?from ./simple_db.rbx:10 > > The adapted blog example code I want to run for my students as an example is > Pastied at: http://pastie.org/492517 so I'd appreciate the identification of > any glaring errors (currently Camping 1.5 under plain CGI): > > The errors in the server log read: > [SNIP]/activerecord-2.3.2/lib/active_record/connection_adapters/abstract_adapter.rb:212:in > `log': SQLite3::SQLException: unable to open database file: CREATE TABLE > "blogtiny_schema_infos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, > "version" float) ?(ActiveRecord::StatementInvalid) > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite_adapter.rb:157:in > `execute' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite_adapter.rb:402:in > `catch_schema_changes' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite_adapter.rb:157:in > `execute' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:114:in > `create_table' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:352:in > `send' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:352:in > `method_missing' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:328:in > `say_with_time' > ? ? ? ?from /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:328:in > `say_with_time' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:348:in > `method_missing' > ? ? ? ?from (eval):71:in `create_schema' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/schema.rb:43:in > `instance_eval' > ? ? ? ?from > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/schema.rb:43:in > `define' > ? ? ? ?from (eval):70:in `create_schema' > ? ? ? ?from /Users/deveritt/Sites/cgi-bin/camping/blogtiny.rbx:71:in > `create' > ? ? ? ?from /Users/deveritt/Sites/cgi-bin/camping/blogtiny.rbx:77 > [Thu May 28 12:18:13 2009] [error] [client 127.0.0.1] malformed header from > script. Bad header=-- create_table("blogtiny_sche: > /Users/deveritt/Sites/cgi-bin/camping/blogtiny.rbx > > Note the odd truncation of 'blogtiny_sche' in the final line. > > And one dumb question: > I don't have to 'require sqlite3-ruby', right? > > Dave > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > From dsusco at gmail.com Tue Jun 9 09:26:36 2009 From: dsusco at gmail.com (David Susco) Date: Tue, 9 Jun 2009 09:26:36 -0400 Subject: sqlite3 connection problem In-Reply-To: References: <4BF60F34-3581-4699-8BE0-C3B6858D4A0D@innotts.co.uk> Message-ID: <1bd79b4a0906090626v777dcb54rd5e11864ea19b66a@mail.gmail.com> What version of the gem are you using? 1.2.4? I'm assuming you compiled ruby yourself based off of its location, did you compile sqlite as well or get it through your OS package manager? In either case, I've found you'll need the sqlite header files for the gem to work correctly. In your package manager they're probably called sqlite-devel or something like that. Dave On Tue, Jun 9, 2009 at 8:26 AM, Eric Mill wrote: > Are the permissions on the file set right? What happens if you try to > access the file with rhe sqlite3 command line tool and run the query > yourself? > > -- Eric > > On Tue, Jun 9, 2009 at 6:35 AM, Dave Everitt wrote: >> Any feedback appreciated on the following. My most recent attempt to >> identify the issue is a minimal Ruby/SQLite/ActiveRecord script, Pastied >> here: http://pastie.textmate.org/492514 which brings up the following when >> run from the command line (an empty database file already exists): >> >> $ ./simple_db.rbx >> [SNIP]/active_record/connection_adapters/sqlite3_adapter.rb:29:in >> `table_structure': Could not find table 'users' >> (ActiveRecord::StatementInvalid) >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/object/misc.rb:39:in >> `returning' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in >> `table_structure' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite_adapter.rb:213:in >> `columns' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1276:in >> `columns' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:3008:in >> `attributes_from_column_definition_without_lock' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/locking/optimistic.rb:66:in >> `attributes_from_column_definition' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2435:in >> `initialize' >> ? ? ? ?from ./simple_db.rbx:10:in `new' >> ? ? ? ?from ./simple_db.rbx:10 >> >> The adapted blog example code I want to run for my students as an example is >> Pastied at: http://pastie.org/492517 so I'd appreciate the identification of >> any glaring errors (currently Camping 1.5 under plain CGI): >> >> The errors in the server log read: >> [SNIP]/activerecord-2.3.2/lib/active_record/connection_adapters/abstract_adapter.rb:212:in >> `log': SQLite3::SQLException: unable to open database file: CREATE TABLE >> "blogtiny_schema_infos" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, >> "version" float) ?(ActiveRecord::StatementInvalid) >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite_adapter.rb:157:in >> `execute' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite_adapter.rb:402:in >> `catch_schema_changes' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite_adapter.rb:157:in >> `execute' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:114:in >> `create_table' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:352:in >> `send' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:352:in >> `method_missing' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:328:in >> `say_with_time' >> ? ? ? ?from /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:328:in >> `say_with_time' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:348:in >> `method_missing' >> ? ? ? ?from (eval):71:in `create_schema' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/schema.rb:43:in >> `instance_eval' >> ? ? ? ?from >> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/schema.rb:43:in >> `define' >> ? ? ? ?from (eval):70:in `create_schema' >> ? ? ? ?from /Users/deveritt/Sites/cgi-bin/camping/blogtiny.rbx:71:in >> `create' >> ? ? ? ?from /Users/deveritt/Sites/cgi-bin/camping/blogtiny.rbx:77 >> [Thu May 28 12:18:13 2009] [error] [client 127.0.0.1] malformed header from >> script. Bad header=-- create_table("blogtiny_sche: >> /Users/deveritt/Sites/cgi-bin/camping/blogtiny.rbx >> >> Note the odd truncation of 'blogtiny_sche' in the final line. >> >> And one dumb question: >> I don't have to 'require sqlite3-ruby', right? >> >> Dave >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -- Dave From dsusco at gmail.com Tue Jun 9 09:29:22 2009 From: dsusco at gmail.com (David Susco) Date: Tue, 9 Jun 2009 09:29:22 -0400 Subject: Camping tutorials for education? In-Reply-To: References: Message-ID: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> I'd definitely be interested in seeing any work you do with this. Having it up on the wiki would be nice too. I'm still trying to figure out deployment with camping 1.5. I've experimented with 1.9.316 and rack but have yet to get an app to work with that. The same with Picnic. Dave On Tue, Jun 9, 2009 at 6:35 AM, Dave Everitt wrote: > I'm planning to use Camping to teach the basics of frameworks, and encourage > new arrivals from web design to take up Ruby instead of (say) defaulting to > PHP. To do this, I need a foolproof set of instructions for both the > technicians (who have to install on all the studio machines) and the > students. > > To go further, I'd like to get an opinion on the following: > > 1. SQLIte/ActiveRecord > I've had some trouble getting Camping to write to an SQLite database as it > should (post 'sqlite3 connection problem' has the details). To prepare > instructions, I need to understand exactly why this is happening (in case it > happens on a student's machine), so I'll persist and get it solved, somehow. > > 2. Obtaining the definitive current stable version > What's the consensus on the definitive stable version? And where is it? The > bleeding edge download from http://gems.judofyr.net/ is at 1.9.316, yet > Picnic includes Camping 2.0 (which I thought didn't exist yet), but if I > 'gem update' my 1.5 version, Camping remains at 1.5? I hope you can > understand the confusion (on behalf of my future students) here. > > 3. Rack > At which version (see [2]) did Camping start depending on Rack (as stated > at: http://github.com/why/camping/tree/master)? Just out of interest, is it > still possible to run a Camping app without it? > > 4. Comparing servers > Is there any consensus on running Camping with: Apache, Mongrel, fast_cgi, > plain old CGI, etc.? Which is the most efficient, future-proof, > quickest/easiest to set up, and is there any information that charts the > methods and differences? In a production environment, the URLs are obviously > an issue here, so some mod_rewrite (or -like) examples would also be good. > > With all this I also want to lower the entry bar to Camping for new users by > attempting some nice, simple documentation just to get people going, which > is the thing I've been struggling to do myself. > > Dave > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -- Dave From lists at groll.co.za Tue Jun 9 11:28:09 2009 From: lists at groll.co.za (Jonathan Groll) Date: Tue, 9 Jun 2009 17:28:09 +0200 Subject: Camping tutorials for education? In-Reply-To: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> References: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> Message-ID: <20090609152809.GD5278@groll.co.za> Hi David, On Tue, Jun 09, 2009 at 09:29:22AM -0400, David Susco wrote: >I'd definitely be interested in seeing any work you do with this. >Having it up on the wiki would be nice too. > >I'm still trying to figure out deployment with camping 1.5. I've >experimented with 1.9.316 and rack but have yet to get an app to work >with that. The same with Picnic. Been meaning to write a quick overview of how I did it for you (as documentation is super sparse still). Briefly: (1) Read the passenger user guide at: http://www.modrails.com/documentation/Users%20guide.html I installed passenger from a gem but see the user's guide if you need to install on debian using apt (it is in the Ubuntu repositories already). Similarly rack is from a gem, and I use the same version of camping as you (from Judofyr's gem server). (2) Try and get the "hello world" from the passenger user guide to work for you. (3) Then try and get the blog example working that is shipped with camping. Here is a config.ru that works for that: require 'rubygems' require 'rack' require 'camping' require 'blog' Blog::Models::Base.establish_connection :adapter => "sqlite3", :database => "/home/jonathan/.camping.db" run Blog Change the database path to one you have on your system. You may need something like: Blog::Models.create_schema :assume => (Blog::Models::Post.table_exists? ? 1.0 : 0.0) before "run blog" if your sqlite database doesn't yet have the schema for the blog example. (4) And the apache config that I used was something like: Options ExecCGI FollowSymLinks AllowOverride all Allow from all ServerName www.rackexample.com DocumentRoot /var/www/blog/public You may need to edit your hosts file so that www.rackexample.com resolves to your apache server. (5) Let us know how it goes... Regards, Jonathan From deveritt at innotts.co.uk Tue Jun 9 11:37:40 2009 From: deveritt at innotts.co.uk (Dave Everitt) Date: Tue, 9 Jun 2009 16:37:40 +0100 Subject: sqlite3 connection problem In-Reply-To: References: <4BF60F34-3581-4699-8BE0-C3B6858D4A0D@innotts.co.uk> Message-ID: Increasing permissions (currently 755) makes no difference. I can use the DB fine from the sqlite3 cl tool - Dave > On 9 Jun 2009, at 13:26, Eric Mill wrote: > >> > Are the permissions on the file set right? What happens if you try > to access the file with rhe sqlite3 command line tool and run the > query yourself? From deveritt at innotts.co.uk Tue Jun 9 11:47:36 2009 From: deveritt at innotts.co.uk (Dave Everitt) Date: Tue, 9 Jun 2009 16:47:36 +0100 Subject: sqlite3 connection problem In-Reply-To: <1bd79b4a0906090626v777dcb54rd5e11864ea19b66a@mail.gmail.com> References: <4BF60F34-3581-4699-8BE0-C3B6858D4A0D@innotts.co.uk> <1bd79b4a0906090626v777dcb54rd5e11864ea19b66a@mail.gmail.com> Message-ID: <044CC785-72B7-4C6B-A1FD-37DF1F312D38@innotts.co.uk> Dave - to answer: 1. sqlite3-ruby (1.2.4), 2. I installed an updated Ruby (1.8.6) some time ago (can't recall how!), 3. sqlite3 (3.1.3) is already on OS X 10.4.11, 4. I don't use a package manager (or ports or fink), and know nothing about sqlite header files. I was thinking of installing a newer sqlite3 (keeping the existing), which might do the trick? Although using the OS X version lowers the entry bar, and I'm trying to make this easy for students. Dave > What version of the gem are you using? 1.2.4? > I'm assuming you compiled ruby yourself based off of its location, > did you compile sqlite as well or get it through your OS package > manager? > In either case, I've found you'll need the sqlite header files for > the gem to work correctly. In your package manager they're probably > called sqlite-devel or something like that. From judofyr at gmail.com Tue Jun 9 11:47:54 2009 From: judofyr at gmail.com (Magnus Holm) Date: Tue, 9 Jun 2009 17:47:54 +0200 Subject: Camping tutorials for education? In-Reply-To: References: Message-ID: <391a49da0906090847y5dad2cd0r2a1028da41087e39@mail.gmail.com> 2. Stable version The "current" version is 1.5 and is available from RubyForge. This is however a *really* old release, and there have been plenty of bug fixes in the repo. There's a 1.5.180 from _why's gem server which fixes some of them. The 1.9-version I have at gems.judofyr.net is just a "rake gem" ran from the latest why/camping (once in a while). This should be stable enough. In fact, as soon as I finish this little cleanup of the documentation (and get some more feedback from you guys) I will most probably release it as 2.0. (1.9 is the "preview release" of 2.0) 3. Rack Camping started depending on Rack when the work on 2.0 started. Right now, Camping uses Rack::Utils so it's currently not possible to run Camping without Rack. This should hopefully not cause any problems. 4. Servers At the moment I think the easiest solution is Phusion Passenger, which is an Apache or Nginx modules which can serve any Rack app. 5. Documentation Yes, we really need some documentation! This is actually what's blocking the 2.0 release. I have some suggestions (will try to post these as soon as possible, aka few hours). I'm not very god writing documentation, so if you want to help out we can agree on how to organize it. 6. Picnic While I haven't been to take a proper look at it, I think it's a very cool idea. Keep up the good work :-) //Magnus Holm On Tue, Jun 9, 2009 at 12:35, Dave Everitt wrote: > I'm planning to use Camping to teach the basics of frameworks, and > encourage new arrivals from web design to take up Ruby instead of (say) > defaulting to PHP. To do this, I need a foolproof set of instructions for > both the technicians (who have to install on all the studio machines) and > the students. > > To go further, I'd like to get an opinion on the following: > > 1. SQLIte/ActiveRecord > I've had some trouble getting Camping to write to an SQLite database as it > should (post 'sqlite3 connection problem' has the details). To prepare > instructions, I need to understand exactly why this is happening (in case it > happens on a student's machine), so I'll persist and get it solved, somehow. > > 2. Obtaining the definitive current stable version > What's the consensus on the definitive stable version? And where is it? The > bleeding edge download from http://gems.judofyr.net/ is at 1.9.316, yet > Picnic includes Camping 2.0 (which I thought didn't exist yet), but if I > 'gem update' my 1.5 version, Camping remains at 1.5? I hope you can > understand the confusion (on behalf of my future students) here. > > 3. Rack > At which version (see [2]) did Camping start depending on Rack (as stated > at: http://github.com/why/camping/tree/master)? Just out of interest, is > it still possible to run a Camping app without it? > > 4. Comparing servers > Is there any consensus on running Camping with: Apache, Mongrel, fast_cgi, > plain old CGI, etc.? Which is the most efficient, future-proof, > quickest/easiest to set up, and is there any information that charts the > methods and differences? In a production environment, the URLs are obviously > an issue here, so some mod_rewrite (or -like) examples would also be good. > > With all this I also want to lower the entry bar to Camping for new users > by attempting some nice, simple documentation just to get people going, > which is the thing I've been struggling to do myself. > > Dave > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From deveritt at innotts.co.uk Tue Jun 9 11:57:58 2009 From: deveritt at innotts.co.uk (Dave Everitt) Date: Tue, 9 Jun 2009 16:57:58 +0100 Subject: Camping tutorials for education? In-Reply-To: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> References: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> Message-ID: <5FA1F799-A455-4CD7-89A0-B3D8362EC98D@innotts.co.uk> sounds like a work in progress, then... I'll stick with 1.5 until there's a definitive stable higher number (opinions?). Just need to solve the sqlite3 issue. Anyone know what setup the 'cheat' Camping app uses (which I like, contribute to and use): http://cheat.errtheblog.com ? Working live examples are a good start. I still need some specific answers to the original points so I can make up a working setup just for beginners to get going, so any precise feedback there would be welcome - no hurry. My short-term aim is just(!) to get the blog example working in Camping 1.5 with sqlite3 on OS X with Ruby 1.8.6, as a CGI. The bottom line is, I love the whole concept of Camping, and want to help people new to web development (often from a design background, and in my case, students) start using it. > I'd definitely be interested in seeing any work you do with this. > Having it up on the wiki would be nice too. > > I'm still trying to figure out deployment with camping 1.5. I've > experimented with 1.9.316 and rack but have yet to get an app to > work with that. The same with Picnic. From judofyr at gmail.com Tue Jun 9 12:02:41 2009 From: judofyr at gmail.com (Magnus Holm) Date: Tue, 9 Jun 2009 18:02:41 +0200 Subject: The D-word Message-ID: <391a49da0906090902t517b437y1376c2fd8f59fdba@mail.gmail.com> Oh, yes. Let's (once again) try to clean the documentation up a bit :-) I have no facts behind me, but I assume there would be two kinds of people who would like to browse camping.rubyforge.org: 1. Beginners who want to know what it's all about, how to get started and how to get help. 2. Campers who don't quite remember which method to use, or where the mailing-list was located, or how you did X etc. So here's a little proposal: What if we split the documentation into three parts? - README.txt should be the first you see and should contain basic info and links. - API-reference. A one-page reference to the whole Camping API which gives you short descriptions/explanations and might also give a link to the book (see below) for more detailed thoughts. - A "book" or tutorial which guides the user from A-Z, starting with installation and how to use The Camping Server, through basic MVC and HTTP/REST to how to use service-overrides or middlewares. It would be really nice if this could be a clean, short and concise guide to both Ruby and web development. What'd you think? What do you miss most from the current (almost non-existing) documentation? //Magnus Holm -------------- next part -------------- An HTML attachment was scrubbed... URL: From deveritt at innotts.co.uk Tue Jun 9 13:30:08 2009 From: deveritt at innotts.co.uk (Dave Everitt) Date: Tue, 9 Jun 2009 18:30:08 +0100 Subject: The D-word In-Reply-To: <391a49da0906090902t517b437y1376c2fd8f59fdba@mail.gmail.com> References: <391a49da0906090902t517b437y1376c2fd8f59fdba@mail.gmail.com> Message-ID: <0BA931DE-5EFC-4319-AE6D-3ED47A4812B4@innotts.co.uk> I'm quite good at clear an understandable English (and editing the work of others) so would be glad to help make the documentation as usable as possible. I reckon we need two starting examples somewhere (a download link in the README?): 1. 'It worked - you are now Camping!' (without a DB); 2. a foolproof version of the minimal blog. I think you're dead right about the two kinds of users and three parts of documentation. As for the book (WebDev with Ruby, using Camping as an example?), it would be good to follow the spirit of Camping and keep it under... well, not 4k, but you get the point. The Camping philosophy needs to pervade the docs too - there's cultural capital in it, which could become a real attraction. I also suggest putting up the '1-page API' on 'cheat'. I have one slight concern for those on shared hosting: that it's 'not possible to run Camping without Rack'. It might take some thinking about how best to do this without root (or how to ask your provider to add the necessary). Many prospective Campers won't change servers just to try something out. Not necessarily an obstacle, but it needs some thought (a cleaned up pre-rack version? Camping 'classic'?). DaveE > Oh, yes. Let's (once again) try to clean the documentation up a > bit :-) > > I have no facts behind me, but I assume there would be two kinds of > people who would like to browse camping.rubyforge.org: > > 1. Beginners who want to know what it's all about, how to get > started and how to get help. > 2. Campers who don't quite remember which method to use, or where > the mailing-list was located, or how you did X etc. > > So here's a little proposal: What if we split the documentation > into three parts? > > - README.txt should be the first you see and should contain basic > info and links. > > - API-reference. A one-page reference to the whole Camping API > which gives you short descriptions/explanations and might also give > a link to the book (see below) for more detailed thoughts. > > - A "book" or tutorial which guides the user from A-Z, starting > with installation and how to use The Camping Server, through basic > MVC and HTTP/REST to how to use service-overrides or middlewares. > It would be really nice if this could be a clean, short and concise > guide to both Ruby and web development. > > What'd you think? What do you miss most from the current (almost > non-existing) documentation? From judofyr at gmail.com Tue Jun 9 17:56:40 2009 From: judofyr at gmail.com (Magnus Holm) Date: Tue, 9 Jun 2009 23:56:40 +0200 Subject: The D-word In-Reply-To: <0BA931DE-5EFC-4319-AE6D-3ED47A4812B4@innotts.co.uk> References: <391a49da0906090902t517b437y1376c2fd8f59fdba@mail.gmail.com> <0BA931DE-5EFC-4319-AE6D-3ED47A4812B4@innotts.co.uk> Message-ID: <391a49da0906091456h294ddfe1w720ddfc5d027cd71@mail.gmail.com> Oh, that would be very nice! Right now there is an example at camping.rubyforge.org showing a blog skeleton (with controllers, models and views). It might be better to rather have a tiny, fully functional one (to get the feel of Camping), and a link to blog.rb (which should be simplified even more, and actually work). The book could then take it from there and slightly expand into the blog.rb (or maybe even totally different; we should at least end up with something) You know, I remember stumbling on Camping after trying out Rails, and it was a horrible feeling ending up at page 3 of the tutorial (on the old wiki) where a giant "TODO" screamed at me. I think many newcomers would have a look at alternatives to Rails, and it would be great if we could guide them not only through Camping, but also on the way you have to think when you're developing on the web. Without boring them too much. At the same time, there will probably be some Rubyists/webdevs who just want to learn about Camping too. What if we start easy with lots of code and introduce them to Camping, then (if we bother to) more in-depth about the web, HTTP, GET/POST/PUT/DELETE, limitations? You could follow the book right through and will end up with basic understanding of the web, or just skip after the quickstart (and three months later, after you've experimented a bit, you take the trouble to trouble to read the rest). Maybe "book" is the wrong word for this too. A book is so formal and strict. This should be light, simple and something you just can dive right into whenever you want. Let's keep it simple and precise, yet informal! The API as a cheat is a great idea too, let's not forget that :-) When it comes to the dependency on Rack, I'm not that worried. You almost can't do any webdev in Ruby today without meeting on Rack. And you only need to have the Rack-library somewhere where Camping can find it (just download and unzip it to vendor/rack for instance), even though using the gem is preferred. Anyone else want to chime in? (Yes, you do!) I currently have some RDoc templates which renders the book/readme/api. It definitely needs to be cleaned up a lot, but I guess I can push it out at a branch when I get back to my computer. //Magnus Holm On Tue, Jun 9, 2009 at 19:30, Dave Everitt wrote: > I'm quite good at clear an understandable English (and editing the work of > others) so would be glad to help make the documentation as usable as > possible. > > I reckon we need two starting examples somewhere (a download link in the > README?): > > 1. 'It worked - you are now Camping!' (without a DB); > 2. a foolproof version of the minimal blog. > > I think you're dead right about the two kinds of users and three parts of > documentation. As for the book (WebDev with Ruby, using Camping as an > example?), it would be good to follow the spirit of Camping and keep it > under... well, not 4k, but you get the point. The Camping philosophy needs > to pervade the docs too - there's cultural capital in it, which could become > a real attraction. > > I also suggest putting up the '1-page API' on 'cheat'. > > I have one slight concern for those on shared hosting: that it's 'not > possible to run Camping without Rack'. It might take some thinking about how > best to do this without root (or how to ask your provider to add the > necessary). Many prospective Campers won't change servers just to try > something out. Not necessarily an obstacle, but it needs some thought (a > cleaned up pre-rack version? Camping 'classic'?). > > DaveE > > > Oh, yes. Let's (once again) try to clean the documentation up a bit :-) >> >> I have no facts behind me, but I assume there would be two kinds of people >> who would like to browse camping.rubyforge.org: >> >> 1. Beginners who want to know what it's all about, how to get started and >> how to get help. >> 2. Campers who don't quite remember which method to use, or where the >> mailing-list was located, or how you did X etc. >> >> So here's a little proposal: What if we split the documentation into three >> parts? >> >> - README.txt should be the first you see and should contain basic info and >> links. >> >> - API-reference. A one-page reference to the whole Camping API which gives >> you short descriptions/explanations and might also give a link to the book >> (see below) for more detailed thoughts. >> >> - A "book" or tutorial which guides the user from A-Z, starting with >> installation and how to use The Camping Server, through basic MVC and >> HTTP/REST to how to use service-overrides or middlewares. It would be really >> nice if this could be a clean, short and concise guide to both Ruby and web >> development. >> >> What'd you think? What do you miss most from the current (almost >> non-existing) documentation? >> > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsusco at gmail.com Wed Jun 10 10:39:28 2009 From: dsusco at gmail.com (David Susco) Date: Wed, 10 Jun 2009 10:39:28 -0400 Subject: Camping tutorials for education? In-Reply-To: <20090609152809.GD5278@groll.co.za> References: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> <20090609152809.GD5278@groll.co.za> Message-ID: <1bd79b4a0906100739o7774f46t47a8b12b0931873d@mail.gmail.com> I'm trying to get passenger working presently, once I do I'll let you know how the rest of it goes. When I try to load the module in the apache conf I get the following error: Cannot load /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so into server: /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so: failed to map segment from shared object: Permission denied I'm assuming it's an SELinux problem, has anyone run into it before? I've done the following already, so it hasn't helped: http://www.modrails.com/documentation/Users%20guide.html#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it Dave On Tue, Jun 9, 2009 at 11:28 AM, Jonathan Groll wrote: > Hi David, > > On Tue, Jun 09, 2009 at 09:29:22AM -0400, David Susco wrote: >> >> I'd definitely be interested in seeing any work you do with this. >> Having it up on the wiki would be nice too. >> >> I'm still trying to figure out deployment with camping 1.5. I've >> experimented with 1.9.316 and rack but have yet to get an app to work >> with that. The same with Picnic. > > Been meaning to write a quick overview of how I did it for you (as > documentation is super sparse still). Briefly: > > (1) Read the passenger user guide at: > http://www.modrails.com/documentation/Users%20guide.html > > I installed passenger from a gem but see the user's guide if you need > to install on debian using apt (it is in the Ubuntu repositories already). > Similarly rack is from a gem, and I use the same version of camping as > you (from Judofyr's gem server). > > (2) Try and get the "hello world" from the passenger user guide to > work for you. > > (3) Then try and get the blog example working that is shipped with > camping. Here is a config.ru that works for that: > > require 'rubygems' > require 'rack' > require 'camping' > require 'blog' > Blog::Models::Base.establish_connection :adapter => "sqlite3", > :database => "/home/jonathan/.camping.db" > run Blog > > Change the database path to one you have on your system. You may need > something like: > Blog::Models.create_schema :assume => (Blog::Models::Post.table_exists? ? > 1.0 : 0.0) > > before "run blog" if your sqlite database doesn't yet have the schema > for the blog example. > > (4) And the apache config that I used was something like: > > > ? ? ? ? ? ? ?Options ExecCGI FollowSymLinks > ? ? ? ? ? ? ? ? AllowOverride all > ? ? ? ? ? ? ? ? ? ?Allow from all > > > ? ?ServerName www.rackexample.com > ? ?DocumentRoot /var/www/blog/public > > > You may need to edit your hosts file so that www.rackexample.com > resolves to your apache server. > > (5) Let us know how it goes... > > Regards, > Jonathan > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -- Dave From dsusco at gmail.com Wed Jun 10 16:30:42 2009 From: dsusco at gmail.com (David Susco) Date: Wed, 10 Jun 2009 16:30:42 -0400 Subject: Camping tutorials for education? In-Reply-To: <1bd79b4a0906100739o7774f46t47a8b12b0931873d@mail.gmail.com> References: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> <20090609152809.GD5278@groll.co.za> <1bd79b4a0906100739o7774f46t47a8b12b0931873d@mail.gmail.com> Message-ID: <1bd79b4a0906101330v10826f0v99fb46b90ee22282@mail.gmail.com> I've disabled SELinux to see if I could get any farther. I managed to get passenger installed and working, however a fancy passenger generated page is telling me the app couldn't be started due to this error: `require': /usr/local/lib/ruby/gems/1.9.1/gems/camping-1.9.316/lib/camping.rb:11: syntax error, unexpected tLABEL (SyntaxError) p[0]==?/?@root+p:p end;def URL c='/',*a;c=R(c,... It's the same thing when I try to rackup the .ru file, and the same when I try to execute this little bit of code: #!/usr/bin/env ruby -rubygems gem 'camping', '>=1.9.316' %w(rack camping).each { |lib| require lib } puts 'done' I'm tried reinstalled camping 1.9.316 but that didn't change anything. Any ideas? Dave On Wed, Jun 10, 2009 at 10:39 AM, David Susco wrote: > I'm trying to get passenger working presently, once I do I'll let you > know how the rest of it goes. > > When I try to load the module in the apache conf I get the following error: > > Cannot load /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so > into server: /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so: > failed to map segment from shared object: Permission denied > > I'm assuming it's an SELinux problem, has anyone run into it before? > I've done the following already, so it hasn't helped: > http://www.modrails.com/documentation/Users%20guide.html#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it > > Dave > > > On Tue, Jun 9, 2009 at 11:28 AM, Jonathan Groll wrote: >> Hi David, >> >> On Tue, Jun 09, 2009 at 09:29:22AM -0400, David Susco wrote: >>> >>> I'd definitely be interested in seeing any work you do with this. >>> Having it up on the wiki would be nice too. >>> >>> I'm still trying to figure out deployment with camping 1.5. I've >>> experimented with 1.9.316 and rack but have yet to get an app to work >>> with that. The same with Picnic. >> >> Been meaning to write a quick overview of how I did it for you (as >> documentation is super sparse still). Briefly: >> >> (1) Read the passenger user guide at: >> http://www.modrails.com/documentation/Users%20guide.html >> >> I installed passenger from a gem but see the user's guide if you need >> to install on debian using apt (it is in the Ubuntu repositories already). >> Similarly rack is from a gem, and I use the same version of camping as >> you (from Judofyr's gem server). >> >> (2) Try and get the "hello world" from the passenger user guide to >> work for you. >> >> (3) Then try and get the blog example working that is shipped with >> camping. Here is a config.ru that works for that: >> >> require 'rubygems' >> require 'rack' >> require 'camping' >> require 'blog' >> Blog::Models::Base.establish_connection :adapter => "sqlite3", >> :database => "/home/jonathan/.camping.db" >> run Blog >> >> Change the database path to one you have on your system. You may need >> something like: >> Blog::Models.create_schema :assume => (Blog::Models::Post.table_exists? ? >> 1.0 : 0.0) >> >> before "run blog" if your sqlite database doesn't yet have the schema >> for the blog example. >> >> (4) And the apache config that I used was something like: >> >> >> ? ? ? ? ? ? ?Options ExecCGI FollowSymLinks >> ? ? ? ? ? ? ? ? AllowOverride all >> ? ? ? ? ? ? ? ? ? ?Allow from all >> >> >> ? ?ServerName www.rackexample.com >> ? ?DocumentRoot /var/www/blog/public >> >> >> You may need to edit your hosts file so that www.rackexample.com >> resolves to your apache server. >> >> (5) Let us know how it goes... >> >> Regards, >> Jonathan >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > > > > -- > Dave > -- Dave From his2000x at gmail.com Wed Jun 10 16:34:36 2009 From: his2000x at gmail.com (in-seok hwang) Date: Thu, 11 Jun 2009 05:34:36 +0900 Subject: camping alive? Message-ID: hi ,all i used camping1.5.180, but i thing camping is dead. When camping 2.0 coming? this url(http://camping.rubyforge.org/files/README.html) is no more update? this url(http://github.com/why/camping/tree/master) is main repository? right? why main repository's changelog is stop in ver1.6 This development has been stopped because I of my curiosity. but, i love camping web-framework. Someone please tell me camping is alive. Thank you for reading my artcle. -------------- next part -------------- An HTML attachment was scrubbed... URL: From judofyr at gmail.com Wed Jun 10 17:46:52 2009 From: judofyr at gmail.com (Magnus Holm) Date: Wed, 10 Jun 2009 23:46:52 +0200 Subject: Camping tutorials for education? In-Reply-To: <1bd79b4a0906101330v10826f0v99fb46b90ee22282@mail.gmail.com> References: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> <20090609152809.GD5278@groll.co.za> <1bd79b4a0906100739o7774f46t47a8b12b0931873d@mail.gmail.com> <1bd79b4a0906101330v10826f0v99fb46b90ee22282@mail.gmail.com> Message-ID: <391a49da0906101446r5831905eoc12ba2562df2a1bf@mail.gmail.com> Unfornately, Camping doesn't (yet) work on Ruby 1.9.1. Unless someone else want to try now, I'm going to have a look at it *after* 2.0 is released. //Magnus Holm On Wed, Jun 10, 2009 at 22:30, David Susco wrote: > I've disabled SELinux to see if I could get any farther. > > I managed to get passenger installed and working, however a fancy > passenger generated page is telling me the app couldn't be started due > to this error: > > `require': > /usr/local/lib/ruby/gems/1.9.1/gems/camping-1.9.316/lib/camping.rb:11: > syntax error, unexpected tLABEL (SyntaxError) > p[0]==?/?@root+p:p end;def URL c='/',*a;c=R(c,... > > It's the same thing when I try to rackup the .ru file, and the same > when I try to execute this little bit of code: > > #!/usr/bin/env ruby -rubygems > gem 'camping', '>=1.9.316' > %w(rack camping).each { |lib| require lib } > puts 'done' > > I'm tried reinstalled camping 1.9.316 but that didn't change anything. > Any ideas? > > Dave > > On Wed, Jun 10, 2009 at 10:39 AM, David Susco wrote: > > I'm trying to get passenger working presently, once I do I'll let you > > know how the rest of it goes. > > > > When I try to load the module in the apache conf I get the following > error: > > > > Cannot load > /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so > > into server: > /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so: > > failed to map segment from shared object: Permission denied > > > > I'm assuming it's an SELinux problem, has anyone run into it before? > > I've done the following already, so it hasn't helped: > > > http://www.modrails.com/documentation/Users%20guide.html#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it > > > > Dave > > > > > > On Tue, Jun 9, 2009 at 11:28 AM, Jonathan Groll > wrote: > >> Hi David, > >> > >> On Tue, Jun 09, 2009 at 09:29:22AM -0400, David Susco wrote: > >>> > >>> I'd definitely be interested in seeing any work you do with this. > >>> Having it up on the wiki would be nice too. > >>> > >>> I'm still trying to figure out deployment with camping 1.5. I've > >>> experimented with 1.9.316 and rack but have yet to get an app to work > >>> with that. The same with Picnic. > >> > >> Been meaning to write a quick overview of how I did it for you (as > >> documentation is super sparse still). Briefly: > >> > >> (1) Read the passenger user guide at: > >> http://www.modrails.com/documentation/Users%20guide.html > >> > >> I installed passenger from a gem but see the user's guide if you need > >> to install on debian using apt (it is in the Ubuntu repositories > already). > >> Similarly rack is from a gem, and I use the same version of camping as > >> you (from Judofyr's gem server). > >> > >> (2) Try and get the "hello world" from the passenger user guide to > >> work for you. > >> > >> (3) Then try and get the blog example working that is shipped with > >> camping. Here is a config.ru that works for that: > >> > >> require 'rubygems' > >> require 'rack' > >> require 'camping' > >> require 'blog' > >> Blog::Models::Base.establish_connection :adapter => "sqlite3", > >> :database => "/home/jonathan/.camping.db" > >> run Blog > >> > >> Change the database path to one you have on your system. You may need > >> something like: > >> Blog::Models.create_schema :assume => (Blog::Models::Post.table_exists? > ? > >> 1.0 : 0.0) > >> > >> before "run blog" if your sqlite database doesn't yet have the schema > >> for the blog example. > >> > >> (4) And the apache config that I used was something like: > >> > >> > >> Options ExecCGI FollowSymLinks > >> AllowOverride all > >> Allow from all > >> > >> > >> ServerName www.rackexample.com > >> DocumentRoot /var/www/blog/public > >> > >> > >> You may need to edit your hosts file so that www.rackexample.com > >> resolves to your apache server. > >> > >> (5) Let us know how it goes... > >> > >> Regards, > >> Jonathan > >> _______________________________________________ > >> Camping-list mailing list > >> Camping-list at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/camping-list > >> > > > > > > > > -- > > Dave > > > > > > -- > Dave > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From judofyr at gmail.com Wed Jun 10 17:49:59 2009 From: judofyr at gmail.com (Magnus Holm) Date: Wed, 10 Jun 2009 23:49:59 +0200 Subject: Release? In-Reply-To: <00B45FC2-C99C-4B53-AA29-D7251757313A@gmail.com> References: <62183EB5-485B-4C83-AFF0-B1801C9080D5@gmail.com> <14540CF2-1C18-4F89-ACD5-DDEA9385AD8C@gmail.com> <00B45FC2-C99C-4B53-AA29-D7251757313A@gmail.com> Message-ID: <391a49da0906101449n3da3fca3qe98dc3858761c4a2@mail.gmail.com> Oh, sorry. I totally forgot about this. Are we absolutely sure that 1.5.180 is stable enough to be pushed out to Rubyforge? //Magnus Holm On Tue, Feb 10, 2009 at 19:24, Julik Tarkhanov wrote: > > On Feb 10, 2009, at 8:41 AM, Magnus Holm wrote: > > Yes, we should release 2.0 soon... > > Meanwhile you can always download 2.0 using my repo: > gem install camping --source http://gems.judofyr.net/ > > > I can, but people who might need my apps can't and won't look for > non-official gem servers.Is there a possibility for someone to push the > solidified, old-school 1.5.180 to Rubyforge? > Before 2.0 is released? It's 2 minutes work, seriously... > -- > Julik Tarkhanov > me at julik.nl > > > > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.tarkhanov at gmail.com Wed Jun 10 19:12:10 2009 From: julian.tarkhanov at gmail.com (Julik Tarkhanov) Date: Thu, 11 Jun 2009 01:12:10 +0200 Subject: Release? In-Reply-To: <391a49da0906101449n3da3fca3qe98dc3858761c4a2@mail.gmail.com> References: <62183EB5-485B-4C83-AFF0-B1801C9080D5@gmail.com> <14540CF2-1C18-4F89-ACD5-DDEA9385AD8C@gmail.com> <00B45FC2-C99C-4B53-AA29-D7251757313A@gmail.com> <391a49da0906101449n3da3fca3qe98dc3858761c4a2@mail.gmail.com> Message-ID: On 10 Jun 2009, at 23:49, Magnus Holm wrote: > Oh, sorry. I totally forgot about this. > > Are we absolutely sure that 1.5.180 is stable enough to be pushed > out to Rubyforge? For about a year I think, and if not it can be followed by 1.5.181 right? -- Julik Tarkhanov me at julik.nl From dsusco at gmail.com Wed Jun 10 20:45:09 2009 From: dsusco at gmail.com (David Susco) Date: Wed, 10 Jun 2009 20:45:09 -0400 Subject: Camping tutorials for education? In-Reply-To: <391a49da0906101446r5831905eoc12ba2562df2a1bf@mail.gmail.com> References: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> <20090609152809.GD5278@groll.co.za> <1bd79b4a0906100739o7774f46t47a8b12b0931873d@mail.gmail.com> <1bd79b4a0906101330v10826f0v99fb46b90ee22282@mail.gmail.com> <391a49da0906101446r5831905eoc12ba2562df2a1bf@mail.gmail.com> Message-ID: <1bd79b4a0906101745ua0a0a4ci433befb00b8152a4@mail.gmail.com> OK, good to know. What the latest version I can use? Dave On Wed, Jun 10, 2009 at 5:46 PM, Magnus Holm wrote: > Unfornately,?Camping?doesn't?(yet)?work?on?Ruby?1.9.1.?Unless?someone?else?want?to?try > now,?I'm?going?to?have?a?look?at?it?*after*?2.0?is?released. > > //Magnus Holm > > > On Wed, Jun 10, 2009 at 22:30, David Susco wrote: >> >> I've disabled SELinux to see if I could get any farther. >> >> I managed to get passenger installed and working, however a fancy >> passenger generated page is telling me the app couldn't be started due >> to this error: >> >> `require': >> /usr/local/lib/ruby/gems/1.9.1/gems/camping-1.9.316/lib/camping.rb:11: >> syntax error, unexpected tLABEL (SyntaxError) >> p[0]==?/?@root+p:p end;def URL c='/',*a;c=R(c,... >> >> It's the same thing when I try to rackup the .ru file, and the same >> when I try to execute this little bit of code: >> >> #!/usr/bin/env ruby -rubygems >> gem 'camping', '>=1.9.316' >> %w(rack camping).each { |lib| require lib } >> puts 'done' >> >> I'm tried reinstalled camping 1.9.316 but that didn't change anything. >> Any ideas? >> >> Dave >> >> On Wed, Jun 10, 2009 at 10:39 AM, David Susco wrote: >> > I'm trying to get passenger working presently, once I do I'll let you >> > know how the rest of it goes. >> > >> > When I try to load the module in the apache conf I get the following >> > error: >> > >> > Cannot load >> > /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so >> > into server: >> > /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so: >> > failed to map segment from shared object: Permission denied >> > >> > I'm assuming it's an SELinux problem, has anyone run into it before? >> > I've done the following already, so it hasn't helped: >> > >> > http://www.modrails.com/documentation/Users%20guide.html#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it >> > >> > Dave >> > >> > >> > On Tue, Jun 9, 2009 at 11:28 AM, Jonathan Groll >> > wrote: >> >> Hi David, >> >> >> >> On Tue, Jun 09, 2009 at 09:29:22AM -0400, David Susco wrote: >> >>> >> >>> I'd definitely be interested in seeing any work you do with this. >> >>> Having it up on the wiki would be nice too. >> >>> >> >>> I'm still trying to figure out deployment with camping 1.5. I've >> >>> experimented with 1.9.316 and rack but have yet to get an app to work >> >>> with that. The same with Picnic. >> >> >> >> Been meaning to write a quick overview of how I did it for you (as >> >> documentation is super sparse still). Briefly: >> >> >> >> (1) Read the passenger user guide at: >> >> http://www.modrails.com/documentation/Users%20guide.html >> >> >> >> I installed passenger from a gem but see the user's guide if you need >> >> to install on debian using apt (it is in the Ubuntu repositories >> >> already). >> >> Similarly rack is from a gem, and I use the same version of camping as >> >> you (from Judofyr's gem server). >> >> >> >> (2) Try and get the "hello world" from the passenger user guide to >> >> work for you. >> >> >> >> (3) Then try and get the blog example working that is shipped with >> >> camping. Here is a config.ru that works for that: >> >> >> >> require 'rubygems' >> >> require 'rack' >> >> require 'camping' >> >> require 'blog' >> >> Blog::Models::Base.establish_connection :adapter => "sqlite3", >> >> :database => "/home/jonathan/.camping.db" >> >> run Blog >> >> >> >> Change the database path to one you have on your system. You may need >> >> something like: >> >> Blog::Models.create_schema :assume => (Blog::Models::Post.table_exists? >> >> ? >> >> 1.0 : 0.0) >> >> >> >> before "run blog" if your sqlite database doesn't yet have the schema >> >> for the blog example. >> >> >> >> (4) And the apache config that I used was something like: >> >> >> >> >> >> ? ? ? ? ? ? ?Options ExecCGI FollowSymLinks >> >> ? ? ? ? ? ? ? ? AllowOverride all >> >> ? ? ? ? ? ? ? ? ? ?Allow from all >> >> >> >> >> >> ? ?ServerName www.rackexample.com >> >> ? ?DocumentRoot /var/www/blog/public >> >> >> >> >> >> You may need to edit your hosts file so that www.rackexample.com >> >> resolves to your apache server. >> >> >> >> (5) Let us know how it goes... >> >> >> >> Regards, >> >> Jonathan >> >> _______________________________________________ >> >> Camping-list mailing list >> >> Camping-list at rubyforge.org >> >> http://rubyforge.org/mailman/listinfo/camping-list >> >> >> > >> > >> > >> > -- >> > Dave >> > >> >> >> >> -- >> Dave >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -- Dave From judofyr at gmail.com Thu Jun 11 09:16:29 2009 From: judofyr at gmail.com (Magnus Holm) Date: Thu, 11 Jun 2009 15:16:29 +0200 Subject: Release? In-Reply-To: References: <62183EB5-485B-4C83-AFF0-B1801C9080D5@gmail.com> <14540CF2-1C18-4F89-ACD5-DDEA9385AD8C@gmail.com> <00B45FC2-C99C-4B53-AA29-D7251757313A@gmail.com> <391a49da0906101449n3da3fca3qe98dc3858761c4a2@mail.gmail.com> Message-ID: <391a49da0906110616s58b1aa56j6b6d911f323571a@mail.gmail.com> Totally right :-) It's released now... //Magnus Holm On Thu, Jun 11, 2009 at 01:12, Julik Tarkhanov wrote: > > On 10 Jun 2009, at 23:49, Magnus Holm wrote: > > Oh, sorry. I totally forgot about this. >> >> Are we absolutely sure that 1.5.180 is stable enough to be pushed out to >> Rubyforge? >> > > > For about a year I think, and if not it can be followed by 1.5.181 right? > -- > Julik Tarkhanov > me at julik.nl > > > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.tarkhanov at gmail.com Thu Jun 11 09:55:03 2009 From: julian.tarkhanov at gmail.com (Julik Tarkhanov) Date: Thu, 11 Jun 2009 15:55:03 +0200 Subject: Camping tutorials for education? In-Reply-To: <1bd79b4a0906101745ua0a0a4ci433befb00b8152a4@mail.gmail.com> References: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> <20090609152809.GD5278@groll.co.za> <1bd79b4a0906100739o7774f46t47a8b12b0931873d@mail.gmail.com> <1bd79b4a0906101330v10826f0v99fb46b90ee22282@mail.gmail.com> <391a49da0906101446r5831905eoc12ba2562df2a1bf@mail.gmail.com> <1bd79b4a0906101745ua0a0a4ci433befb00b8152a4@mail.gmail.com> Message-ID: <79327CEA-B5E7-44BE-9E9F-46657681EE8A@gmail.com> On 11 Jun 2009, at 02:45, David Susco wrote: > OK, good to know. What the latest version I can use? Well if Magnus has indeed released 1.5.180 then this is the latest baseline stable. I am running it on many apps and it works pretty OK with most irritating bugs (like R not working properly for additiona option hashes) weeded out. If you are into experiments, you can try 2.0 but I never tried it out in earnest. If you want to issue good reading materials to students you will possibly have to write them yourself, must be doable in a day. -- Julik Tarkhanov me at julik.nl From dsusco at gmail.com Thu Jun 11 10:44:30 2009 From: dsusco at gmail.com (David Susco) Date: Thu, 11 Jun 2009 10:44:30 -0400 Subject: Camping tutorials for education? In-Reply-To: <1bd79b4a0906101745ua0a0a4ci433befb00b8152a4@mail.gmail.com> References: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> <20090609152809.GD5278@groll.co.za> <1bd79b4a0906100739o7774f46t47a8b12b0931873d@mail.gmail.com> <1bd79b4a0906101330v10826f0v99fb46b90ee22282@mail.gmail.com> <391a49da0906101446r5831905eoc12ba2562df2a1bf@mail.gmail.com> <1bd79b4a0906101745ua0a0a4ci433befb00b8152a4@mail.gmail.com> Message-ID: <1bd79b4a0906110744g2a0a3ad7h1a5d3a3ab9b986e0@mail.gmail.com> Scratch that, got everything working with 1.8.7-p173 and selinux disabled. I have to say, rack apps are pretty easy to deploy with passenger once you get the thing installed and working :P. @Jonathan - Re: your apache conf, I actually didn't need the directory directive and the execcgi option to get this to work. Why did you list it? So here's my TODO list: 1. Try to get it working with selinux enabled. 2. Put together a tutorial for the wiki (which one would you guys like to see it on? github?) 3. Look into performance and security. Would installing fastcgi or something similar speed passenger up any? On Wed, Jun 10, 2009 at 8:45 PM, David Susco wrote: > OK, good to know. What the latest version I can use? > > Dave > > On Wed, Jun 10, 2009 at 5:46 PM, Magnus Holm wrote: >> Unfornately,?Camping?doesn't?(yet)?work?on?Ruby?1.9.1.?Unless?someone?else?want?to?try >> now,?I'm?going?to?have?a?look?at?it?*after*?2.0?is?released. >> >> //Magnus Holm >> >> >> On Wed, Jun 10, 2009 at 22:30, David Susco wrote: >>> >>> I've disabled SELinux to see if I could get any farther. >>> >>> I managed to get passenger installed and working, however a fancy >>> passenger generated page is telling me the app couldn't be started due >>> to this error: >>> >>> `require': >>> /usr/local/lib/ruby/gems/1.9.1/gems/camping-1.9.316/lib/camping.rb:11: >>> syntax error, unexpected tLABEL (SyntaxError) >>> p[0]==?/?@root+p:p end;def URL c='/',*a;c=R(c,... >>> >>> It's the same thing when I try to rackup the .ru file, and the same >>> when I try to execute this little bit of code: >>> >>> #!/usr/bin/env ruby -rubygems >>> gem 'camping', '>=1.9.316' >>> %w(rack camping).each { |lib| require lib } >>> puts 'done' >>> >>> I'm tried reinstalled camping 1.9.316 but that didn't change anything. >>> Any ideas? >>> >>> Dave >>> >>> On Wed, Jun 10, 2009 at 10:39 AM, David Susco wrote: >>> > I'm trying to get passenger working presently, once I do I'll let you >>> > know how the rest of it goes. >>> > >>> > When I try to load the module in the apache conf I get the following >>> > error: >>> > >>> > Cannot load >>> > /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so >>> > into server: >>> > /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so: >>> > failed to map segment from shared object: Permission denied >>> > >>> > I'm assuming it's an SELinux problem, has anyone run into it before? >>> > I've done the following already, so it hasn't helped: >>> > >>> > http://www.modrails.com/documentation/Users%20guide.html#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it >>> > >>> > Dave >>> > >>> > >>> > On Tue, Jun 9, 2009 at 11:28 AM, Jonathan Groll >>> > wrote: >>> >> Hi David, >>> >> >>> >> On Tue, Jun 09, 2009 at 09:29:22AM -0400, David Susco wrote: >>> >>> >>> >>> I'd definitely be interested in seeing any work you do with this. >>> >>> Having it up on the wiki would be nice too. >>> >>> >>> >>> I'm still trying to figure out deployment with camping 1.5. I've >>> >>> experimented with 1.9.316 and rack but have yet to get an app to work >>> >>> with that. The same with Picnic. >>> >> >>> >> Been meaning to write a quick overview of how I did it for you (as >>> >> documentation is super sparse still). Briefly: >>> >> >>> >> (1) Read the passenger user guide at: >>> >> http://www.modrails.com/documentation/Users%20guide.html >>> >> >>> >> I installed passenger from a gem but see the user's guide if you need >>> >> to install on debian using apt (it is in the Ubuntu repositories >>> >> already). >>> >> Similarly rack is from a gem, and I use the same version of camping as >>> >> you (from Judofyr's gem server). >>> >> >>> >> (2) Try and get the "hello world" from the passenger user guide to >>> >> work for you. >>> >> >>> >> (3) Then try and get the blog example working that is shipped with >>> >> camping. Here is a config.ru that works for that: >>> >> >>> >> require 'rubygems' >>> >> require 'rack' >>> >> require 'camping' >>> >> require 'blog' >>> >> Blog::Models::Base.establish_connection :adapter => "sqlite3", >>> >> :database => "/home/jonathan/.camping.db" >>> >> run Blog >>> >> >>> >> Change the database path to one you have on your system. You may need >>> >> something like: >>> >> Blog::Models.create_schema :assume => (Blog::Models::Post.table_exists? >>> >> ? >>> >> 1.0 : 0.0) >>> >> >>> >> before "run blog" if your sqlite database doesn't yet have the schema >>> >> for the blog example. >>> >> >>> >> (4) And the apache config that I used was something like: >>> >> >>> >> >>> >> ? ? ? ? ? ? ?Options ExecCGI FollowSymLinks >>> >> ? ? ? ? ? ? ? ? AllowOverride all >>> >> ? ? ? ? ? ? ? ? ? ?Allow from all >>> >> >>> >> >>> >> ? ?ServerName www.rackexample.com >>> >> ? ?DocumentRoot /var/www/blog/public >>> >> >>> >> >>> >> You may need to edit your hosts file so that www.rackexample.com >>> >> resolves to your apache server. >>> >> >>> >> (5) Let us know how it goes... >>> >> >>> >> Regards, >>> >> Jonathan >>> >> _______________________________________________ >>> >> Camping-list mailing list >>> >> Camping-list at rubyforge.org >>> >> http://rubyforge.org/mailman/listinfo/camping-list >>> >> >>> > >>> > >>> > >>> > -- >>> > Dave >>> > >>> >>> >>> >>> -- >>> Dave >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >> >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > > > > -- > Dave > -- Dave From lists at groll.co.za Thu Jun 11 11:32:29 2009 From: lists at groll.co.za (Jonathan Groll) Date: Thu, 11 Jun 2009 17:32:29 +0200 Subject: sqlite3 connection problem In-Reply-To: <4BF60F34-3581-4699-8BE0-C3B6858D4A0D@innotts.co.uk> References: <4BF60F34-3581-4699-8BE0-C3B6858D4A0D@innotts.co.uk> Message-ID: <20090611153229.GB8005@groll.co.za> On Tue, Jun 09, 2009 at 11:35:26AM +0100, Dave Everitt wrote: > Any feedback appreciated on the following. My most recent attempt to > identify the issue is a minimal Ruby/SQLite/ActiveRecord script, Pastied > here: http://pastie.textmate.org/492514 which brings up the following > when run from the command line (an empty database file already exists): > > $ ./simple_db.rbx > [SNIP]/active_record/connection_adapters/sqlite3_adapter.rb:29:in > `table_structure': Could not find table 'users' (1) Not really a 'camping' related pastie. See (3) for the same thing done the 'camping way'. (2) There seems to be nothing in the code above telling activerecord to create your database schema unless you're doing seperate rake db:migrate scripts outside of this script. My suspicion, therefore is that the 'users' table simply does not exist in your database. (3) This is a full working solution for camping 1.5: #!/usr/bin/env ruby $:.unshift File.dirname(__FILE__) + "/../../lib" require 'camping' Camping.goes :Dave module Dave::Models class User < Base end class CreateTables < V 1.0 def self.up create_table :dave_users, :force => true do |t| t.column :id, :integer, :null => false t.column :name, :string, :limit => 255 t.column :password, :string, :limit => 255 end def self.down drop_table :dave_users end end end end module Dave::Controllers class Index < R '/' def get user = User.new() user.id = "dave" user.name = "Dave Everitt" user.password = "davepass" user.save # user = User.find("dave") # user.destroy() render :fin end end end module Dave::Views def fin "Finished, no errors" end end def Dave.create Dave::Models.create_schema :assume => (Dave::Models::User.table_exists? ? 1.0 : 0.0) end *************************** Save this file as dave.rb. Note the Dave::Models.create_schema call (as per point 2 above) To get this to work I have the following gems installed: $ gem list *** LOCAL GEMS *** activerecord (2.3.2) activesupport (2.3.2) builder (2.1.2) camping (1.5.180) markaby (0.5) metaid (1.0) sqlite3-ruby (1.2.4) I run it with: camping dave.rb I then visited http://localhost:3301/ with my browser (which showed "Finished, no errors"). To confirm that there is a table in the sqlite database with the correct fields and with one record: $ sqlite3 ~/.camping.db SQLite version 3.6.10 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> .tables dave_schema_infos dave_users sessions sqlite> .header on sqlite> select * from dave_users; id|name|password 0|Dave Everitt|davepass Hope some of the above points you in the 'right' direction. Cheers, Jonathan. From lists at groll.co.za Thu Jun 11 15:35:52 2009 From: lists at groll.co.za (Jonathan Groll) Date: Thu, 11 Jun 2009 21:35:52 +0200 Subject: Camping tutorials for education? In-Reply-To: <1bd79b4a0906110744g2a0a3ad7h1a5d3a3ab9b986e0@mail.gmail.com> References: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> <20090609152809.GD5278@groll.co.za> <1bd79b4a0906100739o7774f46t47a8b12b0931873d@mail.gmail.com> <1bd79b4a0906101330v10826f0v99fb46b90ee22282@mail.gmail.com> <391a49da0906101446r5831905eoc12ba2562df2a1bf@mail.gmail.com> <1bd79b4a0906101745ua0a0a4ci433befb00b8152a4@mail.gmail.com> <1bd79b4a0906110744g2a0a3ad7h1a5d3a3ab9b986e0@mail.gmail.com> Message-ID: <20090611193552.GC8005@groll.co.za> On Thu, Jun 11, 2009 at 10:44:30AM -0400, David Susco wrote: >@Jonathan - Re: your apache conf, I actually didn't need the directory >directive and the execcgi option to get this to work. Why did you list >it? You don't need the execcgi, and the reason I give the directory directive is to set the permissions to allow, deny just for that directory (by default all my permissions are set to deny,allow for extra security). So skip the section if you don't need it. >3. Look into performance and security. Would installing fastcgi or >something similar speed passenger up any? > Fastcgi, which creates persistent ruby backend processes does a similar thing to passenger. It only makes sense to my mind to have one thing managing your ruby processes. Cheers, Jonathan. From judofyr at gmail.com Thu Jun 11 17:03:17 2009 From: judofyr at gmail.com (Magnus Holm) Date: Thu, 11 Jun 2009 23:03:17 +0200 Subject: Code Review: Cleanup of examples + Rackification Message-ID: <391a49da0906111403k20f80e8fn2a7ddcd437987764@mail.gmail.com> Hey guys, I had some unfinished stuff in my working directory which I've now pushed out to the rackification-branch at my fork. Even though I have push-permissions to why's repo, I still like the idea that we should all decide which ways Camping should go, and this includes quite a bit of code: == Cleanup of blog.rb http://github.com/judofyr/camping/commit/957c907cc925ab8c58ddff94f4bc6ddd27f7285f Just making it simpler and not so magically. == Removal of tepee.rb and campsh.rb http://github.com/judofyr/camping/commit/3c87b0a6f028bb315ddb2196a1f09d5ba640b865 Currently these are not working 100% correctly so until we clean these up, I think it's a good idea to remove them to avoid confusion. They're still hidden in Git's history, so it's more like hiding them than removing them. == Add Camping.use http://github.com/judofyr/camping/commit/0d21c240963226bb40038de3fe0f111928889215 This allows the user to inject middlewares so they become a part of the app: module App use Somemiddleware, 123, 456 # Equals to adding Somemiddleware.new(App, 123, 456) on the "outside". use Stackable, :yes => "they are" end == Session refactoring http://github.com/judofyr/camping/commit/332e0a190a6bbf1af7e8d7812ec3f816727efc38 Okay, this is larger one: Now that we can inject middleware, we can make Camping::Session simply "use Rack::Session::Cookie". This means a smaller Camping (lib/camping that is, not camping.rb) and less code to maintain. I've also added a "secret" method to change the secret key (the name may be a little too generic though): module App include Camping::Session secret "Hello!" end However, in order to use Rack::Session::Cookie I had to change some internal stuff. First of all, @env is now the Hash passed into #call (earlier this was a Camping::H[@env]). This is because all the rack.session stuff require changing the originial @env in order to save sessions. @state is also now set in Base#initialize and is always based on rack.session. This means that any middleware who sets env['rack.session'] to some Hash will make Camping pick it up and put it in @state. In Base#to_a (which is used to finialize stuff) there's a simple "@env['rack.session'] = @state" to save the sessions. I've also removed Camping::ARSession, since I didn't feel like rewriting it as a Rack middleware. Please call out if it's missed. == Simplify things that Rack gives us for free http://github.com/judofyr/camping/commit/a7cff36813b899b48fe0d196d2ea54bd7377e6e5 Rack now parses nested params and we can now safely assume SCRIPT_NAME and REQUEST_METHOD to be set thanks to the Rack spec. Saves us some bytes. camping.rb is at 2999 bytes after these patches. -- So what do you think? Any obvious things I'm missing? Yeah, I know I've probably broken some backward compatibility, but remember that 1.9 is after all a preview release, and 2.0 *is* a major update. Have a look and don't be afraid to call out the stupid parts :-) //Magnus Holm (who now has no excuse for not starting on the docs) -------------- next part -------------- An HTML attachment was scrubbed... URL: From deveritt at innotts.co.uk Fri Jun 12 11:12:31 2009 From: deveritt at innotts.co.uk (Dave Everitt) Date: Fri, 12 Jun 2009 16:12:31 +0100 Subject: sqlite3 connection problem In-Reply-To: <20090611153229.GB8005@groll.co.za> References: <4BF60F34-3581-4699-8BE0-C3B6858D4A0D@innotts.co.uk> <20090611153229.GB8005@groll.co.za> Message-ID: <959A6A05-5E3C-493A-B5B8-2686E46A6784@innotts.co.uk> Thanks Jonathan - that's done the trick. (BTW my previous fumble was an attempt to pinpoint my problem by connecting without Camping.) With the idea of using this as the simplest possible 'Camping with SQLite' example for beginners (or testing new setups), I've adjusted and pastied it: http://pastie.textmate.org/509724 Comments welcome - Dave From deveritt at innotts.co.uk Fri Jun 12 16:28:12 2009 From: deveritt at innotts.co.uk (Dave Everitt) Date: Fri, 12 Jun 2009 21:28:12 +0100 Subject: camping alive? In-Reply-To: References: Message-ID: <1BE10F8A-7988-4384-B6F0-CA3EF69FB29D@innotts.co.uk> We love Camping too. It is alive (see 'Release?' :-) - Dave Everitt > On 10 Jun 2009, at 21:34, in-seok hwang wrote: > > i used camping1.5.180, but i thing camping is dead. > When camping 2.0 coming? > this url(http://camping.rubyforge.org/files/README.html) is no more > update? > this url(http://github.com/why/camping/tree/master) is main > repository? right? > why main repository's changelog is stop in ver1.6 > This development has been stopped because I of my curiosity. > but, i love camping web-framework. > Someone please tell me camping is alive. From deveritt at innotts.co.uk Fri Jun 12 16:36:19 2009 From: deveritt at innotts.co.uk (Dave Everitt) Date: Fri, 12 Jun 2009 21:36:19 +0100 Subject: Release? In-Reply-To: <391a49da0906101449n3da3fca3qe98dc3858761c4a2@mail.gmail.com> References: <62183EB5-485B-4C83-AFF0-B1801C9080D5@gmail.com> <14540CF2-1C18-4F89-ACD5-DDEA9385AD8C@gmail.com> <00B45FC2-C99C-4B53-AA29-D7251757313A@gmail.com> <391a49da0906101449n3da3fca3qe98dc3858761c4a2@mail.gmail.com> Message-ID: <025618ED-F4A3-4885-8875-73CF52CBA7F4@innotts.co.uk> If 1.5.180 is more stable would it be best to replace 1.5 with 1.5.180 as the 'official' pre-2.0 release for those requiring backward compatibility? If there are 'plenty of bug fixes in the repo', which ones aren't yet incorporated '1.5.180 from _why's gem server which fixes some of them'? I'm kind of speaking as a 'Camping consumer' here - my Ruby's not up to contributing too much. I don't mean to go on about 1.5 (and I'll happily use 2.0 when it's ready), but it would be good to have a solid-as-poss 1.5 version as there are still a lot of examples and working apps out there based around 1.5 (well, nearly all of it is). - Dave Everitt > Magnus Holm: > Oh, sorry. I totally forgot about this. > Are we absolutely sure that 1.5.180 is stable enough to be pushed > out to Rubyforge? > >> Julik Tarkhanov: >> I can, but people who might need my apps can't and won't look for >> non-official gem servers. Is there a possibility for someone to >> push the solidified, old-school 1.5.180 to Rubyforge? Before 2.0 >> is released? It's 2 minutes work, seriously... >> >>> Magnus Holm: >>> Yes, we should release 2.0 soon... >>> Meanwhile you can always download 2.0 using my repo: >>> gem install camping --source http://gems.judofyr.net/ From deveritt at innotts.co.uk Tue Jun 16 06:58:06 2009 From: deveritt at innotts.co.uk (Dave Everitt) Date: Tue, 16 Jun 2009 11:58:06 +0100 Subject: Camping tutorials for education? In-Reply-To: <79327CEA-B5E7-44BE-9E9F-46657681EE8A@gmail.com> References: <1bd79b4a0906090629y1b28241dx9c7175cd3aa9ee6d@mail.gmail.com> <20090609152809.GD5278@groll.co.za> <1bd79b4a0906100739o7774f46t47a8b12b0931873d@mail.gmail.com> <1bd79b4a0906101330v10826f0v99fb46b90ee22282@mail.gmail.com> <391a49da0906101446r5831905eoc12ba2562df2a1bf@mail.gmail.com> <1bd79b4a0906101745ua0a0a4ci433befb00b8152a4@mail.gmail.com> <79327CEA-B5E7-44BE-9E9F-46657681EE8A@gmail.com> Message-ID: @Julik: I agree about the 1.5.180 but it would be good to have it become 'official' - the main problem is that many of the Camping links out there don't refer to it, so people are downloading 1.5, trying the examples and having some problems e.g.: "I've had a lot of people contact me asking questions about errors and issues with content from my presentation or from conversations with them when really the only issue was that they were on 1.5 and needed to be on trunk." (2008, Keeping Camping going: msg#00008 lang.ruby.camping.general) - Jeremy McAnally He also has a nice Camping presentation (also in PDF) from 2007: http://slideshow.rubyforge.org/camping.html My own tutorial materials will evolve as I use Camping, and I'll share them if things turns out okay. At present, I'm using it to generate static pages for prototyping a website, a purpose for which it works very well (a Camping niche market!?). As soon as I get the blog example working well with 1.5.180, I'll write that up too. Then on to 2.0? The only thing holding me back there is getting Rack up and running and playing nicely with Apache. So far I've just seen (and reversed) the lobster from the rack gem, but have yet to make time to do the latter. In order to get a more complete picture, I spent most of last week researching (and trying) other more compact Ruby frameworks out there (http://wiki.ramaze.net/Home#other-frameworks). It seems Ramaze and Sinatra have the edge when it comes to nice and informative websites. Jeremy McAnally's Vintage also seem okay, but I'm not sure about Wuby and some of the others have very poor documentation or web presence. I still like Camping, but there's a way to go if we're going to match the Sinatra or Ramaze sites, and that's something to which I'd certainly like to contribute. - Dave Everitt > Well if Magnus has indeed released 1.5.180 then this is the latest > baseline stable. I am running it on many apps and it works pretty > OK with most irritating bugs (like R not working properly for > additiona option hashes) weeded out. If you are into experiments, > you can try 2.0 but I never tried it out in earnest. > > If you want to issue good reading materials to students you will > possibly have to write them yourself, must be doable in a day. From dsusco at gmail.com Tue Jun 16 15:18:53 2009 From: dsusco at gmail.com (David Susco) Date: Tue, 16 Jun 2009 15:18:53 -0400 Subject: using partials when using ERB for views Message-ID: <1bd79b4a0906161218w33832dbcj741f1d07e3b79c2b@mail.gmail.com> So I like using ERB for views and have it implemented something like this: render t content = ERB.new(File.read "./some_app/views/#{t}.erb").result binding ERB.new(File.read "./some_app/views/layout.erb").result binding end So, effectively I have no Views module. However, I'd like to make use of some partials as well. I can make a method for every partial and throw it in the Helpers module but that doesn't seem like the right road. Does anyone have any suggestions? I tried creating a partial method in the main module: def partial p ERB.new(File.read "./some_app/partials/#{p}.erb").result binding end And then tried overriding missing_method to be fancy: def missing_method symbol, args* p = symbol.to_s if p[0] == '_' partial p else super end end So I could call partials like this '_some_partial' but as the Controller is calling render, I would have to do this in every controller class I think. Does anyone have other suggestions? -- Dave From dsusco at gmail.com Fri Jun 19 14:18:35 2009 From: dsusco at gmail.com (David Susco) Date: Fri, 19 Jun 2009 14:18:35 -0400 Subject: using partials when using ERB for views In-Reply-To: <1bd79b4a0906161218w33832dbcj741f1d07e3b79c2b@mail.gmail.com> References: <1bd79b4a0906161218w33832dbcj741f1d07e3b79c2b@mail.gmail.com> Message-ID: <1bd79b4a0906191118m136491cbl6b1202a636e34490@mail.gmail.com> This is what I came up with in the end: module Helpers def method_missing symbol, *args unless /^_/!~symbol.to_s partial symbol.to_s else super end end def partial p ERB.new(File.read "./crud/views/#{p}.erb").result(binding) end end I took a look at the route maker, and rather than modify that to have all controllers inherit a Partials module I just added the above to the Helpers module. Design wise it's not perfect. Partials really belong in the Views module, but with no equivalent to the Mab object when using ERB I couldn't figure out a way to access partials from the Views module. Dave On Tue, Jun 16, 2009 at 3:18 PM, David Susco wrote: > So I like using ERB for views and have it implemented something like this: > > render t > ?content = ERB.new(File.read "./some_app/views/#{t}.erb").result binding > ?ERB.new(File.read "./some_app/views/layout.erb").result binding > end > > So, effectively I have no Views module. However, I'd like to make use > of some partials as well. I can make a method for every partial and > throw it in the Helpers module but that doesn't seem like the right > road. Does anyone have any suggestions? I tried creating a partial > method in the main module: > > def partial p > ?ERB.new(File.read "./some_app/partials/#{p}.erb").result binding > end > > And then tried overriding missing_method to be fancy: > > def missing_method symbol, args* > ?p = symbol.to_s > ?if p[0] == '_' > ? ?partial p > ?else > ? ?super > ?end > end > > So I could call partials like this '_some_partial' but as the > Controller is calling render, I would have to do this in every > controller class I think. Does anyone have other suggestions? > > -- > Dave > -- Dave From john.beppu at gmail.com Fri Jun 19 16:31:24 2009 From: john.beppu at gmail.com (John Beppu) Date: Fri, 19 Jun 2009 13:31:24 -0700 Subject: using partials when using ERB for views In-Reply-To: <1bd79b4a0906191118m136491cbl6b1202a636e34490@mail.gmail.com> References: <1bd79b4a0906161218w33832dbcj741f1d07e3b79c2b@mail.gmail.com> <1bd79b4a0906191118m136491cbl6b1202a636e34490@mail.gmail.com> Message-ID: <21a10fe00906191331t48fa6dcdu2f48d1d385728a79@mail.gmail.com> It's been a little while since I've coded in Ruby, but here's a way to use alternative templating systems with Camping. #!/usr/bin/env ruby require 'rubygems' require 'camping' require 'erb' Camping.goes :Alternative module Alternative::Controllers class Home < R '/' def get @name = "beppu" render :home end end end module Alternative::Views def layout self << "top\n" self << yield self << "bottom\n" end def method_missing(sym, *args, &block) template_path = "#{sym.to_s}.erb" if File.readable? template_path self << ERB.new(File.read(template_path)).result(binding) else # The view code must coexist with Markaby. # I don't see an easy way around this, # because the render method assumes Markaby is being used. super end end end The key is to override *method_missing* in the Views module. In this example, instead of going straight to Markaby, it'll first check the filesystem to see if a matching template exists. If so, it'll run it through the templating system of your choice. The benefit of this approach is that the various conventions used by Camping are still in effect. - You can still call *render* :template from your controllers. - If the template's name has a leading '_', it's still treated as a partial template. - Otherwise, the content will be wrapped with the *layout* method if it exists. - Last but not least, your view code is still in the Views module. In this example, I used ERB, but you can generalize this solution to fit any templating system. --beppu -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.beppu at gmail.com Fri Jun 19 16:44:29 2009 From: john.beppu at gmail.com (John Beppu) Date: Fri, 19 Jun 2009 13:44:29 -0700 Subject: using partials when using ERB for views In-Reply-To: <21a10fe00906191331t48fa6dcdu2f48d1d385728a79@mail.gmail.com> References: <1bd79b4a0906161218w33832dbcj741f1d07e3b79c2b@mail.gmail.com> <1bd79b4a0906191118m136491cbl6b1202a636e34490@mail.gmail.com> <21a10fe00906191331t48fa6dcdu2f48d1d385728a79@mail.gmail.com> Message-ID: <21a10fe00906191344r20ffc1c4jc728b721ec3b3d4d@mail.gmail.com> It has a lot of similarities to what you were already doing, but this integrates w/ Camping a little more smoothly. -------------- next part -------------- An HTML attachment was scrubbed... URL: