現在RailsTutorialをやっていてページに表示する画像をrailsアプリケーションのapp/assets/imagesファイルにダウンロードしないといけません。
環境はWindows10にVirtualBoxとVagrantというソフトをインストールしてローカル環境で勉強しています。
仮想環境のOSはCentOS6というものです。
コンソール画面にて以下のコマンドを入力したのですがエラーが出て取得できません。
[vagrant@localhost sample_app]$ curl -o app/assets/images/rails.png -OL railstutorial.jp/rails.png % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (60) Peer certificate cannot be authenticated with known CA certificates More details here: http://curl.haxx.se/docs/sslcerts.html curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.
エラーメッセージを翻訳してみると以下のようになりました。
curl:(60)ピア証明書は既知のCA証明書では認証できません 詳細はこちら:http://curl.haxx.se/docs/sslcerts.html curlはデフォルトで "バンドル"を使ってSSL証明書の検証を行います。 認証局(CA)公開鍵(CA証明書)のリスト。 デフォルトの場合 バンドルファイルが適切ではありません。代替ファイルを指定できます --cacertオプションを使用します。 このHTTPSサーバが、で表されるCAによって署名された証明書を使用する場合 バンドルでは、証明書の検証が失敗した可能性があります。 証明書に問題があります(有効期限が切れているか、名前が URLのドメイン名と一致しません。 curlによる証明書の検証を無効にしたい場合は、 -k(または--insecure)オプション
「バンドルファイルが適切ではありません」とあるのですが、これは現在作っているsample_appのバンドルファイルのことですか?
メッセージにある-kコマンドを使用してみたのですがうまくいきませんでした。
[vagrant@localhost sample_app]$ curl -o -k app/assets/images/rails.png -OL railstutorial.jp/rails.png curl: (6) Couldn't resolve host 'app'
よろしくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/08/04 20:57
2019/08/05 08:42
2019/08/05 11:13
2019/08/05 11:53
2019/08/05 13:11
2019/08/05 13:38
2019/08/05 14:24
2019/08/05 14:29
2019/08/05 15:25