Using filters

2010-10-03 Thread Raimon Fernandez
Hi,


I'm trying to use filters in my Camping App, but at this moment they are not 
working ...

I've found some presentation by Jeremy McAnally 
(http://slideshow.rubyforge.org/camping.html#1)

At the end, appears a Library that makes our life easier, but I can't find this 
library.

Also, this presentation is from 2007 and we are now in 2011, so maybe Camping 
can handle those filters in an easy way.

I use them in Rails but here I'm getting always ./list.rb:278: uninitialized 
constant List::Filters (NameError)

Basically what I want to do is before each controller, check if there are some 
input variables in the post, and proceed if they are OK or send an error page, 
well, preferably a an error status in the header.

thanks in advance,

regards,

r.



Here is what says about Kindling:

Kindling

• A new library by me that takes the top 5-10 “Railsisms” and lets you 
use them in Camping
• Currently supports…
• Easy before/after filters
• Static file download/upload
• Easy addition of template handlers, with default support for 
ERb


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Forcing a Response Status-Code of 40x

2010-10-03 Thread Raimon Fernandez
Thanks John  Magnus,


Where I can find more info about those little magic 

:-)

Also, I was calling from the wrong place, in a helper it is not working, but 
works if I call from a Controller.

thanks again,

regards,

r.


On 3oct, 2010, at 18:22 , John Beppu wrote:

 @status = 404


On 3oct, 2010, at 18:21 , Magnus Holm wrote:

 @status = 404


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Forcing a Response Status-Code of 40x

2010-10-03 Thread Raimon Fernandez
uuuch 

it's there !!

I've read it twice before posting here .

:-(

thanks again,

r.


The Response:

You can change these variables to your needs:

• @status is the HTTP status (defaults to 200)
• @headers is a hash with the headers
• @body is the body (a string or something which responds to each)
• Any changes in @cookies and @state will also be sent to the client


On 3oct, 2010, at 22:54 , Magnus Holm wrote:

 There's some info about the request/response here: 
 http://camping.rubyforge.org/api.html#class-Camping-Controllers
 
 // Magnus Holm
 
 
 On Sun, Oct 3, 2010 at 22:47, Raimon Fernandez co...@montx.com wrote:
 Thanks John  Magnus,
 
 
 Where I can find more info about those little magic 
 
 :-)
 
 Also, I was calling from the wrong place, in a helper it is not working, but 
 works if I call from a Controller.
 
 thanks again,
 
 regards,
 
 r.
 
 
 On 3oct, 2010, at 18:22 , John Beppu wrote:
 
  @status = 404
 
 
 On 3oct, 2010, at 18:21 , Magnus Holm wrote:
 
  @status = 404
 
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Installing Camping on ubuntu lucid

2010-08-03 Thread Raimon Fernandez
hi,


I'm moving my Camping from OS X to a Ubuntu Lucid unix machine.

The camping gem has been successfully installed, but I can't access it directly 
from the command line.

mo...@lucid:/u/apps/portablechecking$ gem list

*** LOCAL GEMS ***

actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8)
builder (2.1.2)
camping (2.0)
daemons (1.1.0)
eventmachine (0.12.10)
pg (0.9.0)
rack (1.2.1, 1.1.0)
rails (2.3.8)
rake (0.8.7)
sqlite3-ruby (1.3.1)
thin (1.2.7)


The ubuntu package is Camping 1.5 only ...

sudo apt-get install camping
http://packages.ubuntu.com/lucid/camping

any ideas ?

thanks,

r.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Relations on Camping

2010-06-25 Thread Raimon Fernandez
yes, you're right !!

I've been caight by the pre-pend table name in the field name ...

:-)

thanks,

r.

