web-dev-qa-db-fra.com

Erreur de certificat Curl lors de l'utilisation de RVM pour installer Ruby 1.9.2

RVM rencontre une erreur de certificat lors de la tentative de téléchargement Ruby 1.9.2. Il semble que curl rencontre un problème de certificat mais je ne sais pas comment le contourner. I ont inclus les informations d'erreur exactes ci-dessous.

$ rvm install 1.9.2
Installing Ruby from source to: /Users/willdennis/.rvm/rubies/Ruby-1.9.2-p180, this may take a while depending on your cpu(s)...

Ruby-1.9.2-p180 - #fetching 
ERROR: Error running 'bunzip2 '/Users/willdennis/.rvm/archives/Ruby-1.9.2-p180.tar.bz2'', please read /Users/willdennis/.rvm/log/Ruby-1.9.2-p180/extract.log
Ruby-1.9.2-p180 - #extracting Ruby-1.9.2-p180 to /Users/willdennis/.rvm/src/Ruby-1.9.2-p180
Ruby-1.9.2-p180 - #extracted to /Users/willdennis/.rvm/src/Ruby-1.9.2-p180
Fetching yaml-0.1.3.tar.gz to /Users/willdennis/.rvm/archives

curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
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). The default
 bundle is named curl-ca-bundle.crt; 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.
