There is no apt-get install ruby1.9.2 yet on Linux? - ruby

The page http://www.ruby-lang.org/en/downloads/ only says 1.9.1 for Linux.
Right now I am using RVM to do an
rvm install 1.9.2
and it needs compilation. There is no apt-get install way to install it?
Is there a way to list all Ruby version apt-get can install?

To list available versions you can use the following command:
apt-cache search --names-only '^ruby1.*'
If you use Debian, 1.8, 1.9, 1.9.1 are availble on testing. 1.9.2 is only available on unstable.

in debian squeeze and sid the 1.9.1 package is in fact based on the 1.9.2 branch according to this search:
http://packages.debian.org/search?keywords=ruby1.9.1&searchon=names&suite=all&section=all
and the changelog says that too:
http://packages.debian.org/changelogs/pool/main/r/ruby1.9.1/ruby1.9.1_1.9.2~svn28788-1/changelog

It's only been 3 weeks, give it some time :P

You can do it for ruby1.9.1
ruby1.9.1-dev

rvm now supports binary rubies, so there is no need to compile:
rvm get head # this change will be available in rvm 1.16
rvm list remote
rvm mount 1.9.3
only ruby 1.9.3 is good for installing in relative paths so do not expect earlier versions to be available (for other path then /usr/local/rvm).
if rvm list remote was empty then let me know what is your system rvm info, you can find me on irc mpapis at #rvm at freenode servers or open a ticket here: https://github.com/wayneeseguin/rvm/issues/new

Related

installing RubyGem on CentOs 5

My ultimate goal is to install Sass.
To do this I need to install RubyGems
To do this I need to install Ruby.
I installed Ruby with yum.
I then tried to install gem with yum yum install rubygem
The response is "nothing to do" and yet when I write gem install sass I get:
gem: command not found
I decided to try to install rubygems 2.2.2 manually. After downloading it, I tried to run ruby setup.rb and in response I get:
Rubygems now requires Ruby 1.8.7 or later
But yum does not seem to be able to install anything later than 1.8.5.
So now I'm trying to do this manually.
I downloaded Ruby 1.9.2 to my home directory and followed these instructions: http://howboring.com/post/1226760251/centos-5-and-rails-3-and-ruby-1-9-2
This seems to work, but the problem is ruby1.9.2 is installed in my home directory (i.e. ~/ruby1.9.3 not system wide.
Thus in the directory where I installed ruby 1.9.2 ruby -v still gives 1.8.5 but ./ruby -v returns 1.9.2. And which ruby returns /usr/bin/ruby (I suppose I could replace this with a symlink that points to ~/ruby1.9.2/ruby but this doesn't seem like a "best practice")
So my main question is where should install ruby 1.9.2 with Root Permissions so that 1.8.5 is replaced with 1.9.2 system wide.
My corollary question is: is there any easier way to do this? (perhaps install sass without install rubygems??)
I then tried to install gem with yum yum install rubygem
You have a typo in the package name, it is actually named rubygems.
Can i suggest Wayne Seguins excellent rvm (ruby version manager). As the home page states:
"RVM is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems".
Site has comprehensive installation instructions. I've posted a truncated Set of instructions for installing on POSIX systems below, but please refer to the projects' home page as:
"we have spent massive amounts of man hours debugging the installation process. Please use the install process(es) from this site only, as this is the only supported installation types and methods."
Install RVM (development version):
\curl -sSL https://get.rvm.io | bash
Close out your current shell or terminal session and open a new one (preferred). You may load RVM with the following command:
user$ source ~/.rvm/scripts/rvm
test the installation was successful:
user$ type rvm | head -n 1
this should output "rvm is a function"
List all known rubies:
rvm list known //this will output a large list of rubies shortened here
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-p374]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p320]
[ruby-]1.9.3[-p545]
[ruby-]2.0.0-p353
[ruby-]2.0.0[-p451]
[ruby-]2.1[.1]
[ruby-]2.1-head
ruby-head
...
install the version you want:
rvm install 1.9.2
You can set a version of Ruby to use as the default for new shells. Note that this overrides the 'system' ruby:
rvm use 2.1 --default
You can also temporarily use another version of your ruby versions
rvm list known //lists system available rubies
Choose to use another ruby
rvm use 1.9.3
RVM is a great tool, well documented, and actively developed, it handles a wider scope of functionality than i can list here, and it's a tool I use everyday.
You can use rbenv to install ruby and rubygems that you need
https://gist.github.com/jpfuentes2/2002954

Ubuntu: How do I install ruby 1.8.7 specifically?

