Did I install Ruby 1.9.3 on RHEL correctly?

Before you say yum -y install ruby193 ... I did it.

Please note that I am not a Ruby developer, but I need this program as part of another developer work through web services. (It is not available.) Any help would be greatly appreciated.

I tried to install the library according to the 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 located on the machine in /usr/lib64/ruby/1.8/x86_64-linux/ruby.h .

What am I missing?

+6
source share
4 answers

I managed to fix this problem on my system by doing:

 sudo yum install ruby193-ruby-devel.x86_64 
+9
source

RHEL yum install scl-utils scl-utils-build

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' 
+4
source

Step 1. Run the command below on the terminal:

 gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 

Step 2: Install the version of RVM Development on your system:

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

For the latest version of Ruby ie 2.2.1, follow these steps:

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

After this step, you will see a message like: To start using RVM, you need to run source /home/user_name/.rvm/scripts/rvm in all open shell windows, in rare cases you need to open all shell windows again.

Step 3: Activate the ruby ​​with a message

 Source /home/user_name/.rvm/scripts/rvm 

Step 4: Verify the Ruby Version

 ruby --version 

Step 5: Say thanks if it works;)

+1
source

You may need to install the following packages first:

 yum install ruby-devel.x86_64 libxslt-devel libxml2-devel 
0
source

Source: https://habr.com/ru/post/954262/


All Articles