Skip to content

Instantly share code, notes, and snippets.

@tc
Created July 25, 2009 02:20
Show Gist options
  • Save tc/154661 to your computer and use it in GitHub Desktop.
Save tc/154661 to your computer and use it in GitHub Desktop.
$ script/console
Loading production environment (Rails 2.3.2)
P>> Person.all
RestClient::RequestFailed: HTTP status code 400
from /var/lib/gems/1.8/gems/rest-client-1.0.3/lib/restclient/request.rb:195:in `process_result'
from /var/lib/gems/1.8/gems/rest-client-1.0.3/lib/restclient/request.rb:125:in `transmit'
from /usr/lib/ruby/1.8/net/http.rb:543:in `start'
from /var/lib/gems/1.8/gems/rest-client-1.0.3/lib/restclient/request.rb:123:in `transmit'
from /var/lib/gems/1.8/gems/rest-client-1.0.3/lib/restclient/request.rb:49:in `execute_inner'
from /var/lib/gems/1.8/gems/rest-client-1.0.3/lib/restclient/request.rb:39:in `execute'
from /var/lib/gems/1.8/gems/rest-client-1.0.3/lib/restclient/request.rb:17:in `execute'
from /var/lib/gems/1.8/gems/rest-client-1.0.3/lib/restclient.rb:65:in `get'
from /var/lib/gems/1.8/gems/couchrest-0.32/lib/couchrest/core/adapters/restclient.rb:13:in `get'
from /var/lib/gems/1.8/gems/couchrest-0.32/lib/couchrest.rb:157:in `get'
from /var/lib/gems/1.8/gems/couchrest-0.32/lib/couchrest/core/database.rb:81:in `view'
from /var/lib/gems/1.8/gems/couchrest-0.32/lib/couchrest/more/../mixins/collection.rb:157:in `load_target'
from /var/lib/gems/1.8/gems/couchrest-0.32/lib/couchrest/more/../mixins/collection.rb:146:in `method_missing'
from /usr/lib/ruby/1.8/irb.rb:302:in `output_value'
from /usr/lib/ruby/1.8/irb.rb:151:in `eval_input'
from /usr/lib/ruby/1.8/irb.rb:263:in `signal_status'
from /usr/lib/ruby/1.8/irb.rb:147:in `eval_input'
from /usr/lib/ruby/1.8/irb.rb:146:in `eval_input'
from /usr/lib/ruby/1.8/irb.rb:70:in `start'
from /usr/lib/ruby/1.8/irb.rb:69:in `catch'
from /usr/lib/ruby/1.8/irb.rb:69:in `start'
from /usr/bin/irb:13>> exit
$ sudo tail -4 /usr/local/var/log/couchdb/couch.log
[Sat, 25 Jul 2009 02:17:17 GMT] [info] [<0.32355.2>] 127.0.0.1 - - 'PUT' /profiles/_design/Person 201
[Sat, 25 Jul 2009 02:17:17 GMT] [info] [<0.32356.2>] 127.0.0.1 - - 'GET' /profiles/_design/Person/_view/all?reduce=false&include_docs=true 400
$ curl -vX GET http://127.0.0.1:5984//profiles/_design/Person/_view/all?reduce=false
* About to connect() to 127.0.0.1 port 5984 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0)
> GET //profiles/_design/Person/_view/all?reduce=false HTTP/1.1
> User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8
> Host: 127.0.0.1:5984
> Accept: */*
>
< HTTP/1.1 400 Bad Request
< Server: CouchDB/0.10.0a793262 (Erlang OTP/R12B)
< Date: Sat, 25 Jul 2009 02:16:32 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 86
< Cache-Control: must-revalidate
<
{"error":"query_parse_error","reason":"Invalid URL parameter `reduce` for map view."}
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
$ curl -vX GET http://127.0.0.1:5984//profiles/_design/Person/_view/all
* About to connect() to 127.0.0.1 port 5984 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0)
> GET //profiles/_design/Person/_view/all HTTP/1.1
> User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8
> Host: 127.0.0.1:5984
> Accept: */*
>
< HTTP/1.1 200 OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment