#2
不懂才问2019-02-22 06:34
感觉好像这篇发错地方了,应该发在Ruby里。
补充点,一楼最后我想装的是带Tk的Ruby,我有点强迫症,但应该不是太严重。凡是一种语言,刚开始学的时候,总想搞出个窗口来。 于是,继续探索如何让Linux的Ruby带上Tk。 试了用gem install tk,出错,如下: 程序代码: [root@centos7 ~]# ruby -v ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux] [root@centos7 ~]# gem install tk Fetching: tk-0.2.0.gem (100%) Building native extensions. This could take a while... ERROR: Error installing tk: ERROR: Failed to build gem native extension. 又是一通百度,https://,说是需要ActiveTcl。 ActiveState,加拿大的一个软件公司,把Tck/Tk做成安装包了,直接就可以安装。下面是两个下载的网页,第二个能下载的版本多一点点。 https://www. http://downloads. 还有Go,这个网站要记下来,为接下的Go学习做准备。 另一种说法是去Tck/Tk的官网去下载和安装,这个没试。文章链接如下:https:// 因为是用rvm安装和管理ruby和相关软件的,所以,http://www.上说的也是ActiveTcl。所以先试第一种。 下载之后,四步曲:解压,cd,安装,出错。每次装软件基本都会这样。 程序代码: tar -zvxf ActiveTcl8.5.18.0.298892-linux-x86_64-threaded.tar.gz cd ActiveTcl8.5.18.0.298892-linux-x86_64-threaded/ ./install.sh ____________________________________________ Launching graphical installer on :0 ... ./payload/bin/wish8.5: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory 百度了一下,解决办法如下: yum install libXScrnSaver 然后再: ./install.sh 想着,先试试gem gem install tk ok了,可以用了。 可是,强迫症又犯病了,文章中和rvm官网说rvm reinstall的方法,也要试试。 原路返回: gem uninstall tk 再换条路进来: rvm reinstall 2.3.3 --enable-shared --enable-pthread --with-tk --with-tcl 没啥悬念,想想就知道肯定行,不过那几个参数干什么的不懂了。 程序代码: [root@centos7 ~]# gem list --local *** LOCAL GEMS *** bigdecimal (default: 1.2.8) bundler (default: 1.16.6) bundler-unload (1.0.2) did_you_mean (1.0.0) executable-hooks (1.6.0) gem-wrappers (1.4.0) io-console (default: 0.4.5) json (default: 1.8.3) minitest (5.8.5) net-telnet (0.1.1) power_assert (0.2.6) psych (default: 2.1.0) rake (10.4.2) rdoc (default: 4.2.1) rubygems-bundler (1.4.5) rvm (1.11.3.9) test-unit (3.1.5) [root@centos7 ~]# gem uninstall tk Gem 'tk' is not installed [root@centos7 ~]# rvm安装的tk不受gem管理 |
CentOS安装的时候,我选的是中文带GUI的服务器,其他的都没勾。
http://www.
rvm官网对安装过程说的还是很清楚的,除了一句英文也看不懂之外,这个网站做的还是很靠谱的。
第一步:终端su到root
第二步:gpg --keyserver hkp://keys. --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
官网和一些帖子都这么说的
第三步有点小问题:如果按官网和那些帖子的说法,会出现这样的错误:
程序代码:
gpg: 无法检查签名:没有公钥
GPG signature verification failed for '/usr/local/rvm/archives/rvm-1.29.7.tgz' - 'https://'! Try to install GPG v2 and then fetch the public key:
sudo gpg2 --keyserver hkp://pool. --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
or if it fails:
command curl -sSL https:// | sudo gpg2 --import -
command curl -sSL https:// | sudo gpg2 --import -
In case of further problems with validation please refer to https://
GPG signature verification failed for '/usr/local/rvm/archives/rvm-1.29.7.tgz' - 'https://'! Try to install GPG v2 and then fetch the public key:
sudo gpg2 --keyserver hkp://pool. --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
or if it fails:
command curl -sSL https:// | sudo gpg2 --import -
command curl -sSL https:// | sudo gpg2 --import -
In case of further problems with validation please refer to https://
所以,要先用上面两个命令之一,更新个签名还是秘钥什么的,不是很懂Linux
我用的第二个,好使。
程序代码:
[root@centos7 rubystudy]# curl -sSL https:// | sudo gpg2 --import -
gpg: 密钥 D39DC0E3:“Michal Papis (RVM signing) <mpapis@”未改变
gpg: 合计被处理的数量:1
gpg: 未改变:1
[root@centos7 rubystudy]# curl -sSL https:// | sudo gpg2 --import -
gpg: 密钥 39499BDB:公钥“Piotr Kuczynski <piotr.kuczynski@”已导入
gpg: 合计被处理的数量:1
gpg: 已导入:1 (RSA: 1)
gpg: 密钥 D39DC0E3:“Michal Papis (RVM signing) <mpapis@”未改变
gpg: 合计被处理的数量:1
gpg: 未改变:1
[root@centos7 rubystudy]# curl -sSL https:// | sudo gpg2 --import -
gpg: 密钥 39499BDB:公钥“Piotr Kuczynski <piotr.kuczynski@”已导入
gpg: 合计被处理的数量:1
gpg: 已导入:1 (RSA: 1)
然后再做官网第二步:\curl -sSL https://get. | sudo bash -s stable
为什么前在加个“\”,还没时间去弄懂,回头再说
第四步,激活rvm命令:source /etc/profile.d/rvm.sh
接着就可以rvm -v 查看版本
或者:rvm list known 查看可以装点什么
usermod -a -G rvm root 将用户加入组这一项,好像不用也可以,
usermod -a -G rvm rubystudy 我为什么不能像帖子里那样,一条命令把两个用户都加入组呢?
最后,就是主角了:rvm install 2.3.3