Re: [Rails] Re: RUBY on Rails CMM level company does not have much employees

2011-09-21 Thread Marc Byrd
Larger companies are reluctant to invest in a technology until it has
demonstrated some level of stability from a specification and tools point of
view.  In this light, breakages in backward compatibility may cause a
technology to acquire a bad reputation that in turn impedes its adoption.

m


On Wed, Sep 21, 2011 at 6:21 PM, pepe p...@betterrpg.com wrote:

  Me, I'm betting on the mammals.

 Good one! :D

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Rails and Service Oriented Architecture (SOA): any downsides?

2011-08-04 Thread Marc Byrd
Lille,

sinatra is WAAAY better than rails for building a web service API - I've
built two API's in sinatra in the past week, one of them took only 1.5h
(this w/ oauth, get/put/post/delete, etc.).  Compare this to when I tried to
build an API in The Rails Way , which at the time was ActiveResource
(which has since gone fallow), which took weeks.

If you're using something like amazon's S3 or SQS or SimpleDB, then
congrats, you're doing SOA.  My understanding is that the culture inside
Amazon was always very heavily SOA-oriented, and top management frowned on
efforts that involved reinventing commodity functions like storage or
queueing - and this led to their cloud business.

The S is SOA is Service - if you want to provide a service, then SOA may be
a good idea.  If you want a nice clean separation between API and everything
above, and if you think your web service API might some day be used by other
business units, partners, mashups, etc., then sure, you can think of it as a
service and you're doing SOA.

AFAIK the only connection between SOA and performance is that you can focus
on optimizing your service, and if you provide a really good service you
could perhaps have economies of scale - but on the other hand you can focus
on optimizing any section of code.

m

On Thu, Aug 4, 2011 at 4:15 PM, Lille lille.pengu...@gmail.com wrote:

 Hey folks,

 I allow that I likely mangled the use of the term 'performance', but I
 think the question stands, because anyone consciously refactoring
 their Rails app to accommodate an SOA approach would surely know it:
 models now implemented as services would respond to HTTP requests or
 messaging services like RabbitMQ.

 Before I list the purported benefits as I have read them, let me set
 context. A part of my Rails app could possibly succeed as its own app,
 while its existence also benefits the rest of the app I have underway.
 Shouldn't I want to develop this independent piece as an autonomous
 service while also allowing for its use by the rest of the app?

 It is said...

 + organizational efficiency - services are isolated, so development
 teams focus on their assigned service(s) alone
 + robustness - services have their own data stores and modifications
 to them is independent from other services
 + scalability - rather than optimize the common Rails data store to
 meet all cases entailed by use of the app, each service and its
 associated use case entails its own particular database optimization

 Lille

 On Aug 2, 4:09 am, Chris Kottom ch...@chriskottom.com wrote:
  SOA and performance are two of the most abused terms in IT, so
 definitions
  matter a lot.  I take the first to mean a set of principles applied to
 the
  design and development of systems and complex solutions (go to Wikipedia
 or
  Google define:SOA for a list) and the second as the ability of a system
 or a
  component of a system to do its work efficiently (more operations in the
  same amount of time, the same number of operations in a shorter time).
  That
  being the case, I have a hard time understanding the original question
  because all of these concepts seem to be more or less orthogonal to one
  another.  Architecture and implementation technology are certainly going
 to
  have an effect on performance, but they don't determine performance or
  scalability (related term, though not the same, also badly abused) as
 much
  as how they're applied which is largely determined by application
 complexity
  and the skill of the development team.
 
  Seehttp://railslab.newrelic.com/scaling-railsfor an introduction to
 things
  that do matter when designing and testing a Rails application for speed.
 
  I have the feeling that none of the answers you've received are really
  answering your question though.  Could you further specify what you've
 heard
  and what you're looking to find out?
 
 
 
 
 
 
 
  On Tue, Aug 2, 2011 at 8:35 AM, Colin Law clan...@googlemail.com
 wrote:
   On 29 July 2011 16:02, Lille lille.pengu...@gmail.com wrote:
Hey folks,
 
I like what I'm reading about improved performance via Service
Oriented Architecture for my Rails app.
 
   I don't see how SOA improves performance, have you some references for
   this assertion?
 
   Colin
 
Stepping in that direction
will require some code reorganization, though. Has anyone regretted
the time invested in Rails SOA or suffered any other drawbacks that
might -- from a business perspective -- have disinclined them from
going SOA?
 
Lille
 
--
You received this message because you are subscribed to the Google
 Groups
   Ruby on Rails: Talk group.
To post to this group, send email to
 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to
   rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at
  http://groups.google.com/group/rubyonrails-talk?hl=en.
 
   --
   You received this message because you are subscribed to 

Re: [Rails] Re: Call Rest webservice in Ruby on Rails

2011-03-04 Thread Marc Byrd
Allow me to second the recommendation to read up on ActiveResource - this is
exactly what it's designed for, and in fact if you're also developing the
ReST API, you can use ActiveResource to impose convention (over
configuration) in your API - plus you'll have a nice test rig when you're
done.

Only issue is whether enough people in the Ruby community see AR this way
and whether it will continue to be maintained.

m


On Fri, Mar 4, 2011 at 10:42 AM, exequiel efu...@gmail.com wrote:

 Hi,

 I never tried this, but it should be something like this:

  required_parameters = [param1=value1, param2=value2]
  ...
   self.response_body = proc do |response, output|
net_http.start do |http|
   http.get(uri.path + '?' + required_parameters.join(''))
case res
 ...

 Maybe, you need to escape the required parameters.

 Cheers.

 On Mar 2, 11:57 am, gs84 salimat...@gmail.com wrote:
  On 1 mar, 19:32, exequiel efu...@gmail.com wrote:
 
   Hi,
 
   To send data from an action I do this:
 
   def send_mydata
 ...
 uri = URI.parse(link)
 net_http = Net::HTTP.new(uri.host, uri.port)
 net_http.open_timeout = timeout
 net_http.read_timeout = timeout
 net_http.use_ssl = (uri.scheme == 'https')# enable SSL/TLS
 if net_http.use_ssl?
   net_http.cert =
   OpenSSL::X509::Certificate.new(File.read(cert_path))
   net_http.key = OpenSSL::PKey::RSA.new(File.read(key_path))
   net_http.verify_mode = OpenSSL::SSL::VERIFY_NONE
 end
 
 self.response_body = proc do |response, output|
   net_http.start do |http|
 http.request_get(uri.request_uri()) do |res|
   case res
 when Net::HTTPSuccess then
   res.read_body do |segment|
 response.write(segment)
   end
 when Net::HTTPRedirection then
   response.close() unless response.closed?
   return
 else
   raise Net::HTTPResponse error: #{res.message.to_s()}
end
 end
   end
 end
   end
 
  Hi,
  How can i set parameters in this case?
 
  Thanks

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Get pid of memcached instance my app is connected to?

2010-07-20 Thread Marc Byrd
CACHE.stats[:pid]

m


On Tue, Jul 20, 2010 at 8:46 AM, Max Williams li...@ruby-forum.com wrote:

 Hi all.  I'm using memcache-client to connect to memcached in my rails
 app.  I'm having some weirdness on my production server and have several
 memcached instances running.  Is there a way to get the pid of the one
 that my app is actually connected to?

 thanks, max
 --
 Posted via http://www.ruby-forum.com/.

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Chat app, Caching? Observe?

2010-05-31 Thread Marc Byrd
You might have a look at node.js - I've heard recently of apps which combine
node.js w/ redis pubsub to get a pretty nifty quick experience w/ no
polling.  From a scalability and performance point of view, this has a
couple of drawbacks - susceptible to network latencies, quality (may be
better suited for intranet), and second, each client may need it's own port
(this for node.js).

Here's a pretty cool little app -
http://www.web2media.net/laktek/2010/05/25/real-time-collaborative-editing-with-websockets-node-js-redis/

cheers,


m


On Mon, May 31, 2010 at 10:46 AM, Greg Ma li...@ruby-forum.com wrote:

 Hi,
 I am developping a little chat application with rails. On my chat page I
 make ajax request every 10 seconds to check if there are news messages.
 I think if I keep this thing with a lot of user my performance will get
 really low.

 How can I improve this? Is is possible to observe when a row is added?
 Or how can I effeciently cache the messages?

 Thanks,
 Greg
 --
 Posted via http://www.ruby-forum.com/.

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] rake clean; rake ; rake install

