腾讯云centos7、centos8、opencloudos8.x ruby 3.x环境配置

2022-11-11 04:39:46 浏览数 (1)

https://github.com/rbenv/rbenv

http://rvm.io/

https://www.ruby-lang.org/en/downloads/

https://www.ruby-lang.org/zh_cn/downloads/

https://www.cnblogs.com/lylongs/p/11302272.html

参考以上资料,集合自己实践,整理如下步骤

yum install git gem -y

gem sources --查看当前使用的源地址

gem sources -a http://mirrors.tencent.com/rubygems/ --添加腾讯云镜像地址,注意最后的上坡斜杠是需要的,否则会报404

gem sources -r https://rubygems.org/ --删除默认的源地址

gem sources -u --更新源的缓存

国内可用key server列表:

keyserver.ubuntu.com

pgp.mit.edu

gpg --keyserver hkp://pgp.mit.edu --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

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

source /etc/profile.d/rvm.sh

rvm list known

rvm install 3.1.2

rvm docs generate-ri

ruby -v

ruby demo.rb

https://cloud.tencent.com/document/sdk

左边展开自己想要调用接口的产品分类,右上选择对应语言,就有相应的sdk配置说明

0 人点赞