ERROR: There was an error, please check /Users/willdennis/.rvm/log/Ruby-1.9.2-p180/*.log. Next we'll try to fetch via http.
Trying http:// URL instead.

curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
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). The default
 bundle is named curl-ca-bundle.crt; 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.
ERROR: There was an error, please check /Users/willdennis/.rvm/log/Ruby-1.9.2-p180/*.log
Extracting yaml-0.1.3.tar.gz to /Users/willdennis/.rvm/src
ERROR: Error running 'tar zxf /Users/willdennis/.rvm/archives/yaml-0.1.3.tar.gz -C /Users/willdennis/.rvm/src --no-same-owner', please read /Users/willdennis/.rvm/log/Ruby-1.9.2-p180/yaml/extract.log
/Users/willdennis/.rvm/scripts/functions/packages: line 55: cd: /Users/willdennis/.rvm/src/yaml-0.1.3: No such file or directory
Configuring yaml in /Users/willdennis/.rvm/src/yaml-0.1.3.
ERROR: Error running ' ./configure --prefix="/Users/willdennis/.rvm/usr"  ', please read /Users/willdennis/.rvm/log/Ruby-1.9.2-p180/yaml/configure.log
Compiling yaml in /Users/willdennis/.rvm/src/yaml-0.1.3.
ERROR: Error running '/usr/bin/make ', please read /Users/willdennis/.rvm/log/Ruby-1.9.2-p180/yaml/make.log
Installing yaml to /Users/willdennis/.rvm/usr
ERROR: Error running '/usr/bin/make install', please read /Users/willdennis/.rvm/log/Ruby-1.9.2-p180/yaml/make.install.log
Ruby-1.9.2-p180 - #configuring 
ERROR: Error running ' ./configure --prefix=/Users/willdennis/.rvm/rubies/Ruby-1.9.2-p180 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/willdennis/.rvm/usr ', please read /Users/willdennis/.rvm/log/Ruby-1.9.2-p180/configure.log
ERROR: There has been an error while running configure. Halting the installation.

Comment puis-je résoudre ou éviter cette erreur?

90
Will Dennis

Au cas où quelqu'un d'autre rencontrerait cela en essayant de mettre à jour vers 1.9.3 (bien que la version n'ait probablement pas d'importance), vérifiez la version de rvm que vous avez. Wayne semble être passé de rvm.beginrescueend.com à rvm.io. Le certificat de sécurité de l'ancien site a expiré, la réponse de curl est donc correcte.

La mise à jour de rvm à partir du nouveau site a résolu ce problème et m'a permis d'avancer.

$ \curl -L https://get.rvm.io | bash -s stable --Rails --autolibs=enabled

Mise à jour : Comme @rodgerdpack l'a mentionné, la commande change et j'ai mis à jour ce qui précède. En général, voir https://rvm.io/ pour la dernière version.

125
jwadsack

Si faites ne voulez pas changer le script ET vous faites ne voulez pas ajouter un certificat "pour toujours" au bundle de certificats. Il existe une solution très agréable et rapide:

#to download the cert
wget http://curl.haxx.se/ca/cacert.pem
#to let curl use it for the next calls
export CURL_CA_BUNDLE=~/cacert.pem

Exécutez ensuite votre script. Pour réinitialiser la variable d'environnement (pour les appels de script ultérieurs qui ne devraient pas utiliser ce certificat), reconnectez-vous à votre système ou désactivez la variable d'environnement:

export CURL_CA_BUNDLE=
40
DanielaWaranie

Curl est invoqué dans .rvm/scripts/fetch, qui sera par défaut dans votre répertoire personnel.

Modifiez-le à l'aide de votre éditeur de texte préféré: par exemple,

 nano ~/.rvm/scripts/fetch

Dans les lignes 56 et 58 (peut varier avec d'autres versions de RVM, bien sûr), vous verrez deux lignes qui commencent

 fetch_command="curl ...

Ajoutez simplement -k après curl, enregistrez et réessayez.

21
Richard Fairhurst

Vous devez télécharger le certificat ca depuis http://curl.haxx.se/ca/cacert.pem et les ajouter à votre fichier curl-ca-bundle-new.crt.

Pour trouver l'emplacement de ce fichier, utilisez:

   $ curl-config --ca

   /usr/share/curl/curl-ca-bundle.crt

Sauvegardez votre fichier curl-ca-bundle.crt:

$ cp /usr/share/curl/curl-ca-bundle.crt /usr/share/curl/curl-ca-bundle.crt.old

Ensuite, vous souhaitez concaténer les deux fichiers en utilisant:

$ cat cacert.pem /usr/share/curl/curl-ca-bundle.crt >> curl-ca-bundle-new.crt
20
dbikard

Peut-être que toutes ces solutions compliquées étaient autrefois nécessaires, mais maintenant tout ce que vous avez à faire est de mettre à niveau RVM et votre problème sera résolu:

$ rvm get stable
$ rvm reload
$ rvm install Ruby-1.9.3-p194
17
Nick Messick

Si cela ne vous dérange pas de désactiver la vérification des certificats en boucle (je ne le fais pas):

echo insecure > ~/.curlrc
14
Vojto

Sur Centos 5.6 (Final), j'ai eu un problème avec l'installation de rvm 1.9.2 L'erreur était:

curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
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). The default
 bundle is named curl-ca-bundle.crt; 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.
ERROR: There was an error, please check /usr/local/rvm/log/Ruby-1.9.2-p290/*.log. Next we'll try to fetch via http.
Trying http:// URL instead.

curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
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). The default
 bundle is named curl-ca-bundle.crt; 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.
ERROR: There was an error, please check /usr/local/rvm/log/Ruby-1.9.2-p290/*.log
ERROR: There has been an error while trying to fetch the source.  
Halting the installation.
ERROR: There has been an error fetching the Ruby interpreter. Halting the installation.

Voici une liste d'actions qui m'ont aidé à résoudre le problème

$ curl-config --ca # show path to the certificate
/usr/local/share/curl/curl-ca-bundle.crt
$ cd /usr/local/share/curl/ # go to that path
$ cp curl-ca-bundle.crt curl-ca-bundle.crt.bak # backup certificate
$ curl http://curl.haxx.se/ca/cacert.pem -o curl-ca-bundle.crt # download new
$ rvm install 1.9.2 # bingo it works

La version curl de BTW est curl 7.18.0 (pour vérifier '$ curl -V')

11
Serge Seletskyy

J'essayais d'installer Ruby-1.9.2-p290 et est tombé sur le même problème. Après avoir exécuté which curl et réalisant que l'instance curl provenait d'une installation de MAMP sur mon système (OS X Snow Leopard), j'ai reconfiguré ma variable PATH pour utiliser la valeur par défaut du système à /usr/bin/curl. En utilisant cette version, curl 7.19.7, Je n'ai eu aucun problème à installer la dernière version de Ruby avec RVM.

3
jerikl

J'ai eu du mal à installer 1.9.2 en utilisant RVM, voici ma solution:

J'ai toujours le fichier non trouvé, mais l'installation a réussi

[2011-07-05 14:24:07] tar zxf /Users//.rvm/archives/yaml-0.1.3.tar.gz -C /Users//.rvm/src --no-same-owner tar (enfant): /Users//.rvm/archives/yaml-0.1.3.tar.gz: impossible d'ouvrir: aucun fichier ou répertoire tel tar (enfant): l'erreur n'est pas récupérable: sortie maintenant tar: enfant retourné état 2 tar : Sortie d'erreur retardée par rapport aux erreurs précédentes

2
dorothy Dorothy

Merci Dorothy - cette recette a fonctionné pour moi avec les modifications mineures suivantes pour un environnement Win7:

Pour les autres personnes ayant ce problème -

  1. Appréciez la discussion sur la mise à jour de CA_Bundle - Bon à faire, mais cela n'a pas aidé avec ce problème - le certificat du site Web pyyaml ​​provoquera toujours une erreur CURL et puisque CURL est lancé dans le programme d'installation, aucun moyen d'ajouter une option -k .

  2. Ruby 1.9.2-p290 essaie d'installer YAML 0.1.4 afin que Google pour un miroir et télécharge cette version - YAML-0.1.3 n'aura aucun effet en contournant les problèmes.

  3. Vous devez faire l'équivalent Windows de CHMOD 777 - dans le dossier rvm/src pour les fichiers extraits. Modifiez la sécurité pour que tout le monde ait la propriété/tous les privilèges et désactivez l'attribut en lecture seule pour tous les fichiers et dossiers.

Le programme d'installation générera toujours des erreurs lorsqu'il tentera de télécharger (erreur CURL), mais reprendra en essayant d'extraire. L'extraction générera des erreurs car l'archive tar est déjà extraite dans le dossier src. L'étape suivante de configuration de YAML devrait fonctionner sans erreur si les autorisations à l'étape 3 ont été définies correctement et l'installation devrait se terminer sans autres problèmes. (Si vous installez via cygwin/bash, vous devrez ajouter un compilateur C comme 'gcc' et ajouter 'ncurses' (commande tput) et 'make' aux options de configuration par défaut de cygwin.)

1
Duke3D
$ Sudo apt-get install curl

$ curl -L https://get.rvm.io | bash -s stable --Ruby   with Ruby

$ curl -L https://get.rvm.io | bash -s stable --Rails   with Rails
0
Matz Heri