• 升级ruby到2.0


    本文部分内容转载,如侵犯个人利益请联系博客管理员及时删除,或留言之评论区

    一、安装库

    Yum install –y gcc* openssl* wget

    二、安装ruby

    wget https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.gz

    tar  zxvf ruby-2.2.3.tar.gz

    cd ruby-2.2.3

    ./configure --prefix=/usr/local/ruby

    make

    make install

    ln -sf /usr/local/ruby/bin/* /usr/bin/

    三、安装openssl支持(使用net-ssh时,必须)

    cd  ruby-2.2.3(源码)/ext/openssl

    ruby extconf.rb

    make

    make install

    注:make时可能会报错

    make: *** No rule to make target `/include/ruby.h', needed by `ossl_x509revoked.o'.  Stop.

    解决方法:修改 Makefile 在最上面增加变量 top_srcdir = ../.. 即可。

    四、gem源更换为国内源,提高下载速度

    gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.com/

    gem sources –l

    五、安装 net-ssh,net-sftp,net-scp(选装)

    gem install net-ssh -v 2.10.1.rc1

    gem install net-sftp

    gem install net-scp

    gem list(查看已安装库)

    安装完后使用

    require 'net/ssh'

    require 'net/sftp'

    可能会报错,这时是版本问题,解决方法

    gem install net-ssh -v 2.10.1.rc1

    记录零碎的记忆,最后汇成一片属于自己的知识的星海
  • 相关阅读:
    网站要满足用户的期望
    在网站内如何引导你的用户
    网站要一步一步的引导用户
    photoshop:制作sprite拼贴图片
    photoshop:css3插件
    注册表修改PSD关联photoshop
    photoshop:找不到增效工具入口点
    ajax:$.get()
    Photoshop支持ico输出
    JavaScript数字精度丢失问题总结
  • 原文地址:https://www.cnblogs.com/yylyu/p/10308924.html
Copyright © 2020-2023  润新知