I can't use RVM, this is a server not just for me, so I can't have RVM attached only to my user. Is there a way to install RVM universally? or is there a command where I can specify the version of ruby I want?
The RVM Installation Guide covers a "Multi-User Install". It will walk you through installing RVM in /usr/local/rvm.
But... you may not need RVM...
If I recall correctly, Ubuntu's default Ruby is version 1.8.7. You can look in the Software Center or use Synaptic Package Manager for which Ruby version is available for install. If you want to see available Ruby packages from the command line then use sudo apt-cache search ruby. Once you determine the Ruby version is 1.8.7 then you can install it using your method of choice.
Usually only a very limited set of versions is available. You can see them with apt-cache policy <package>. If you see one you want, you can specify it with apt-cache install <package>=<version>.
More often, you would just build from source precisely the version you want. Downloading the deb file for a particular version and installing it with dpkg is also a possibility, but keep in mind that dpkg won't be able to download and install dependent packages.

rvm determine and install latest version of ruby

So far I only know how to do commands like
rvm 2.0.0
Fortunately Google tells me
The current stable version is 2.0.0-p247.
But shouldn't I be able to use rvm to do that step for me? I can't figure out how to just tell rvm to install the latest version of ruby, without manually specifying it.
it is enough to:
rvm get stable
rvm use ruby --install --default
it will update rvm, check for latest ruby - install it if missing - and set as default
I don't know of a way to have rvm just install the latest version automatically, but here's three simple commands using just rvm:
rvm reload
rvm list known # This will show all the available versions, including the latest
rvm install <latest_version> # Replace <latest_version> with the latest shown by the last command
rvm install ruby-head should install the last known version.

why my ruby version is still an old version on ubuntu after I installed ruby1.9.2?

I am newbie to ubuntu and ROR. After installed latest ruby1.9.2 with apt-get, type "ruby -v" it still shows up old version ruby1.8.7. I tried to reinstall with rvm, nothing changed.
As mentioned in similar question, I tried to remove ruby, and reinstall ruby1.9.1-full... still the same thing...
What else I can do about this?
ubuntu uses a something called alternatives for chosing between two version of similar executable. Running
sudo update-alternatives --config ruby
and chosing the ruby you want should do the trick
I'm using RVM myself, but if I remember correctly, ruby1.8 and ruby1.9 can be installed side by side on Ubuntu. ruby is just a symbolic link which points to version 1.8 by default - which should be called ruby1.8 and stored in the same directory. 1.9 will be called ruby1.9.
So just find where ruby symbolic link is (whereis ruby) and change it so it points to ruby1.9.
sudo rm /path/ruby
sudo ln -s /path/ruby1.9 /path/ruby
Sounds like you are using rvm, but still referencing system ruby. To switch, you have to tell rvm what version to use.
rvm use 1.9.2
This will switch your current environment only. So ruby -v in your current shell will use the right version. (you should probably go with 1.9.3, FWIW) If you want to always use that ruby be default, you type:
rvm use 1.9.2 --default
If you want to switch back to system ruby, you can use:
rvm use system
I think it is because the package of Ruby version at apt-get repository is an old version.
I suggest use rbenv to install the latest version.
Here is a great tutorial using rbenv to install the latest Ruby version from Digital Ocean:
https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-14-04
sudo apt-get install ruby1.9
should do the trick.
You can find what libraries are available to install by
apt-cache search <your search term>
So I just did apt-cache search ruby | grep 9 to find it.
You'll probably need to invoke the new Ruby as ruby1.9, because Ubuntu will probably default to 1.8 if you just type ruby.

Installing Ruby 1.9.1

I can't install ruby 1.9.1. I tried installing macports, homebrew, and RVM. I installed macports but somehow when I used the commands it didn't work. Installing homebrew was a problem in of itself. Ditto for RVM.
Can anyone provide step by step instructions on how to do this on a mac leopard.
Geez, didn't think it would be this difficult.
I highly recommend figuring out RVM because switching back and forth between different versions of Ruby (and Rails) is a breeze.
If you installed Macports correctly, RVM should be easy to install with the following commands:
$ sudo gem install rvm
$ rvm-install
If you are having issues with MacPorts, check and see if your PATH is set up properly. I had to add this line to the top of my .bash_profile file (which is a hidden file in my home directory):
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
You can read more here: http://guide.macports.org/#installing.shell
Once MacPorts and RVM are installed, you can add versions of Ruby like so:
$rvm install 1.9.2-head
$rvm install 1.8.7
I didn't install 1.9.1 but it's probably '$rvm install 1.9.1'. Remember not to use 'sudo' to install ruby after you've installed RVM.
Dan Benjamin's ruby installation instructions helped me.

Resources