我試圖運行curl命令包如下Ruby代碼裏面:爲什麼在Windows中運行時無法識別'curl'?
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
然而,輸出我得到的是:
'curl' is not recognized as an internal or external command, operable program or batch file
我在Windows 7
運行我還在環境路徑中設置了「C:\ Windows \ System32」。
請幫忙。
「C:\ Windows \ System32 \ curl.exe」確實存在於該位置。我不認爲這是Windows的標準配置。 – Alex
除非*有*要做其他事情,否則使用Python的請求包進行抓取。這是解決問題的更簡潔的方法。如果你不能使用Requests,那麼內建的'httplib'不如使用curl更好,但仍比使用curl更好。 –
[Curb](https://github.com/taf2/curb)gem是一個很好的與libcurl接口的方式,比使用'popen'更方便。 –