On 25jun, 2010, at 13:33 , Philippe Monnet wrote:

 Raimon,
 
 I suspect that your relationship column (foreign key) should actually be 
 called group_id not list_group_id like in:
 
 def self.up  
   create_table :list_groups, :force = true do |t|
 t.string  :name
   end
 
   create_table :list_people, :force = true do |t|
 t.integer :group_id,  :null = false
 t.string  :username
   end
 
 Philippe
 
 On 6/25/2010 2:39 AM, Raimon Fernandez wrote:
 
 Hi, it's me again ...
 
 :-)
 
 
 I have one table called people and another one called groups.
 
 Each person from people belongs to ONE group.
 
 
 module List::Models
 
   class Person  Base
 belongs_to :group
   end
 
   class Group  Base
   end
 
 end  
 
 
 When I get all persons from people, I expect, like in RoR, the access to 
 related records, like:
 
 module List::Views
   def people(xml)
 xml.posts do
   @posts.each do |person|
 xml.person do
   xml.id(person.id)
   xml.name(person.name)
   xml.surname_01(person.surname_01)
   xml.surname_02(person.surname_02)
   xml.has_come(person.has_come)
  xml.group(person.group.name) #  Here I'm asking for related 
 information about the group name
 end
   end
 end
   end
   
 end
 
 and I'm getting =  NoMethodError at /people/list undefined method `name' 
 for nil:NilClass
 
 also, I'm trying to test it on Console:
 
 MacBook-ProII-2:Test montx$ camping -C list.rb 
 ** Starting console
   
 Person.find(1)
   
 NameError: uninitialized constant Person
  from 
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in
  `load_missing_constant'
  from 
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
  `const_missing'
  from 
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in
  `const_missing'
  from (irb):1
   
   
 but it seems that the model hasn't been loaded ...
 
 thanks again for your help,
 
 regards,
 
 r.
 
 ps. yes, I have in the db the relation between two tables: list_group_id in 
 the list_people table.
 
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
   
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Speed issue

2010-06-22 Thread Raimon Fernandez
Hi Magnus,


On 21jun, 2010, at 21:40 , Magnus Holm wrote:

 Yep,
 
 The reloader (located in camping/reloader.rb) watches a file and then
 reloads the server whenever the file changes. It's what makes it
 possible to just run `camping app.rb` and always have the latest
 version served.

if I start with camping list.rb and enter this url 
http://127.0.0.1:3301/people/list and I hit the reload continuosly, you will 
see how if 'freezes' ...

if I start with camping -s thin list.rb and enter this url 
http://127.0.0.1:3301/people/list and I hit the reload continuosly, it's always 
fast and responsive

 
 I can't reproduce it at my machine at the moment :( Could you send me
 an example app which has the speed issues on your machine?

Where I can send a .db also ?

I can put the code in the pastie but the database ?

It has some rows that I fetch ...

thanks,

regards,

r.


 
 // Magnus Holm
 
 
 
 On Mon, Jun 21, 2010 at 16:10, Raimon Fernandez co...@montx.com wrote:
 
 On 21jun, 2010, at 13:49 , Magnus Holm wrote:
 
 Okay, I was just wondering since if you run the app with the thin
 command, you won't get the reloader. So apparently the issue exists
 only with the reloader+Mongrel...
 
 What's the reloader ?
 
 When I make some changes in the app.rb file ?
 
 thanks,
 
 regards.
 
 r.
 
 
 
 On Monday, June 21, 2010, Raimon Fernandez co...@montx.com wrote:
 
 On 21jun, 2010, at 12:56 , Magnus Holm wrote:
 
 What if you run Thin with `camping -s thin app.rb`? Do you have the
 speed issue then?
 
 No, with Thin I don't have the speed issue ...
 
 thanks,
 
 r.
 
 
 Thanks, Magnus
 
 On Monday, June 21, 2010, Raimon Fernandez co...@montx.com wrote:
 
 On 20jun, 2010, at 23:38 , Raimon Fernandez wrote:
 
 
 On 18jun, 2010, at 15:34 , Magnus Holm wrote:
 
 Oh, and I also have the speed issue! That's definitely a bug. I'll
 have a look at it later...
 
 I'm making some progress with Camping and well, it's impressive, really 
 
 
 :-)
 
 Wich version can I use that has not the bug for speed issue ?
 
 I would like to do some demo and I prefer to avoid this bug ... :-)
 
 Just observed that when I run camping with Thin I'm not getting the 
 speed issue, only with Mongrel ...
 
 thanks,
 
 r.
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
 
 --
 // Magnus Holm
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
 
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
 
 --
 // Magnus Holm
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
 
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Speed issue

2010-06-21 Thread Raimon Fernandez

On 20jun, 2010, at 23:38 , Raimon Fernandez wrote:

 
 On 18jun, 2010, at 15:34 , Magnus Holm wrote:
 
 Oh, and I also have the speed issue! That's definitely a bug. I'll
 have a look at it later...
 
 I'm making some progress with Camping and well, it's impressive, really 
 
 :-)
 
 Wich version can I use that has not the bug for speed issue ?
 
 I would like to do some demo and I prefer to avoid this bug ... :-)

Just observed that when I run camping with Thin I'm not getting the speed 
issue, only with Mongrel ...

thanks,

r.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Speed issue

2010-06-20 Thread Raimon Fernandez

On 18jun, 2010, at 15:34 , Magnus Holm wrote:

 Oh, and I also have the speed issue! That's definitely a bug. I'll
 have a look at it later...

I'm making some progress with Camping and well, it's impressive, really 

:-)

Wich version can I use that has not the bug for speed issue ?

I would like to do some demo and I prefer to avoid this bug ... :-)

thanks!

regards,

r.

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time on Camping

2010-06-19 Thread Raimon Fernandez
Hi all,

On 18jun, 2010, at 17:51 , Magnus Holm wrote:

 This shouldn't be a problem, because that's the way to add non-ASCII
 characters to XML documents. A proper XML parser should handle it...

But in this case, it's an ASCII á, well, the extended ASCII, and all .xml files 
that I've created never added this encoded, always the char itself, like à á ç ñ

I'm using the TBMXML parser http://www.tbxml.co.uk/TBXML/TBXML_Free.html

And because the xml file has the encoding=UTF-8 I suppose that those chars 
can be added as they are without encoding.

And also I'm using other C libraries in other projects that they do not escape 
those chars ...

Thanks!

regards,

r.


 
 // Magnus Holm (from my phone)
 
 On Friday, June 18, 2010, Raimon Fernandez co...@montx.com wrote:
 Hi again,
 
 I know this is more related to builder than to camping, but not sure where 
 to ask for it ...
 
 :-)
 
 
 My app receives .xml file from some different sources, and all of them, 
 except the camping one, are formatted like this:
 
 
 ?xml version=1.0 encoding=UTF-8?
 person
  nameJim Fernández/name
  phone555-1234/phone
 /person
 
 
 but camping is formatting like this:
 
 ?xml version=1.0 encoding=UTF-8?
 person
  nameJim Fern#225;ndez/name
  phone555-1234/phone
 /person
 
 
 The main difference is the encoding for some chars:
 
 á = #225;
 
 I can't find in builder how to write values without escaping them ...
 
 thanks,
 
 r.
 
 On 17jun, 2010, at 21:04 , Magnus Holm wrote:
 
 And if you want this XML:
 
 ?xml version=1.0 encoding=UTF-8?
 posts
  post
titleHiya/title
contentHey/content
  /post
 /posts
 
 You have this view:
 
 module App::Views
  def posts(xml)
xml.posts do
  @posts.each do |post|
xml.post do
  xml.title(post.title)
  xml.content(post.content)
end
  end
end
  end
 end
 
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
 
 -- 
 // Magnus Holm
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time on Camping

2010-06-18 Thread Raimon Fernandez
Hi Magnus,


On 17jun, 2010, at 21:04 , Magnus Holm wrote:

 Hey Raimon,
 
 I see that you've been experimenting with Camping and Reststop lately,
 and just thought I should chime in a bit.
 
 You definitely don't *need* Reststop in order to achieve what you
 want, so it might be a good idea to just leave Reststop until it gets
 a little more robust. Let's see how we can tackle your problem with
 Camping only:

Thanks for your code.


It's true that if I can do what I want with fewer tools/gems, it's a better 
starter, and once I'm confident I can go further.

 That's (hopefully) the simplest way to generate XML with Camping.

yes!


 You still need to create a model to store/retrieve the data. Before we
 can help you here, we need to know a few things: Is it going to fetch
 data from a specific place, or should it create its own database (from
 scratch)? Any specific database you want to use?

Not sure yet, but maybe Sqlite or PostgreSQL. Normally I use PostgreSQL for all 
of my RoR projects, but in this case Sqlite would be simpler.

The initial data will come from some xml files but I can update the database 
from another file with Ruby code. In some examples of Camping they just created 
the database but I couldn't find where they are storing it ...

So, the best option is to provide to Camping an existing SQLite database.


 Here's a Pastie with all the code: http://pastie.org/1008983 (Should
 work on any version of Camping).

thanks, it works and it's very simple :-)

Now I'm playing with your code and examples, thanks again!

regards,

raimon


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time on Camping

2010-06-18 Thread Raimon Fernandez

On 17jun, 2010, at 21:04 , Magnus Holm wrote:

 
 That's (hopefully) the simplest way to generate XML with Camping.
 
 You still need to create a model to store/retrieve the data. Before we
 can help you here, we need to know a few things: Is it going to fetch
 data from a specific place, or should it create its own database (from
 scratch)? Any specific database you want to use?
 
 Here's a Pastie with all the code: http://pastie.org/1008983 (Should
 work on any version of Camping).

I'm trying to adapt your pastie to use a sqlite databse, but I'm having some 
errors that I can't see ...

Here's a Pastie with all code: http://pastie.org/1009797

I'm just trying to create with code a simple table called Persons with some 
fields but ...

:-)

Also,  I can't find where is creating the database ...

thanks,

regards,

r.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time on Camping

2010-06-18 Thread Raimon Fernandez
buf, now I'm lost ...

:-))

no, really, thanks for that info, now I have working as I want ...

:-)


I've tested and created a new databse, and is working also.

I've created a new sqlite3 from terminal and filled-up with some data and now I 
can use this databse from Camping, cool!

And, caping is serving the data with .xml format and I can get it from my 
devices, cool!

I'm going to play more with thise, sure I'll come back with more questions ...

:-)

ah, I always use Thin with Nginx for my RoR instead of Mongrel, I suppose there 
would be no problem with camping ?

and speed: normally it's all very fast, but sometimes, it takes a little bit (3 
or more seconds) to respond camping, and I'm not doing nothing serious at all, 
just the example from pastie.

is because I'm using the development mode instead of production, like in RoR ?

thanks again !

regards,

r.



On 18jun, 2010, at 12:33 , Magnus Holm wrote:

 Yeah, people always get a little confused because you don't need to
 define your database when you're using bin/camping (it has a default
 SQLite database at ~/.camping.db).
 
 I also see that there's some old, database code here; we definitely
 need to update our documentation (yes, I'm working on it!)
 
 First of all, the table name should be list_people (since people
 is the plural to person and the table names are always in
 lowercase), but you should rather do `create_table Person.table_name`
 and `drop_table Person.table_name` because then you don't need to
 think about it at all :-)
 
 Secondly, you only need this in order to create the database:
 
 def List.create
  List::Models.create_schema
 end
 
 Then it will use a SQLite database at ~/.camping.db (as long as you
 start it with `camping list.rb`). This is perfect for just testing
 things out (you can also run `camping -C list.rb` to get an IRB
 console). Please note that if you only run `camping list.rb`, you'll
 have to load the page in the browser before the migrations run.
 
 If you want to use a specific database, you can add this:
 
 def List.create
  List::Models::Base.establish_connection(
:adapter = postgresql,
:username = root,
:password = toor,
:database = list
  )
  List::Models.create_schema
 end
 
 Or you might want to add the information in a database.yml file:
 
 ---
 adapter: postgresql
 username: root
 password: toor
 database: list
 
 And then rather do:
 
 require 'yaml'
 
 def List.create
  List::Models::Base.establish_connection(YAML.load(File.read(database.yml)))
  List::Models.create_schema
 end
 
 Please note that if you connect to a database which already has the
 tables, DON'T run `List::Models.create_schema` as this will probably
 delete the whole database. General rule: you only need migrations to
 setup the database.
 
 --
 
 And thirdly: Yes, we are aware of that the migration support isn't
 very nice. In the future we hope to have something like:
 
 module List::Models
  class Person
t.string :name
  end
 end
 
 def List.create
  List::Models.setup!
 end
 
 Until then, you'll have to stick with the current solution :-)
 
 
 // Magnus Holm
 
 
 
 On Fri, Jun 18, 2010 at 11:09, Raimon Fernandez co...@montx.com wrote:
 
 On 17jun, 2010, at 21:04 , Magnus Holm wrote:
 
 
 That's (hopefully) the simplest way to generate XML with Camping.
 
 You still need to create a model to store/retrieve the data. Before we
 can help you here, we need to know a few things: Is it going to fetch
 data from a specific place, or should it create its own database (from
 scratch)? Any specific database you want to use?
 
 Here's a Pastie with all the code: http://pastie.org/1008983 (Should
 work on any version of Camping).
 
 I'm trying to adapt your pastie to use a sqlite databse, but I'm having some 
 errors that I can't see ...
 
 Here's a Pastie with all code: http://pastie.org/1009797
 
 I'm just trying to create with code a simple table called Persons with some 
 fields but ...
 
 :-)
 
 Also,  I can't find where is creating the database ...
 
 thanks,
 
 regards,
 
 r.
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time on Camping

2010-06-18 Thread Raimon Fernandez
Hi again,

I know this is more related to builder than to camping, but not sure where to 
ask for it ...

:-)


My app receives .xml file from some different sources, and all of them, except 
the camping one, are formatted like this:


?xml version=1.0 encoding=UTF-8?
person
  nameJim Fernández/name
  phone555-1234/phone
/person


but camping is formatting like this:

?xml version=1.0 encoding=UTF-8?
person
  nameJim Fern#225;ndez/name
  phone555-1234/phone
/person


The main difference is the encoding for some chars:

á = #225;

I can't find in builder how to write values without escaping them ...

thanks,

r.

On 17jun, 2010, at 21:04 , Magnus Holm wrote:

 And if you want this XML:
 
 ?xml version=1.0 encoding=UTF-8?
 posts
  post
titleHiya/title
contentHey/content
  /post
 /posts
 
 You have this view:
 
 module App::Views
  def posts(xml)
xml.posts do
  @posts.each do |post|
xml.post do
  xml.title(post.title)
  xml.content(post.content)
end
  end
end
  end
 end


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Where I can find Reststop-based blog.rb?

2010-06-09 Thread Raimon Fernandez
Hi Bartosz,

On 8jun, 2010, at 20:31 , Bartosz Dziewoński wrote:

 It should come with the gem, in examples directory. You can also find
 it here: http://github.com/camping/camping/blob/master/examples/blog.rb

This version doesn't use reststop.

The one that is included in the examples, it does, but has some errors:

MacBook-ProII-2:examples montx$ camping blog.rb 
** Starting Mongrel on 0.0.0.0:3301
!! Error loading /Users/montx/Documents/Camping/reststop/examples/blog.rb:
NameError: uninitialized constant Logger
/Library/Ruby/Site/1.8/reststop.rb:43
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Users/montx/Documents/Camping/reststop/examples/blog.rb:32
/Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in
 `load'
/Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:60:in
 `load_apps'
/Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:105:in
 `reload!'
/Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:180:in
 `reload!'
/Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in
 `each'
/Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:179:in
 `reload!'
/Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/reloader.rb:158:in
 `update'
/Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:157:in 
`find_scripts'
/Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:161:in 
`reload!'
/Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:169:in 
`call'
/Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'
/Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call'
...

So I've added:

require 'Logger'

and started again camping:

MacBook-ProII-2:examples montx$ camping blog.rb 
** Starting Mongrel on 0.0.0.0:3301
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:172:
 warning: already initialized constant VERSION
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:174:
 warning: already initialized constant ProgName
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:181:
 warning: already initialized constant DEBUG
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:182:
 warning: already initialized constant INFO
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:183:
 warning: already initialized constant WARN
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:184:
 warning: already initialized constant ERROR
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:185:
 warning: already initialized constant FATAL
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:186:
 warning: already initialized constant UNKNOWN
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:424:
 warning: already initialized constant SEV_LABEL
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:436:
 warning: already initialized constant Format
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:537:
 warning: already initialized constant SiD
Creating RESTful controller for posts using Reststop pull version number here
Creating RESTful controller for comments using Reststop pull version number 
here
Creating RESTful controller for sessions using Reststop pull version number 
here
127.0.0.1 - - [09/Jun/2010 08:28:07] GET / HTTP/1.1 404 45 0.4875

And in the browser, I see:

Camping problem!
/not found


and If I force the login:

http://127.0.0.1:3301/login

Plenty of errors again ...

RuntimeError: Can't find template _login
(eval):16:in `camping_render'
/Library/Ruby/Site/1.8/reststop.rb:135:in `render'
/Users/montx/Documents/Camping/reststop/examples/blog.rb:101:in `get'
(eval):27:in `send'
(eval):27:in `camping_service'
(eval):27:in `catch'
(eval):27:in `camping_service'
/Library/Ruby/Site/1.8/reststop.rb:53:in `service'
(eval):38:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/session/cookie.rb:37:in 
`call'
(eval):42:in `call'

/Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:176:in 
`call'
/Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call'
/Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in 
`call'
/Library/Ruby/Gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in 
`call'


Re: First time and first error

2010-06-08 Thread Raimon Fernandez

On 8jun, 2010, at 09:18 , Raimon Fernandez wrote:

 Hi again,
 
 
 I'm trying to install Camping on my OS X but I'm getting some errors:
 
 MacBook-ProII-2:~ montx$ gem -v
 1.3.5
 
 MacBook-ProII-2:~ montx$ sudo gem install camping
 WARNING:  RubyGems 1.2+ index not found for:
   http://gems.rubyforge.org/
 
 RubyGems will revert to legacy indexes degrading performance.
 Bulk updating Gem source index for: http://gems.rubyforge.org/
 ERROR:  While executing gem ... (Gem::RemoteSourceException)
Error fetching remote gem cache: SocketError: getaddrinfo: nodename nor 
 servname provided, or not known (http://gems.rubyforge.org/yaml)
 
 
 What are the minimums ?
 
 I'm using in my developer machine Ruby On Rails and Ruby without any 
 problems, with some gems.


I want to add that I'm not behind any proxy or firewall, and that I could 
successfully download/and install some other gems in this machine without any 
problems, but no, no, I can't install nothing from gem.

It seems like a time-out problem:

I have this remote sources:

  - REMOTE SOURCES:
 - http://gems.rubyforge.org/
 - http://gems.github.com
MacBook-ProII-2:~ montx$ 

mmm, a ping to http://gems.rubyforge.org/ = cannot resolve 
http://gems.rubyforge.org/: Unknown host


MacBook-ProII-2:~ montx$ sudo gem sources -r http://gems.rubyforge.org/
http://gems.rubyforge.org/ removed from sources

now I have only  - http://gems.github.com

MacBook-ProII-2:~ montx$ sudo gem install camping
ERROR:  could not find gem camping locally or in a repository
MacBook-ProII-2:~ montx$ 

any idea ?

thanks,


r.





 
 thanks,
 
 regards,
 
 r.
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time and first error

2010-06-08 Thread Raimon Fernandez
Hi Dave,

On 8jun, 2010, at 11:52 , Dave Everitt wrote:

 Hi Raimon
 
 I'm having the same problem with rubygems.org - won't even load in a browser.

ok,


 In February there was a bit of a change:
 http://update.gemcutter.org/2010/02/20/rubygems-org-move-complete.html
 
 Fro current status see the tweets here:
 http://twitter.com/gemcutter

thanks for the info!


 and Magnus' Temporary fix:
 add 72.4.120.124 rubygems.org to your /etc/hosts

ok, done!

mmm, I've removed the rubygems.org from the remote sources and now I can't add 
it again


MacBook-ProII-2:~ montx$ sudo gem sources -a http://rubygems.org
Error fetching http://rubygems.org:
SocketError: getaddrinfo: nodename nor servname provided, or not known 
(http://rubygems.org/specs.4.8.gz)


MacBook-ProII-2:~ montx$ sudo gem sources -a http://rubygems.org
Error fetching http://rubygems.org:
SocketError: getaddrinfo: nodename nor servname provided, or not known 
(http://rubygems.org/specs.4.8.gz)

 Otherwise, get the bleeding edge version:
 sudo gem install camping --source http://gems.judofyr.net/

maybe later !

:-)

thanks,

regards,

r.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time and first error

2010-06-08 Thread Raimon Fernandez

On 8jun, 2010, at 11:52 , Dave Everitt wrote:

 Otherwise, get the bleeding edge version:
 sudo gem install camping --source http://gems.judofyr.net/

ok, I want to focus on Camping so I've installed the edge version without any 
problems :-)

the problem is when I try to execute some example:

acBook-ProII-2:Camping montx$ camping homepage.rb 
/Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:27: 
uninitialized constant Rack::Server (NameError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in 
`gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/camping:6
from /usr/bin/camping:19:in `load'
from /usr/bin/camping:19


I've installed Rack as I use it with some of my Ruby On Rails and Thin projects 
...

Maybe the Rack::Server is not the same ?

Should I install more dependencies ?

thanks,

r.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time and first error

2010-06-08 Thread Raimon Fernandez

On 8jun, 2010, at 11:34 , Magnus Holm wrote:

 Hey Raimon,
 
 Try a `sudo gem update --system` first to upgrade to the latest RubyGems
 
 // Magnus Holm

MacBook-ProII-2:~ montx$ sudo gem update --system
Password:
Updating RubyGems
Nothing to update
MacBook-ProII-2:~ montx$ 


thanks,

r.


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time and first error

2010-06-08 Thread Raimon Fernandez

On 8jun, 2010, at 12:30 , Magnus Holm wrote:

 I believe Rack::Server was introduced in one of the later Rack
 versions. Looks like I forgot to update the version dependency. Are
 you able to install the latest rack (gem install rack), or is
 rubygems.org fully down?
 

I think is fully down because I can't install nothing from gem install ...

thanks,

r.

 
 // Magnus Holm


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time and first error

2010-06-08 Thread Raimon Fernandez
Hi Philippe,

On 8jun, 2010, at 12:53 , Philippe Monnet wrote:

 Hi Raimon,
 
 Sounds like maybe you don't have Rack.
 Do you have the following gem installed?
   - rack (1.1.0)
   - markaby (0.5) [will not work with a higher version]
   - activerecord (any version)
   - activesupport (any version)
 If not gem install them and let us know.

those are my gems:

*** LOCAL GEMS ***

actionmailer (2.3.5, 2.3.4, 2.2.2, 1.3.6)
actionpack (2.3.5, 2.3.4, 2.2.2, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.3.5, 2.3.4, 2.2.2, 1.15.6)
activeresource (2.3.5, 2.3.4, 2.2.2)
activesupport (2.3.5, 2.3.4, 2.2.2, 1.4.4)
acts_as_ferret (0.4.3)
builder (2.1.2)
camping (2.0.392)
capistrano (2.5.2)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
dnssd (0.6.0)
eventmachine (0.12.10)
fastthread (1.0.1)
fcgi (0.8.7)
ferret (0.11.6)
gem_plugin (0.2.3)
highline (1.5.0)
hpricot (0.6.164)
libxml-ruby (1.1.3, 1.1.2)
mongrel (1.1.5)
needle (1.3.0)
net-scp (1.0.1)
net-sftp (2.0.4, 2.0.1, 1.1.1)
net-ssh (2.0.19, 2.0.4, 1.1.4)
net-ssh-gateway (1.0.0)
pg (0.8.0)
prawn (0.7.1)
prawn-core (0.7.1)
prawn-layout (0.7.1)
prawn-security (0.7.1)
rack (1.0.1)
rails (2.3.5, 2.3.4, 2.2.2, 1.2.6)
rake (0.8.3)
RedCloth (4.1.1)
ruby-openid (2.1.7, 2.1.2)
ruby-yadis (0.3.4)
rubynode (0.1.5)
rubyzip (0.9.1)
sqlite3-ruby (1.2.5, 1.2.4)
termios (0.9.4)
thin (1.2.5)
will_paginate (2.3.11)
xmpp4r (0.4)


I have to update rack and install markaby, but I can't, more info in the next 
post related.

thanks,

r.

 
 Philippe
 
 On 6/8/2010 4:25 AM, Raimon Fernandez wrote:
 
 On 8jun, 2010, at 11:52 , Dave Everitt wrote:
 
   
 Otherwise, get the bleeding edge version:
 sudo gem install camping --source http://gems.judofyr.net/
 
 ok, I want to focus on Camping so I've installed the edge version without 
 any problems :-)
 
 the problem is when I try to execute some example:
 
 acBook-ProII-2:Camping montx$ camping homepage.rb 
 /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:27: 
 uninitialized constant Rack::Server (NameError)
  from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in 
 `gem_original_require'
  from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
  from /Library/Ruby/Gems/1.8/gems/camping-2.0.392/bin/camping:6
  from /usr/bin/camping:19:in `load'
  from /usr/bin/camping:19
 
 
 I've installed Rack as I use it with some of my Ruby On Rails and Thin 
 projects ...
 
 Maybe the Rack::Server is not the same ?
 
 Should I install more dependencies ?
 
 thanks,
 
 r.
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
   
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: First time and first error

2010-06-08 Thread Raimon Fernandez
Hi David,

On 8jun, 2010, at 15:38 , Dave Everitt wrote:

 Hi Raimon
 
 Github is no longer maintaining this but the gems are still there, so try:
 
 --source http://gems.github.com

do you mean using like this ?

MacBook-ProII-2:~ montx$ sudo gem install rack --source http://gems.github.com
ERROR:  could not find gem rack locally or in a repository
MacBook-ProII-2:~ montx$ 


thanks,

r.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time and first error

2010-06-08 Thread Raimon Fernandez
Hi David,

On 8jun, 2010, at 16:59 , Dave Everitt wrote:

 Hi Raimon
 
 I did mean that, but the rubygems site is back up... and it looks like 
 they're making progress as the error messages are changing.

ok

 So maybe try again tomorrow?


If I have to wait, I'll wait ... what can I do ?

:-)

