Philippe Monnet
2010-Jun-23 13:11 UTC
Updated version of RESTstop and RESTr plus bonus blog post
After last week''s thread with Raimon, I made a couple changes to RESTstop and RESTr (added JSON support). Both GitHub and RubyGems are up-to-date now. I also ended up writing a blog post on how to implement REST services with RESTstop. See http://bit.ly/tareststop - Philippe (@techarch) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20100623/49eedb5e/attachment.html>
Matt Zukowski
2010-Jun-23 13:27 UTC
Updated version of RESTstop and RESTr plus bonus blog post
Awesome! Nice to see restr getting used. I always thought it was a better solution than rest-client, but I guess I''m biased :) On Wed, Jun 23, 2010 at 9:11 AM, Philippe Monnet <ruby at monnet-usa.com>wrote:> After last week''s thread with Raimon, I made a couple changes to RESTstop > and RESTr (added JSON support). > Both GitHub and RubyGems are up-to-date now. > I also ended up writing a blog post on how to implement REST services with > RESTstop. See http://bit.ly/tareststop > > - Philippe (@techarch) > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20100623/2d30a82f/attachment.html>
Matt Zukowski
2010-Jun-23 13:31 UTC
Updated version of RESTstop and RESTr plus bonus blog post
P.S. really nice write up. I think you know more about Reststop now than I do :) On Wed, Jun 23, 2010 at 9:27 AM, Matt Zukowski <matt at roughest.net> wrote:> Awesome! Nice to see restr getting used. I always thought it was a better > solution than rest-client, but I guess I''m biased :) > > On Wed, Jun 23, 2010 at 9:11 AM, Philippe Monnet <ruby at monnet-usa.com>wrote: > >> After last week''s thread with Raimon, I made a couple changes to RESTstop >> and RESTr (added JSON support). >> Both GitHub and RubyGems are up-to-date now. >> I also ended up writing a blog post on how to implement REST services with >> RESTstop. See http://bit.ly/tareststop >> >> - Philippe (@techarch) >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20100623/24fda6f5/attachment.html>
Dave Everitt
2010-Jun-23 13:45 UTC
Updated version of RESTstop and RESTr plus bonus blog post
Added to the Github Camping wiki (with your growing number of links...) - guides these are really useful! - Dave Everitt> I also ended up writing a blog post on how to implement REST > services with RESTstop. See http://bit.ly/tareststop
Raimon Fernandez
2010-Jun-23 14:29 UTC
Updated version of RESTstop and RESTr plus bonus blog post
great !!! thanks, r. On 23jun, 2010, at 15:11 , Philippe Monnet wrote:> After last week''s thread with Raimon, I made a couple changes to RESTstop and RESTr (added JSON support). > Both GitHub and RubyGems are up-to-date now. > I also ended up writing a blog post on how to implement REST services with RESTstop. See http://bit.ly/tareststop > > - Philippe (@techarch) > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20100623/6f14fb31/attachment.html>
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.
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 at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20100625/1a9b82d7/attachment-0001.html>
you need to add `has_many :people` to your Group class On 2010-06-25 4:03 AM, "Raimon Fernandez" <coder at montx.com> 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 at rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20100625/03200500/attachment.html>
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 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-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20100625/25931c69/attachment.html>
hi, it''s working with and without it, but you are right that must be there ... thanks! r. On 25jun, 2010, at 13:52 , Matt Zukowski wrote:> you need to add `has_many :people` to your Group class > > >> On 2010-06-25 4:03 AM, "Raimon Fernandez" <coder at montx.com> 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 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-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20100625/de6cb006/attachment.html>
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. montx at 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.
Hi Raimon use gem intall rather than apt-get - see: http://wiki.github.com/camping/camping/installation BUT it seems you already have Camping 2.0 in your gem list, so what do you see when you run: camping -v ? You might also want to look at your .bash_login (or .bash_profile etc.) PATH. Dave Everitt> 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. > > montx at 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 at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list
hi David, On 3ago, 2010, at 11:33 , Dave Everitt wrote:> Hi Raimon > > use gem intall rather than apt-get - see: > http://wiki.github.com/camping/camping/installationyes, I know, this is how I''ve installed it.> BUT it seems you already have Camping 2.0 in your gem list, so what do you see when you run: > camping -vnothing, it''s not installed: montx at lucid:~$ camping -v The program ''camping'' is currently not installed. You can install it by typing: sudo apt-get install camping> You might also want to look at your .bash_login (or .bash_profile etc.) PATH.the problem was that I was trying to add manually the PATH the gem camping, not the camping bin ... now it works manually: montx at lucid:/var/lib/gems/1.8/bin$ ./camping -v thanks! r.> > Dave Everitt > >> 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. >> >> montx at 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 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 >
I''ve always had issues on Ubuntu with the gem bin path not being added properly to $PATH. It''s frustrating that this hasn''t been addressed. I suspect there''s a issue ticket sitting somewhere out there closed by a grumpy maintainer claiming that additions to $PATH are against debian policy, or some b.s. like that. On Tue, Aug 3, 2010 at 6:03 AM, Raimon Fernandez <coder at montx.com> wrote:> hi David, > > On 3ago, 2010, at 11:33 , Dave Everitt wrote: > > > Hi Raimon > > > > use gem intall rather than apt-get - see: > > http://wiki.github.com/camping/camping/installation > > yes, I know, this is how I''ve installed it. > > > > BUT it seems you already have Camping 2.0 in your gem list, so what do > you see when you run: > > camping -v > > nothing, it''s not installed: > > montx at lucid:~$ camping -v > The program ''camping'' is currently not installed. You can install it by > typing: > sudo apt-get install camping > > > You might also want to look at your .bash_login (or .bash_profile etc.) > PATH. > > the problem was that I was trying to add manually the PATH the gem camping, > not the camping bin ... > > now it works manually: > > montx at lucid:/var/lib/gems/1.8/bin$ ./camping -v > > > thanks! > > r. > > > > > > Dave Everitt > > > >> 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. > >> > >> montx at 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 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 > > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20100803/523e5793/attachment.html>
Hi again, I''ve moved my Camping app from my developer machine to my deployment machine, a lucid linux. I use nginx + thin on all my RoR, and I want to use the same setup for my Camping app. In the log of thin I have this error: "No adapter found for /u/apps/portablechecking" If I go to /u/apps/portablechecking/ and start camping manually there using: montx at lucid:/u/apps/portablechecking$ thin start>> Using rack adapter >> Thin web server (v1.2.7 codename No Hup) >> Maximum connections set to 1024 >> Listening on 0.0.0.0:3000, CTRL+C to stopeverything is OK, I can access to my camping app. If I start manually with the rack file: montx at lucid:/u/apps/portablechecking$ thin -R config.ru start>> Thin web server (v1.2.7 codename No Hup) >> Maximum connections set to 1024 >> Listening on 0.0.0.0:3000, CTRL+C to stopeverything is OK, I can access to my camping app. but when thin gets their config file for my camping app, it can''t find an adapter. here''s the .yml config file for thin: # copy this file to: /etc/thin/ --- user: montx timeout: 30 max_conns: 1024 require: [] environment: production max_persistent_conns: 512 servers: 3 daemonize: true socket: /tmp/thin_portablechecking.sock chdir: /u/apps/portablechecking/ pid: /u/apps/portablechecking/pids/thin.pid log: /u/apps/portablechecking/log/thin.log I''m using unix sockets to comunicate between nginx and thin I''ve posted this question in the thin list but seems the list is ''sleeping'' After some googling I found something that can be related: * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Extracted from here: http://www.eleven33.com/?p=29 %w[ rubygems camping active_record camping/db camping/session reststop json active_support net/http rack ].each { |x| require x} Camping.goes :Operator #So after the Camping Instantiation I use this little piece of code to let thin handle the static files. use Rack::Static, :urls => ["/static", "/images", "/css", "/javascripts"], :root => File.expand_path(File.dirname(__FILE__)) #All my Operator Code goes in here# #Here us the end of my file. To start the Thin + Camping application. Operator::Models::Base.establish_connection :adapter => ?sqlite3?, :database => ?operator.db? Operator::Models::Base.logger = Logger.new(?operator.log?) run Rack::Adapter::Camping.new(Operator) * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * the last line is really necessary ? run Rack::Adapter::Camping.new(Operator) what I''m doing wrong ? thanks ! regards, r.
here''s is my config.ru require ''list'' List.create if List.respond_to?(:create) # call List.create if it exists run List # and run the app! On 6ago, 2010, at 09:52 , Raimon Fernandez wrote:> Hi again, > > > I''ve moved my Camping app from my developer machine to my deployment machine, a lucid linux. > > I use nginx + thin on all my RoR, and I want to use the same setup for my Camping app. > > In the log of thin I have this error: > > "No adapter found for /u/apps/portablechecking" > > If I go to /u/apps/portablechecking/ and start camping manually there using: > > montx at lucid:/u/apps/portablechecking$ thin start >>> Using rack adapter >>> Thin web server (v1.2.7 codename No Hup) >>> Maximum connections set to 1024 >>> Listening on 0.0.0.0:3000, CTRL+C to stop > > everything is OK, I can access to my camping app. > > If I start manually with the rack file: > > montx at lucid:/u/apps/portablechecking$ thin -R config.ru start >>> Thin web server (v1.2.7 codename No Hup) >>> Maximum connections set to 1024 >>> Listening on 0.0.0.0:3000, CTRL+C to stop > > everything is OK, I can access to my camping app. > > > but when thin gets their config file for my camping app, it can''t find an adapter. > > here''s the .yml config file for thin: > > # copy this file to: /etc/thin/ > --- > user: montx > timeout: 30 > max_conns: 1024 > require: [] > > environment: production > max_persistent_conns: 512 > servers: 3 > daemonize: true > socket: /tmp/thin_portablechecking.sock > > chdir: /u/apps/portablechecking/ > pid: /u/apps/portablechecking/pids/thin.pid > log: /u/apps/portablechecking/log/thin.log > > I''m using unix sockets to comunicate between nginx and thin > > I''ve posted this question in the thin list but seems the list is ''sleeping'' > > After some googling I found something that can be related: > > * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * > Extracted from here: http://www.eleven33.com/?p=29 > > %w[ rubygems camping active_record camping/db camping/session reststop json active_support net/http rack ].each { |x| require x} > > Camping.goes :Operator > > #So after the Camping Instantiation I use this little piece of code to let thin handle the static files. > use Rack::Static, :urls => ["/static", "/images", "/css", "/javascripts"], :root => File.expand_path(File.dirname(__FILE__)) > > #All my Operator Code goes in here# > > #Here us the end of my file. To start the Thin + Camping application. > > Operator::Models::Base.establish_connection :adapter => ?sqlite3?, :database => ?operator.db? > Operator::Models::Base.logger = Logger.new(?operator.log?) > run Rack::Adapter::Camping.new(Operator) > * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * > > the last line is really necessary ? > > run Rack::Adapter::Camping.new(Operator) > > what I''m doing wrong ? > > thanks ! > > regards, > > r. > > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list
and my thin version: thin 1.2.7 codename No Hup and camping version: 2.0 still no idea why it is not working ... thanks, r. On 6ago, 2010, at 09:57 , Raimon Fernandez wrote:> here''s is my config.ru > > require ''list'' > List.create if List.respond_to?(:create) # call List.create if it exists > run List # and run the app! > > > > > > > > On 6ago, 2010, at 09:52 , Raimon Fernandez wrote: > >> Hi again, >> >> >> I''ve moved my Camping app from my developer machine to my deployment machine, a lucid linux. >> >> I use nginx + thin on all my RoR, and I want to use the same setup for my Camping app. >> >> In the log of thin I have this error: >> >> "No adapter found for /u/apps/portablechecking" >> >> If I go to /u/apps/portablechecking/ and start camping manually there using: >> >> montx at lucid:/u/apps/portablechecking$ thin start >>>> Using rack adapter >>>> Thin web server (v1.2.7 codename No Hup) >>>> Maximum connections set to 1024 >>>> Listening on 0.0.0.0:3000, CTRL+C to stop >> >> everything is OK, I can access to my camping app. >> >> If I start manually with the rack file: >> >> montx at lucid:/u/apps/portablechecking$ thin -R config.ru start >>>> Thin web server (v1.2.7 codename No Hup) >>>> Maximum connections set to 1024 >>>> Listening on 0.0.0.0:3000, CTRL+C to stop >> >> everything is OK, I can access to my camping app. >> >> >> but when thin gets their config file for my camping app, it can''t find an adapter. >> >> here''s the .yml config file for thin: >> >> # copy this file to: /etc/thin/ >> --- >> user: montx >> timeout: 30 >> max_conns: 1024 >> require: [] >> >> environment: production >> max_persistent_conns: 512 >> servers: 3 >> daemonize: true >> socket: /tmp/thin_portablechecking.sock >> >> chdir: /u/apps/portablechecking/ >> pid: /u/apps/portablechecking/pids/thin.pid >> log: /u/apps/portablechecking/log/thin.log >> >> I''m using unix sockets to comunicate between nginx and thin >> >> I''ve posted this question in the thin list but seems the list is ''sleeping'' >> >> After some googling I found something that can be related: >> >> * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * >> Extracted from here: http://www.eleven33.com/?p=29 >> >> %w[ rubygems camping active_record camping/db camping/session reststop json active_support net/http rack ].each { |x| require x} >> >> Camping.goes :Operator >> >> #So after the Camping Instantiation I use this little piece of code to let thin handle the static files. >> use Rack::Static, :urls => ["/static", "/images", "/css", "/javascripts"], :root => File.expand_path(File.dirname(__FILE__)) >> >> #All my Operator Code goes in here# >> >> #Here us the end of my file. To start the Thin + Camping application. >> >> Operator::Models::Base.establish_connection :adapter => ?sqlite3?, :database => ?operator.db? >> Operator::Models::Base.logger = Logger.new(?operator.log?) >> run Rack::Adapter::Camping.new(Operator) >> * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * >> >> the last line is really necessary ? >> >> run Rack::Adapter::Camping.new(Operator) >> >> what I''m doing wrong ? >> >> thanks ! >> >> regards, >> >> r. >> >> >> >> >> _______________________________________________ >> 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
Raimon Fernandez
2010-Aug-08 10:20 UTC
[solved]Re: nginx + thin + camping => adapter not found
hi, well, finally all is working fine ... there were some problems with thin configuration file and one missing require ''rubygems'' in the config.ru file, that curiosly, it was not necessary when starting thin manually ... thanks, r. On 6ago, 2010, at 18:49 , Raimon Fernandez wrote:> and my thin version: thin 1.2.7 codename No Hup > > and camping version: 2.0 > > still no idea why it is not working ... > > thanks, > > r. > On 6ago, 2010, at 09:57 , Raimon Fernandez wrote: > >> here''s is my config.ru >> >> require ''list'' >> List.create if List.respond_to?(:create) # call List.create if it exists >> run List # and run the app! >> >> >> >> >> >> >> >> On 6ago, 2010, at 09:52 , Raimon Fernandez wrote: >> >>> Hi again, >>> >>> >>> I''ve moved my Camping app from my developer machine to my deployment machine, a lucid linux. >>> >>> I use nginx + thin on all my RoR, and I want to use the same setup for my Camping app. >>> >>> In the log of thin I have this error: >>> >>> "No adapter found for /u/apps/portablechecking" >>> >>> If I go to /u/apps/portablechecking/ and start camping manually there using: >>> >>> montx at lucid:/u/apps/portablechecking$ thin start >>>>> Using rack adapter >>>>> Thin web server (v1.2.7 codename No Hup) >>>>> Maximum connections set to 1024 >>>>> Listening on 0.0.0.0:3000, CTRL+C to stop >>> >>> everything is OK, I can access to my camping app. >>> >>> If I start manually with the rack file: >>> >>> montx at lucid:/u/apps/portablechecking$ thin -R config.ru start >>>>> Thin web server (v1.2.7 codename No Hup) >>>>> Maximum connections set to 1024 >>>>> Listening on 0.0.0.0:3000, CTRL+C to stop >>> >>> everything is OK, I can access to my camping app. >>> >>> >>> but when thin gets their config file for my camping app, it can''t find an adapter. >>> >>> here''s the .yml config file for thin: >>> >>> # copy this file to: /etc/thin/ >>> --- >>> user: montx >>> timeout: 30 >>> max_conns: 1024 >>> require: [] >>> >>> environment: production >>> max_persistent_conns: 512 >>> servers: 3 >>> daemonize: true >>> socket: /tmp/thin_portablechecking.sock >>> >>> chdir: /u/apps/portablechecking/ >>> pid: /u/apps/portablechecking/pids/thin.pid >>> log: /u/apps/portablechecking/log/thin.log >>> >>> I''m using unix sockets to comunicate between nginx and thin >>> >>> I''ve posted this question in the thin list but seems the list is ''sleeping'' >>> >>> After some googling I found something that can be related: >>> >>> * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * >>> Extracted from here: http://www.eleven33.com/?p=29 >>> >>> %w[ rubygems camping active_record camping/db camping/session reststop json active_support net/http rack ].each { |x| require x} >>> >>> Camping.goes :Operator >>> >>> #So after the Camping Instantiation I use this little piece of code to let thin handle the static files. >>> use Rack::Static, :urls => ["/static", "/images", "/css", "/javascripts"], :root => File.expand_path(File.dirname(__FILE__)) >>> >>> #All my Operator Code goes in here# >>> >>> #Here us the end of my file. To start the Thin + Camping application. >>> >>> Operator::Models::Base.establish_connection :adapter => ?sqlite3?, :database => ?operator.db? >>> Operator::Models::Base.logger = Logger.new(?operator.log?) >>> run Rack::Adapter::Camping.new(Operator) >>> * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * >>> >>> the last line is really necessary ? >>> >>> run Rack::Adapter::Camping.new(Operator) >>> >>> what I''m doing wrong ? >>> >>> thanks ! >>> >>> regards, >>> >>> r. >>> >>> >>> >>> >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list