最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

CentOS7下安裝Ruby3.2.4的實施路徑詳解

 更新時間:2024年09月18日 09:43:43   作者:fredricen  
在CentOS 7系統(tǒng)上安裝Ruby 3.2.4版本需要先安裝RVM作為版本管理工具,安裝過程涉及到安裝GPG的key、RVM的最新穩(wěn)定版本以及Ruby的前置依賴,下面給大家介紹CentOS7下安裝Ruby3.2.4的實施路徑,感興趣的朋友跟隨小編一起看看吧

一、CentOS版本

[user@zt ~]$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

二、先安裝RVM

RVM是一個linux下的Ruby的多版本管理工具,可以維護多個Ruby版本,切換版本。對于開發(fā)Ruby應用程序比較友好。還有個優(yōu)點就是不需要梯子,對于國內用戶友好。

安裝GPG的key,用于身份驗證

$ gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

安裝RVM最新穩(wěn)定版本

$ \curl -sSL https://get.rvm.io | bash -s stable

三、安裝Ruby的前置依賴

更新gcc版本,默認為4.8.5版本,最好升級到7以上版本,我們這里升級到了9版本,升級gcc版需要先更新yum源

$ yum install centos-release-scl -y

安裝完成后在 /etc/yum.repos.d 目錄下會出現(xiàn) CentOS-SCLo-scl.repo 和 CentOS-SCLo-scl-rh.repo 兩個文件,安裝后源默認啟用,但是坑也就是在這里被埋下了。CentOS 7 最晚在 2024年6月30后 停止更新維護,在此之前在 CentOS 7 可以通過 yum 直接安裝 SCL 源基本都是可以正常使用的。這個時候需要更新源的地址:

$ vi /etc/yum.repos.d/CentOS-SCLo-scl.repo

修改此部分的baseurl為阿里云源

[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/sclo/
# mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-sclo
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
$ vi /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo

修改此部分的baseurl為阿里云源

[centos-sclo-rh]
name=CentOS-7 - SCLo rh
baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/rh/
# mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-rh
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

最后刷新緩存

yum repolist
yum clean all
yum makecache

正式升級gcc版本

yum install devtoolset-9-gcc* -y

顯示如下即安裝成功:

Installed:
  devtoolset-9-gcc.x86_64 0:9.3.1-2.2.el7 devtoolset-9-gcc-c++.x86_64 0:9.3.1-2.2.el7 devtoolset-9-gcc-gdb-plugin.x86_64 0:9.3.1-2.2.el7 devtoolset-9-gcc-gfortran.x86_64 0:9.3.1-2.2.el7 devtoolset-9-gcc-plugin-devel.x86_64 0:9.3.1-2.2.el7

Dependency Installed:
  audit-libs-python.x86_64 0:2.8.5-4.el7     checkpolicy.x86_64 0:2.5-8.el7     devtoolset-9-binutils.x86_64 0:2.32-16.el7    devtoolset-9-libquadmath-devel.x86_64 0:9.3.1-2.2.el7    devtoolset-9-libstdc++-devel.x86_64 0:9.3.1-2.2.el7   
  devtoolset-9-runtime.x86_64 0:9.1-0.el7    gmp-devel.x86_64 1:6.0.0-15.el7    libgfortran5.x86_64 0:8.3.1-2.1.1.el7         libmpc-devel.x86_64 0:1.0.1-3.el7                        libquadmath.x86_64 0:4.8.5-44.el7                     
  libsemanage-python.x86_64 0:2.5-14.el7     mpfr-devel.x86_64 0:3.1.1-4.el7    policycoreutils-python.x86_64 0:2.5-34.el7    python-IPy.noarch 0:0.75-6.el7                           setools-libs.x86_64 0:3.3.8-4.el7                     

Complete!

啟用新版gcc

scl enable devtoolset-9 bash

查看gcc版本:

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-9/root/usr --mandir=/opt/rh/devtoolset-9/root/usr/share/man --infodir=/opt/rh/devtoolset-9/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-9.3.1-20200408/obj-x86_64-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC) 

使當前的終端立即生效:

source /opt/rh/devtoolset-9/enable

四、安裝指定版本的Ruby

CC=/opt/rh/devtoolset-9/root/usr/bin/gcc rvm install 3.2.4

顯示如下即表示安裝成功:

ruby-3.2.4 - #removing src/ruby-3.2.4..
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/7/x86_64/ruby-3.2.4.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for centos.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-3.2.4, this may take a while depending on your cpu(s)...
ruby-3.2.4 - #downloading ruby-3.2.4, this may take a while depending on your connection...
ruby-3.2.4 - #extracting ruby-3.2.4 to /usr/local/rvm/src/ruby-3.2.4.....
ruby-3.2.4 - #configuring..................................................................
ruby-3.2.4 - #post-configuration..
ruby-3.2.4 - #compiling...................................................................................................
ruby-3.2.4 - #installing.....................................
ruby-3.2.4 - #making binaries executable...
Installed rubygems 3.4.19 is newer than 3.0.9 provided with installed ruby, skipping installation, use --force to force installation.
ruby-3.2.4 - #gemset created /usr/local/rvm/gems/ruby-3.2.4@global
ruby-3.2.4 - #importing gemset /usr/local/rvm/gemsets/global.gems................................................................
ruby-3.2.4 - #generating global wrappers........
ruby-3.2.4 - #gemset created /usr/local/rvm/gems/ruby-3.2.4
ruby-3.2.4 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-3.2.4 - #generating default wrappers........
ruby-3.2.4 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-3.2.4 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri

查看RVM使用的當前Ruby版本

rvm list
=* ruby-3.2.4 [ x86_64 ]
# => - current
# =* - current && default
#  * - default

到此這篇關于CentOS7下安裝Ruby3.2.4的實施路徑的文章就介紹到這了,更多相關CentOS7安裝Ruby3.2.4內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

  • Ruby和Ruby on Rails中解析JSON格式數據的實例教程

    Ruby和Ruby on Rails中解析JSON格式數據的實例教程

    這篇文章主要介紹了Ruby和Ruby on Rails中解析JSON格式數據的實例教程,文中介紹到的Ruby on Rails中的JSON解析工具包json_pure使用起來十分方便,需要的朋友可以參考下
    2016-04-04
  • Ruby中使用each和collect進行迭代的用法

    Ruby中使用each和collect進行迭代的用法

    這篇文章主要介紹了Ruby中使用each和collect進行迭代的用法,是Ruby學習中的基礎知識,需要的朋友可以參考下
    2015-05-05
  • ruby中?%W{}和%w{}的使用案例詳解

    ruby中?%W{}和%w{}的使用案例詳解

    %w{}是Ruby中的一種快捷方式,用于創(chuàng)建一個以空格分隔的字符串數組,在使用?%w?時,Ruby?會將字符串中的空格作為分隔符,將其拆分成一個字符串數組,這篇文章主要介紹了ruby中%W{}和%w{}的使用,需要的朋友可以參考下
    2023-06-06
  • ruby中并發(fā)并行與全局鎖詳解

    ruby中并發(fā)并行與全局鎖詳解

    最近在學習ruby,想著將自己學習的內容總結一下分享出來,下面這篇文章主要給大家介紹了關于ruby中并發(fā)并行與全局鎖的相關資料,文中通過示例代碼介紹的非常詳細,需要的朋友可以參考借鑒,下面來一起看看吧。
    2017-09-09
  • Ruby中檢測Gem是否安裝的方法

    Ruby中檢測Gem是否安裝的方法

    這篇文章主要介紹了Ruby中檢測Gem是否安裝的方法,本文直接給出實現(xiàn)代碼以及使用方法,需要的朋友可以參考下
    2015-01-01
  • Ruby on Rails中MVC結構的數據傳遞解析

    Ruby on Rails中MVC結構的數據傳遞解析

    這篇文章主要介紹了Ruby on Rails中MVC結構的數據傳遞解析,本文來自于IBM官方網站技術文檔,需要的朋友可以參考下
    2015-04-04
  • Ruby實現(xiàn)的各種排序算法

    Ruby實現(xiàn)的各種排序算法

    這篇文章主要介紹了Ruby實現(xiàn)的各種排序算法,本文給出了Bubble sort、Insertion sort、Selection sort、Shell sort等排序的實現(xiàn)方法,需要的朋友可以參考下
    2015-05-05
  • Ruby的安裝與運行

    Ruby的安裝與運行

    本文給大家分享的是ruby的基礎知識,是學習ruby必須掌握的ruby的安裝和運行以及ruby的文檔,非常實用,有需要的小伙伴可以參考下。
    2016-02-02
  • 舉例初步講解Ruby中的正則表達式

    舉例初步講解Ruby中的正則表達式

    這篇文章主要介紹了Ruby中的正則表達式,是Ruby學習進階當中的重要知識,需要的朋友可以參考下
    2015-05-05
  • Ruby基礎知識之數據類型

    Ruby基礎知識之數據類型

    這篇文章主要介紹了Ruby基礎知識之數據類型,本文講解了數值類型、字符串類型、字符類型、哈希類型、范圍類型、對象標識、對象的類、類型等內容,需要的朋友可以參考下
    2015-04-04

最新評論

五峰| 鲁甸县| 蒲城县| 青田县| 忻城县| 汕头市| 登封市| 绥中县| 荣昌县| 方山县| 新郑市| 融水| 即墨市| 扎赉特旗| 曲阳县| 舞阳县| 广南县| 尼木县| 呼图壁县| 闽清县| 屏山县| 海晏县| 忻州市| 大余县| 长泰县| 台前县| 景德镇市| 南安市| 东台市| 镶黄旗| 中西区| 海门市| 玛多县| 安阳县| 侯马市| 秭归县| 襄汾县| 卢湾区| 儋州市| 宁南县| 忻州市|