I was 'excited' to do a demo tomorrow morning with camping and the devices but 
...

thanks!

regards,

r.



 
 Dave
 
 Hi David,
 
 On 8jun, 2010, at 15:38 , Dave Everitt wrote:
 
 Hi Raimon
 
 Github is no longer maintaining this but the gems are still there, so try:
 
 --source http://gems.github.com
 
 do you mean using like this ?
 
 MacBook-ProII-2:~ montx$ sudo gem install rack --source 
 http://gems.github.com
 ERROR:  could not find gem rack locally or in a repository
 MacBook-ProII-2:~ montx$
 
 thanks,
 
 r.
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time on Camping

2010-06-08 Thread Raimon Fernandez
Hi Dave,

On 8jun, 2010, at 17:04 , David Susco wrote:

 Camping with reststop ought will make serving the xml files easy
 enough. The example on github ought to get you started:
 
 http://github.com/camping/reststop

thanks !

reststop is also a gem for camping ?

regards,



r.



___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time and first error

2010-06-08 Thread Raimon Fernandez
Hi Dave,


On 8jun, 2010, at 17:47 , Dave Everitt wrote:

 Raimon
 
 apologies, rack is not listed in the Github gems 
 (http://gems.github.com/list.html).
 
 BUT (still trying to get around the rubygems.org gem server issues and get 
 you started with Camping) you can try this mirror:
 
 sudo gem install rack --source http://chneukirchen.org/releases/gems/

ok, installed and running, now I'm a Camper!!!

:-)


Sure I'll come back here with more questions about Camping ...

thanks all!

regards,

r.


 see:
 http://docs.github.com/rack/rack/
 (FYI the actual rack 1.1 gem is mirrored here: 
 http://chneukirchen.org/releases/gems/gems/ but the above install should get 
 it)
 
 Dave
 
 MacBook-ProII-2:~ montx$ sudo gem install rack --source 
 http://gems.github.com
 
 ERROR:  could not find gem rack locally or in a repository
 
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time and first error

2010-06-08 Thread Raimon Fernandez

On 8jun, 2010, at 18:19 , Dave Everitt wrote:

 Hi Raimon - welcome,

thanks!

 glad we got around the rubygems.org fail :-) 

hey, I need more workarounds .

:-)

I'm playing with Camping and the introduction found in 
http://camping.rubyforge.org/book/02_getting_started.html

Now I'm reading the Reststop documentation for serving .xml data, and here 
comes again the same error:

MacBook-ProII-2:~ montx$ sudo gem install restr
Password:
WARNING:  RubyGems 1.2+ index not found for:
http://gems.rubyforge.org/

RubyGems will revert to legacy indexes degrading performance.
Bulk updating Gem source index for: http://gems.rubyforge.org/
ERROR:  While executing gem ... (Gem::RemoteSourceException)
Error fetching remote gem cache: SocketError: getaddrinfo: nodename nor 
servname provided, or not known (http://gems.rubyforge.org/yaml)

So the error is general, don't know if I can just clone the git repository of 
restr and install it using ruby setup.rb


thanks again for your help!

regards,

r.



___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Where I can find Reststop-based blog.rb?

2010-06-08 Thread Raimon Fernandez
Hi again,


In Reststop docs they say a good example is the blog.rb, but their link is 
broken.

Where I can find it ?

thanks,

regards,

raimon
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time on Camping

2010-06-08 Thread Raimon Fernandez

On 8jun, 2010, at 18:43 , David Susco wrote:

 I don't believe the gem has been updated to include Matt's or
 Philippe's latest changes. You could clone it from GitHub though and
 rake and install it yourself.

I think it requieres 'hoe' and I can't install without rubygems working or once 
again, find where the repo is and start digging again ...

:-)

