0

I am trying to run a Curl command wrapped inside Ruby code as below:

 f=IO.popen("C:\Windows\System32\curl.exe -H 'Authorization: Bearer #{token}' -s -v -D - http://api.pageuppeople.com/v1/NAS/Config/LanguageDictionary/Overrides --debug 2>NUL").readlines

However, the output I get is:

'curl' is not recognized as an internal or external command, operable program or batch file

I am running on Windows 7.

I also have "C:\Windows\System32" set in the environment path.

Please help.

4

4 に答える 4

1

curlWindows のコンポーネントではありません。特別にインストールしない限り、システムには存在しません。

私は Ruby の専門家ではありませんが、Net::HTTPここでは Ruby ライブラリーまたはそれに類似したものを実際に使用する必要があると思います。がインストールされているシステムでもcurl、それを起動するのは HTTP 要求を実行する賢明な方法ではありません。

于 2013-10-17T03:52:02.353 に答える