2010-05-14 Thread Marc Byrd
Feel like such a nube/dweeb for asking but...

Background - I follow redis, redis-rb, and phpredis on github, bleeding
edge, trunk.

With redis I type make clean; make - then I'm good to go

With phpredis i type make clean; make; make install - then I'm good to go
(maybe restart apache2)

What are the steps for making redis-rb from source, installing in the
system, etc.?  Things like rake clean and rake install don't work...

Thanks,


m

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Upcoming app Research and Prep

2010-03-24 Thread Marc Byrd
Life may be much simpler for you when you scale if you use a nosql option,
at least for some things - redis for example is a great replacement for
large join tables (picture tags, user friends, etc.).  Also I've found that
good row-level caching (on one of our projects, 98.5% hit rate) is far
superior to multiple replicas.  In other words, you might try to find ways
to lighten up mysql if not replace it altogether.

Cheers,


Marc
--
getCloudCache.com

On Wed, Mar 24, 2010 at 4:50 PM, brianp brian.o.pea...@gmail.com wrote:

 I wish I had known about this place before I paid for my current
 hosting =S . Unfortunately  I think I'll be staying with my current
 host until I see problems or at least start getting customers.
 As long as I keep scalability in ind through the whole process I
 should be okay. Prepping for multiple db's instances, and backend
 queuing I should be able to move anywhere and scale accordingly...
 right?

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Upcoming app Research and Prep

2010-03-24 Thread Marc Byrd
Well, if you like ActiveRecord and SimpleDB (aws), I recommend
http://github.com/appoxy/simple_record

However, and I don't mean this to inflame anyone, but ActiveRecord may
fundamentally oppose NoSQL - while ActiveRecord makes joins easy (for the
programmer, not so much for the db), those joins don't scale well.  [To
other people's points, a single MySQL can take you a very long way with
minimal joins and good row-level caching.] The NoSQL way is to get (minimal)
results from a single table at a time, then if necessary, do other queries
to get connected data.  In other words, instead of sending joined queries to
the db layer, you unwrap (efficiently) them in your code.

marc
--
getCloudCache.com


On Wed, Mar 24, 2010 at 5:13 PM, brianp brian.o.pea...@gmail.com wrote:



 On Mar 24, 4:59 pm, Marc Byrd dr.marc.b...@gmail.com wrote:
  Life may be much simpler for you when you scale if you use a nosql
 option,

 What nonsql option would you recommend?

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Future of DRb?

2010-02-19 Thread Marc Byrd
What's the future of DRb in Rails 3.0 world?  Is there something else coming
along that will be preferable (e.g. ActiveWorker)?  Starling/Workling?
 SimpleWorker?  Redis/Resque?

Thanks!


Marc

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Memcached

2010-02-16 Thread Marc Byrd
I have it on good authority that ActiveSupport::Cache is a good way to go in
Rails 2.1 and beyond (e.g. Rails 3.0 supports it, backward compatible).

This interface supports many implementations, including CloudCache if you're
on EC2 - see e.g. getCloudCache.com , in particular the video shows how to
configure.

Hope this help,


Marc


On Tue, Feb 16, 2010 at 5:00 PM, Nicholas Wieland 
nicholas.wiel...@gmail.com wrote:

 Hi guys, I remember using memcached in the past, but after the 2.1 release
 I can't figure out how I'm suppose to configured it with different
 environments.
 Cache_fu had a memcached.yml in config/, but I can't find how to configure
 it if for example I want a single small test memcached server in dev mode,
 and a few distributed servers in production.

 Does someone know of documentation or examples on how to configure it ?

 TIA,
  ngw

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] DB query cache

2010-02-10 Thread Marc Byrd
This is an excellent use case for CloudCache - which has introspection, so
you can tell what's in cache when...

Implements ActiveSupport::Cache, so if you're already using that, it's a
coupla lines of change.

See getCloudCache.com

Cheers,


m


