[英]Did I install Ruby 1.9.3 correctly on RHEL?
Before you say yum -y install ruby193
... I did that. 在你说yum -y install ruby193
......我做到了。
Please note that I am not a Ruby developer, but need this program as part of another developer's work via web services. 请注意,我不是Ruby开发人员,但需要将此程序作为另一个开发人员通过Web服务工作的一部分。 (He is not available.) Any help would be greatly appreciated. (他不在。)非常感谢任何帮助。
I attempted to install a library per instructions and got: 我尝试按照说明安装库并得到:
[root@ctbroker console]# gem install json -v '1.8.0'
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension. /opt/rh/ruby193/root/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /opt/rh/ruby193/root/usr/share/include/ruby.h
Gem files will remain installed in /opt/rh/ruby193/root/usr/local/share/gems/gems/json-1.8.0 for inspection.
Results logged to /opt/rh/ruby193/root/usr/local/share/gems/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
I noticed that ruby.h
is only on the machine at /usr/lib64/ruby/1.8/x86_64-linux/ruby.h
. 我注意到ruby.h
只在/usr/lib64/ruby/1.8/x86_64-linux/ruby.h
的机器上。
What am I missing? 我错过了什么?
我能够通过运行来修复我的系统上的这个问题:
sudo yum install ruby193-ruby-devel.x86_64
RHEL yum install scl-utils scl-utils-build
RHEL yum install scl-utils scl-utils-build
CENTOS yum install centos-release-SCL -y
CENTOS yum install centos-release-SCL -y
yum install ruby193 ruby193-ruby-devel augeas-devel libxml2-devel -y
scl enable ruby193 "ruby -v"
scl enable ruby193 "bash"
gem install json -v '1.8.0'
您可能需要先安装以下软件包:
yum install ruby-devel.x86_64 libxslt-devel libxml2-devel
Step 1: Run below command on your terminal: 第1步:在终端上运行以下命令:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
Step 2: Install RVM Development version on your system: 第2步:在您的系统上安装RVM Development版本:
\curl -sSL https://get.rvm.io | bash
For Latest version of Ruby ie 2.2.1 follow below steps: 对于最新版本的Ruby即2.2.1,请按照以下步骤操作:
\curl -sSL https://get.rvm.io | bash -s stable --ruby
After this step you should see a message like: To start using RVM you need to run source /home/user_name/.rvm/scripts/rvm
in all your open shell windows, in rare cases you need to reopen all shell windows. 在此步骤之后,您应该看到如下消息:要开始使用RVM,您需要在所有打开的shell窗口中运行source /home/user_name/.rvm/scripts/rvm
,在极少数情况下,您需要重新打开所有shell窗口。
Step 3: Activate ruby using the message 第3步:使用消息激活ruby
Source /home/user_name/.rvm/scripts/rvm
Step 4: Check Ruby version 第4步:检查Ruby版本
ruby --version
Step 5: Say thanks if it works ;) 第5步:如果有效,请说声谢谢;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.