MacBook-ProII-2:reststop montx$ sudo rake Rakefile 
(in /Users/montx/Documents/Camping/reststop)
rake aborted!
no such file to load -- hoe
/Users/montx/Documents/Camping/reststop/rakefile:10


thanks!

r.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: First time on Camping

2010-06-08 Thread Raimon Fernandez

On 8jun, 2010, at 21:18 , David Susco wrote:

 Is the hoe gem installed?

no, the same error as before:

Last login: Tue Jun  8 18:43:33 on ttys002
MacBook-ProII-2:~ montx$ sudo gem install hoe
Password:
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
SocketError: getaddrinfo: nodename nor servname provided, or not known 
(http://gems.rubyforge.org/gems/json_pure-1.4.3.gem)
MacBook-ProII-2:~ montx$ 


we have to wait ...

thanks,

r.

 
 Dave
 
 On Tue, Jun 8, 2010 at 1:01 PM, Raimon Fernandez co...@montx.com wrote:
 
 On 8jun, 2010, at 18:43 , David Susco wrote:
 
 I don't believe the gem has been updated to include Matt's or
 Philippe's latest changes. You could clone it from GitHub though and
 rake and install it yourself.
 
 I think it requieres 'hoe' and I can't install without rubygems working or 
 once again, find where the repo is and start digging again ...
 
 :-)
 
 MacBook-ProII-2:reststop montx$ sudo rake Rakefile
 (in /Users/montx/Documents/Camping/reststop)
 rake aborted!
 no such file to load -- hoe
 /Users/montx/Documents/Camping/reststop/rakefile:10
 
 
 thanks!
 
 r.
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 
 
 
 
 -- 
 Dave
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Where I can find Reststop-based blog.rb?

2010-06-08 Thread Raimon Fernandez

On 8jun, 2010, at 20:31 , Bartosz Dziewoński wrote:

 2010/6/8, Raimon Fernandez co...@montx.com:
 In Reststop docs they say a good example is the blog.rb, but their link is 
 broken.
 
 Where I can find it ?
 
 It should come with the gem, in examples directory.

oughhh, you're right, it's there.

 You can also find it here: 
 http://github.com/camping/camping/blob/master/examples/blog.rb

thanks,

raimon

 
 -- 
 Matma Rex - http://matma-rex.prv.pl/
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list
 


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list