On Tue, Feb 9, 2010 at 4:41 PM, Tristan tristanmchar...@gmail.com wrote:

 Hi all

 I've got a problem that's been bugging me for a while now. We have a
 page of news article summaries with links to the full article (pretty
 standard sort of thing). When we create new articles in production
 they appear in the admin index but they don't show on the public index
 for some reason until after the application is restarted.

 So far, I haven't specifically done any caching yet but I was
 wondering if there might be some type of default caching going on
 behind the scenes that I'm not aware of.

 Any thoughts?

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] memcached and fragment caching

2009-11-19 Thread Marc Byrd
Well, you could use something like CloudCache and not worry about allocation
- it's elastic.  There's a drop-in implementation for the
ActiveSupport::Cache interface:

http://github.com/quetzall/cloud_cache/

Of course that's best used if you're on EC2 (or EngineYard on EC2).

m

On Thu, Nov 19, 2009 at 2:41 PM, Philip Hallstrom phi...@pjkh.com wrote:

  a)
  what is a reasonable memory usage for memcached?
  i read on some sites ~1gb while the default on my ubuntu server is
  only 64mb. i understand it's application dependent, but do you think
  that 128mb should be enough for most sites?

 It completely depends on your application.  I've run sites that had 4
 servers with 1gb each, I've run sites that have 64mb... you need to
 figure out how much data you need to store.  Start with 64 and let it
 run for a bit.  Then connect to the memcache server and run 'stats' to
 get some data on how it's doing.   Scroll down till you see the stat
 definition table...
 http://github.com/memcached/memcached/blob/master/doc/protocol.txt

  b)
  what about compression? it gives more cache hits, but is it
  performance costly?

 compression?  Not sure what you mean.  Memcached is very fast.  Most
 people use it because their db isn't fast enough or to lighten the
 load...

 
  c)
  i need a time based fragment expirations. i read about
 
 http://agilewebdevelopment.com/plugins/memcache_fragments_with_time_expiry
  but it return me a plugin not found error.

 You shouldn't need a plugin to get going... add this to your
 environment.rb (or one of the specific ones in environments)

 config.cache_store = :mem_cache_store, localhost, {:namespace =
 'foobar'}

 Then in your views you can do things like:

 % cache(:some_unique_key, :expires_in = 15.minutes) do %
   complicated html goes here...
 % end %

 And all the other caching stuff as well...

 -philip

 --

 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To post to this group, send email to rubyonrails-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=.




--

You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=.




[Rails] Re: ActiveResource as API test rig? Two jsons?

2009-05-28 Thread Marc Byrd
bump...

On Wed, May 20, 2009 at 3:57 PM, Marc Byrd dr.marc.b...@gmail.com wrote:

 Hi,

 I'm using ActiveResource as an API test rig for an API we're developing for
 our PHP app - the goal being to validate that we're following some
 externally validated conventions for ReSTful API and that we can support at
 least one external framework.  ;^)  I'm open to opinions on the wisdom of
 this approach.

 Meanwhile, I'm getting some strange behavior when running from command line
 vs. running w/in rails:

 First, from command line:
 require 'rubygems'
 require 'activesupport'
 require 'activeresource'

 class Channel  ActiveResource::Base
   self.site = http://192.168.1.101/;
   self.format = :json
 end

 c = Channel.find(:all , :params = {:owner = iamwill})

 Result is:
 /var/lib/gems/1.8/gems/activesupport-2.3.2/lib/active_support/json/decoding.rb:14:in
 `decode': Invalid JSON string (ActiveSupport::JSON::ParseError)
 from
 /var/lib/gems/1.8/gems/activeresource-2.3.2/lib/active_resource/formats/json_format.rb:19:in
 `decode'
 from
 /var/lib/gems/1.8/gems/activeresource-2.3.2/lib/active_resource/connection.rb:116:in
 `get'
 from
 /var/lib/gems/1.8/gems/activeresource-2.3.2/lib/active_resource/base.rb:576:in
 `find_every'
 from
 /var/lib/gems/1.8/gems/activeresource-2.3.2/lib/active_resource/base.rb:519:in
 `find'
 from channels.rb:10

 But when I run from rails, it parses no problem.

 I gave the rails version malformed json to cause it to choke to figure out
 the difference:

 vendor/rails/activesupport/lib/active_support/json/decoding.rb:14:in `decode'


 Is it possible to coerce the non-rails version to use the rails json
 parser?  Why are there two different versions?

 Thanks,


 m






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] ActiveResource as API test rig?

