How Can I install ruby on Redhat? ruby package not found - ruby

I dont' know why I cannot install ruby through yum in my RHEL6.2
How can I fix it. I don't wanna install through source. Any idea?
[root#kithost ~]# yum install ruby
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Setting up Install Process
No package ruby available.
Error: Nothing to do
RVM is a solution but it is not that I want.
What I want to know is that once we can't find any package from yum, what kind of thing should we fix into order to let yum find it?

Probably the best way to install and manage Ruby is using RVM. Moreover, you can use more than one ruby versions using RVM. I can bet, it's really something you may love it. Yum is sometime a curse :-).
Follow their installation guide as there are different methods of (with pros and cons) installations and choose your preferred one. I'm pretty sure, you will love it too.
However, if you are still thinking to use it, you may follow this Guide. Be aware, I don't not know whether it works or not as I did not try it. Why should I try something else, when I'm already using BEST one :)!

Redhat does not have a free repo list unless you pay, or make subscription to them.
The reason for that I cannot install ruby is that there is no availalbe repo list
check
/etc/repo.list
you can copy the one from CentOS to Redhat.
Then your yum could search a available repo server and make your ruby downloadable.

RVM is a good solution but I found that rbenv was much better including when you have to use Ruby on a server.
You can find how to install rbenv in the README.

Related

Specify ruby version to use with Pik

I need to run two Ruby apps on a Windows 2008 server. So, I'm thinking to install Pik for the job (I understand I could use also RVM but the install process doesn't seem very 'stable' to me).
Before installing Pik, however, I'd like to know if there is a way to specify which Ruby version should be used for each app. Something like a .ruby-version file. I have looked for the answer on the official Pik repo but I couldn't find anything about it.
In my opinion, Ref 1, Ref 2 are the two simple references you could have to install different ruby versions using Pik in Windows.
After setting up the environment correctly, you could just use the command similar to RVM.
pik use ruby-2.0.0-p0
Then ruby -v will show ruby 2.0.0p0. So, for different projects, from with in each project folder choose which ruby you want to have.
Hope it helps :)

Connecting to MSSQL from Ruby on Rails from Ubuntu

The title sums up the whole problem.
To use RoR, I was suggested to use Linux, so I got a VirtualBox and got Ubuntu 13 on it, installed RVM and RoR and now I'm pretty stuck.
I need to access the MSSQL from Ruby from inside the Ubuntu, and I don't have a single clue.
A question of relevance was this question, but the answer links seemed to have expired, and the one that isn't, I can't make out a method of how to do it.
Any approach suggestions?
Its very simple if you use freetds. Install freetds library. Its available in ubuntu repository.
sudo apt-get install freetds
Then follow the instructions here

Better way to manage libraries required for gems?

I consistently run into issues with gems not having the required libraries on a server. RMagick is one, and usually mysql2, which usually require installing the dev versions such as:
imagemagick libmagickcore-dev libmagickwand-dev
My question is, is there a better way to manage this? I'm using bundler and capistrano, so it would be great if somebody could point me in the right direction.
The big problem I can see is that distros will change from server to server, but if I had a task I could run which could check the existence of these required packages based on the Gemfile, that would be tremendously helpful. Is this possible?
You can extend section 'cap deploy:setup'. =And in this section run 'apt-get instal imagemagick libmagickcore-dev libmagickwand-dev'. But you user must have sudo access.
Also you can read this manual

RubyGems via MacPorts a good idea?

Upon upgrading from a MB to a new MBP, Apple's migration assistant didn't move my gems.
I'm installing rubygems via macports this time, hoping to avoid this upon next upgrade.
Are there any pitfalls I should be aware of?
If you want your gems installed in your home directory (which should copy over during a transfer, and, as a side benefit, will let you run gem install as yourself, rather than root), set the gemhome: key to a path in your home directory in your ~/.gemrc.
Where were your gems installed? The migration assistant only moves files in certain areas; I'm not sure if it copies files from places like /usr/local or /opt/local, you may have to do that manually (in which case, you can just copy the entire tree over to your new machine).
That said, you shouldn't have a problem installing gems using the version of RubyGems installed by MacPorts.
Installing a package manager via a package manager seems like it should be wrong.
Assuming you are not going to use the system ruby, and will only be using ruby installed via MacPorts; it should not be a problem.
If you plan on using gems with system ruby, you might have problems when Apple upgrades the system version of ruby, unless you are installing your gems in /Library/Ruby/Gems/
I'm going to assume you can just copy the gems to /Library/Ruby/Gems/1.8/gems from /opt/local/lib/ruby/gems but I wouldn't count on it working 100% with every gem.
The migration assistant doesn't move a lot of unix level stuff. This will be true of the macports installed gems as well (which typically live in /opt/local/lib/ruby/gems).
I use macports gem, and this generally works fine with the macports ruby. Be sure you know which ruby executable your shell ends up using, and perhaps use symlinks to control it specifically. I prefer using the macports version so that I'm not beholden to Apple's update schedule. Sadly macports iteself is somewhat inferior to package managers offered on bsd/linux distributions.
I would say don't use MacPorts. People that use their operating systems version of RubyGems often end up with an out of date gem version and then run into problems when they try to update their version of rubygems. Installing Rubygems from source is easy, and it's not hard to install gems when you get a new machine, I mean how often does that really happen????
I just installed ruby 1.8.7 with macport and when I launch scripts with gems, it complains that it doesn't know them.
Anyway to add cleanly the gems in the path of my macport ruby?
Gam
PS: I installed the gems via system gem
What no one mentioned rvm?
Use rvm to manage all of your ruby issues - seriously!

Local installation of ruby / rubygems with no root access

I have a machine at work from wich I'd like to run a script that gathers some information about other machines. I want to do it in Ruby, since it's what I know best, but I've ran into some problems, all apparently due to the same reason: I don't have root access in this machine.
So what I did was: Download ruby source, configure (with --prefix pointing to somewhere under my home dir), make, make install. Alright, ruby runs fine. Then I did the same with rubygems and installed it. Ok as well, untill I went to install my first gem.
I downloaded the gem package (sigh, lots of firewalls, can't just "gem install" something remote), net-ssh, and tried to install it locally. Got the infamous "no such file to load -- zlib". Clues about this led nowhere, so I tried the next approach: getting net-ssh's source. When it tries to require 'openssl' (or when I try it from irb), I get "no such file to load -- openssl".
All of these problems, apparently, could be solved by apt-getting or rpm installing, or whatever. Only problem is: I can't!
Any suggestions as to how I might proceed?
Thanks for the help,
Marcelo.
Closing this now.
I had to ask someone with root access to install zlib-devel and openssl-devel (I'm on RHEL). Couldn't make it otherwise.
I'm guessing there's probably a way of using the stuff inside said packages without installing them as root, but I couldn't do it.
Did you try Ruby RVM?
You can download, compile and install a full-featured Ruby version on your home environment.
I recently did the same. The trick that worked for me is NOT to use a --prefix flag when you install rubygems.

Resources