2012-06-20 2 views
1

저는 CouchRest Model을 사용하여 irurchouch.com에서 내 Couch 인스턴스를 호스팅하고 간단한 Sinatra 앱으로 몇 가지 테스트를하고 있습니다.CouchDB : ruby가 아닌 curl을 사용하는 이상한 query_parse_error

class User < CouchRest::Model::Base 
    property :first_name, String 
    property :last_name, String 
    timestamps! 

    design do 
    view :by_first_name 
    end 
end 

내가 성공적으로 새 사용자를 만드는거야 :

http://test_admin:[email protected]:80/blt/_design/User/_view/by_first_name?include_docs=true&reduce=false 
"Accept"=>"application/json" 
"Accept-Encoding"=>"gzip, deflate" 
"Content-Type"=>"application/json" 
:

User.create(:first_name => "Stonewall", :last_name => "Jackson") 

이 HTTP 요청에서 User.by_first_name.all 결과를 실행 여기에

내가 사용하고 간단한 모델입니다

이것은 CouchRest를 통해 RestClient에 의해 실행됩니다. 거기에 문제 없습니다.

{"error":"query_parse_error","reason":"Query parameter `include_docs` is invalid for reduce views."} 
내가 여기에 무슨 일이 일어나고 있는지 이해하고 싶습니다

: 나는 curl이 URL을하려고 할 때

는하지만, 나는 include_docs 매개 변수에 대한 소파 불만을 얻을. 왜 include_docs은 컬을 사용할 때만 문제가됩니까?

+1

실행 한 전체'curl' 명령 행을 표시 할 수 있습니까? – smathy

답변

1

단점은 URL에 물음표가 포함되어 있다는 것입니다. 셸의 URL을 보호하지 않으면 특수 문자로 해석됩니다.

서비스를보다 간단하게 테스트하려면 curl 대신 RESTClient을 사용할 수 있습니다.