2009-05-20 Thread Marc Byrd
Hi,

I'm using ActiveResource as an API test rig for an API we're developing for
our PHP app - the goal being to validate that we're following some
externally validated conventions for ReSTful API and that we can support at
least one external framework.  ;^)  I'm open to opinions on the wisdom of
this approach.

Meanwhile, I'm getting some strange behavior when running from command line
vs. running w/in rails:

First, from command line:
require 'rubygems'
require 'activesupport'
require 'activeresource'

class Channel  ActiveResource::Base
  self.site = http://192.168.1.101/;
  self.format = :json
end

c = Channel.find(:all , :params = {:owner = iamwill})

Result is:
/var/lib/gems/1.8/gems/activesupport-2.3.2/lib/active_support/json/decoding.rb:14:in
`decode': Invalid JSON string (ActiveSupport::JSON::ParseError)
from
/var/lib/gems/1.8/gems/activeresource-2.3.2/lib/active_resource/formats/json_format.rb:19:in
`decode'
from
/var/lib/gems/1.8/gems/activeresource-2.3.2/lib/active_resource/connection.rb:116:in
`get'
from
/var/lib/gems/1.8/gems/activeresource-2.3.2/lib/active_resource/base.rb:576:in
`find_every'
from
/var/lib/gems/1.8/gems/activeresource-2.3.2/lib/active_resource/base.rb:519:in
`find'
from channels.rb:10

But when I run from rails, it parses no problem.

I gave the rails version malformed json to cause it to choke to figure out
the difference:

vendor/rails/activesupport/lib/active_support/json/decoding.rb:14:in `decode'


Is it possible to coerce the non-rails version to use the rails json
parser?  Why are there two different versions?

Thanks,


m

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Deploying Rails App on Debian Etch / Apache2 / Passenger

2009-05-18 Thread Marc Byrd
I also had this problem recently.  A few things I did that ultimately got me
up and running:

   - Used very latest rubygems (1.3.3 in my case) instead of that from
   debian distro
   - make sure the www-data user can read and execute all the rubygems
   (chown, chmod, chgrp, etc.).

Hope this helps,


Marc
--
m...@quetzall.com



On Mon, May 18, 2009 at 8:43 AM, karl kpb...@gmail.com wrote:


 Hi,
 I'm trying to deploy my rails app through passenger on an Apache2 on
 debian etch. When I start to boot the app it doesn't load one of my
 requires throwing an exception which looks like '/usr/local/lib/
 site_ruby/1.8/rubygems/custom_require.rb31  in
 `gem_original_require' ' on the stacktrace. The gem is installed and
 it's located in the correct dir which I can find through 'gem
 environment'. I'm running ruby 1.8.5, passenger 2.2.2 and looking for
 kwalify 0.7.1. .
 Is this a debian bug, what am I missing? The app runs fine with the
 same configuration on my mac.
 Please help,
 Karl

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Deploying Rails App on Debian Etch / Apache2 / Passenger

2009-05-18 Thread Marc Byrd
While I don't recommend this as a long-term solution, it should help know
whether this is the issue (make a backup first w/ current permissions):

chown -R www-data:www-data /usr/lib/...gems

I believe I also did chmod 777 /usr/bin/gem_file

I also modified the /etc/init.d/apache2 script, adding to the ENV line
things like:
ENV=env -i LANG=C
PATH=/usr/local/bin:/usr/bin:/bin:/usr/lib/ruby/gems/1.8/gems/simple_record-1.0.2/bin:/usr/lib/ruby/gems/1.8/gems/cloud_cache-1.0.1/bin

/etc/init.d/apache2 restart -

(The more proper way to do this [should be built into
./bin/passenger-install-apache2-module ?] is to give these files group
permissions, include www-data in the group).

Other observations:
 1)  I had to include the full path for passenger-install-apache2-module,
didn't work as # passenger-install-apache2-module , not found)
 2)  script/console, script/runner, script/server - all worked fine, but
passenger/apache2 didn't work until I got permissions right.

Good luck,


m

On Mon, May 18, 2009 at 11:08 AM, karl kpb...@gmail.com wrote:


 Ok,

 tried these things. The gems are the same.
 Changing permissions doesn't do anything. Running irb as www-data
 works fine. Should be a rails problem since it doesn't work with
 script/console...

 On 18 Mai, 19:33, César cesare.d...@gmail.com wrote:
  Karl,
are you sure that all the gems installed in your Mac and on
  Debian are exactly the same version?
You must check carefully the list of gems and versions in both
  parts to go out of doubt.
 
  Good luck.
 
  Cesar
 
  ___
 
  Gnu/Linux count user #416024
 
  Pagina personal :http://www.cesardiaz.com.ar
  Mi blog :http://cesarediaz.blogspot.com
  Twitter :http://twitter.com/cesarstafe
  My github account:http://github.com/cesarediaz
  Skype: cesarstafe
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] [ANN] CloudCache for Ruby on Rails

2009-05-10 Thread Marc Byrd
Quetzall.com is pleased to announce CloudCache for Ruby on Rails,
implementing the ActiveSupport::Cache interface.  The gem is open source
(Apache License version 2.0) and is available at
http://code.google.com/p/cloudcache-ruby/ .

Steps to install and use:

   1. gem install cloud_cache activesupport right_aws uuidtools
   2. Sign up for the service at http://quetzall.com - note the Quetzall
   Access Key and Quetzall Secret Key
   3. require 'cloud_cache' in config/environment.rb
   4. In app/controllers/application/controller, add:
   5. CC_ACCESS_KEY = '...'
   6. CC_SECRET_KEY = '...'
   7. ActionController::Base.cache_store = :cloud_cache, default,
   CC_ACCESS_KEY, CC_SECRET_KEY
   8. restart apache or webbrick or nginx...

The cost of the service is only a nickle per MB-month.  Plus, we have a
money-back guarantee - if you provide a CloudCache service defect report to
the CloudCachews http://groups.google.com/group/cloudcachews google group
which is reproducible, specific, and actionable (bugs, outages, etc.), we
will reimburse your service costs for that month.  [Disclaimer - service
side only; not including the gem logic or anything else on the public side
of the CloudCache API).

Features include:

   - Elastic, Secure, Reliable
   - Fast! - Latency: 1.5 ms
   - Multi-Get
   - Stats - Hits/Misses/Usage
   - AJAX or XML output
   - Increment/decrement
   - Configurable time-to-live for automatic deletion

Happy Caching!


Marc

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Gem path problems w/ Passenger+Apache2

2009-05-08 Thread Marc Byrd
Anyone else having a dickens of a time getting Passenger+Apache2 to
recognize the gem path?

Many things that work well w/ webbrick just don't work at all with P+A -
require fails.

Here are my versions:
gem 1.3.3 (from source, partly in attempt to get this working...)
Rails 2.3.2
Jaunty Jackalope (32-bit)
passenger 2.2.2
Apache 2.2.11

Thanks,


m

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Gem path problems w/ Passenger+Apache2

2009-05-08 Thread Marc Byrd
Platform - Ubuntu, 32-bit on EC2, jaunty jackalope

On line that says require 'cloud_cache'  it says file not found.

Note that in order to get require 'simple_record'  to load properly I had
to chown www-data:www-data on its files.  I did the same on cloud_cache
files but no joy.

Again, all work perfectly well under webbrick.

thanks,

m



On Fri, May 8, 2009 at 6:17 PM, Conrad Taylor conra...@gmail.com wrote:

 On Fri, May 8, 2009 at 6:13 PM, Marc Byrd dr.marc.b...@gmail.com wrote:

 Anyone else having a dickens of a time getting Passenger+Apache2 to
 recognize the gem path?

 Many things that work well w/ webbrick just don't work at all with P+A -
 require fails.

 Here are my versions:
 gem 1.3.3 (from source, partly in attempt to get this working...)
 Rails 2.3.2
 Jaunty Jackalope (32-bit)
 passenger 2.2.2
 Apache 2.2.11

 Thanks,


 m


 Can you provide some additional details about the platform you're using and
 the actual error message?

 -Conrad


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)

2009-04-15 Thread Marc Byrd
I'm on debian etch w/ ruby1.8, activesupport-2.3.2, getting this on the
first line of code which is require 'active_support' :
/var/lib/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:55:
uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.2/lib/active_support.rb:56
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:33:in
`gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:33:in `require'

Note that this worked as expected on ubuntu (ibix, amd64).

Thanks,


m

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: First public deployment coming up. How to load test?

2009-03-02 Thread Marc Byrd
siege - if you have time but not money -
http://www.joedog.org/index/siege-manual

Soasta - if you have money but not time - http://soasta.com

Cheers,


m




On Mon, Mar 2, 2009 at 7:54 PM, Raphael Lee raphael.t@gmail.com wrote:

 So I've been working on a project for a while with some friends, and we're
 getting ready to launch the beta.

 I've never built a website on this scale, especially not in Rails, and in
 the two weeks I have to prepare I need to figure out how to predict and
 optimize for when traffic (hopefully) hits.

 What sort of tools are commonly used for load testing and analytics?  How
 can I predict what I'll need in two weeks, and what should I do then if
 we're lucky enough to be pounded by traffic?  How much traffic do you think
 a 256MB Slicehost slice with Passenger behind Apache could support?  Should
 I use Rails's built-in caching?

 Thanks!  Any advice, even if anecdotal, is welcome.
 Raph

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] ActiveSupport::Cache vs. others?

2009-02-10 Thread Marc Byrd
Hi,

We are building and using a new caching gem.  We would like to figure out
how to make this most friendly and easy for both existing projects and new
projects to use.  I'm guessing the best way to get used in new projects
would be via subclassing the ActiveSupport::Cache::Store class?  Is this
expected to be the primary way to use a cache going forward?

What about gems that may be widely used in existing projects like cached_fu,
memcached, etc. ?   Are these expected to be rolled in through
ActiveSupport::Cache over time?

If you had to chose one cache interface to speak (e.g. drop-in replacement,
small constructor diff only, or config diff only), which one would you
suggest?  And if only two, which two?

Thanks,


Marc

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Track number of clicks on a link

2008-09-25 Thread Marc Byrd
Note that writing to the db every time something on your site is viewed can
really limit your capacity and scale and hasten the day when you'll need to
think about multi-master configuration.  So unless you're using something
like amazon SimpleDB, which scales for you, it might be better to figure out
a better way to track view counting (e.g. central log server, cron job to
aggregate and update db?).


m


On Thu, Sep 25, 2008 at 1:52 PM, Dan Paul [EMAIL PROTECTED] wrote:


 Thanks for the response, sorry I'm totally new to this any way you can
 elaborate or show example? Any help would be greatly appreciated,
 thanks in advance

 On Sep 25, 11:53 am, andres [EMAIL PROTECTED] wrote:
  On Thu, 2008-09-25 at 11:35 -0700, Dan Paul wrote:
   Hello,
 
   So I am trying to simply track the number of hits a link has received
   and display that number on the site so other users can see which links
   are more popular. So once the link is clicked on it adds a +1 value to
   the hits column in the database and then redirects the person to the
   url that the link is supposed to go to. So far this is what I have.
 
   I have a tutorials table in my database and a column for hits and a
   column for url.
 
   ** tutorials_controller.rb **
 
   def update_hits_count
@tutorial.update_attribute :hits, params[:count].size + 1
  if @tutorial.save
 redirect_to url_for(@tutorial.url)
  end
   end
 
  modify the method so it suits any controller,
  like in self.update_attribute
  add the method to application_controller
  whenever you want to add a hit you call it,
  like in
  def index
  update_hits_count
  end
 
 
 
 
 
   ** view/tutorials/show.html.erb **
 
   % for tutorial in @tutorials %
   %=link_to tutorial.title, {:action = 'update_hits_count', :count
   = tutorial.hits} %
   % end %
 
   That is what I have so far and when you click on the link the hits
   column in the tutorials table just gets set to null and it does not
   redirect them to the proper url.  Any help would be greatly
   appreciated.  Thanks in advance.
 
   
  --
 
   smime.p7s
  7KViewDownload

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---