I installed ruby 1.9.1 on my Debian Squeeze. After that I tried to install ruby gems, but
aptitude why-not rubygems1.9.1
i ruby1.9.1 Conflicts rubygems1.9.1
I have /usr/lib/ruby/1.9.1/rubygems/ in my filesystem, but I havn't any binary file like rubygems1.9.1 or gems. What shall I do?
Just run the gem1.9.1 command anyway. The reason ruby1.9.1 conflicts with rubygems1.9.1 is because rubygems has been integrated into the ruby1.9.1 package.
Related
I get the error
Error installing jekyll:
jekyll requires Ruby version >= 2.0.0.
when I run
sudo gem install jekyll
"ruby -v" says I have ruby version 1.9.3
How do I install Jekyll? Do I need to upgrade ruby? If so, how?
Update - I installed ruby 2.0.0 with rvm but get the same error. Since trying to install with gem, could that still be trying to install with the older version of ruby? If so, how to find and change?
Try
sudo gem install jekyll -v 2.5
The default command apparently tries to install Jekyll 3, which was released on October 27th 2015. The 2.5 version still works with Ruby 1.9.3, and its quite allright for me, probably for you too.
I solved this issue the following way (assuming the ruby2.0 package is installed):
sudo rm /usr/bin/ruby
sudo rm /usr/bin/gem
sudo ln -s /usr/bin/ruby2.0 /usr/bin/ruby
sudo ln -s /usr/bin/gem2.0 /usr/bin/gem
Quick explanation:
/usr/bin/ruby and /usr/bin/gem are symlinks, you can check their target by entering:
ll /usr/bin/ruby
ll /usr/bin/gem
Changing the target of these links results in changing your default ruby and gem execution. Switching to version 2.0 for instance, lets you install Jekyll 3.
You can give a try to:
sudo apt-get install ruby2.0 ruby2.0-dev
sudo gem2.0 install jekyll-import
I try the following on Ubuntu 14.04:
sudo apt-get install ruby2.0 ruby2.0-dev
sudo apt-get install zlib1g-dev
sudo gem2.0 install jekyll
If you've already installed a later version of Ruby AND you're using rbenv, and gem gives the same error, it is because you are still using the old version of gem. There are now two executables called gem in your filesystem. Figure out which gem is the default with "which":
$ which gem
If you see something like */.rbenv/shims/gem, this is not the version of gems that you want to use. The correct version of gem will be in /.rbenv/versions/[your preferred version, i.e. 2.0.0]. You can run that version of gem by including the full path to the executable:
$ sudo /path/to/correct/gem install jekyll
So I tried to install ruby through rbenv on my new ubuntu 12.04LTS running on VirtualBox.
I got rbenv from https://github.com/sstephenson/rbenv and ruby-build from https://github.com/sstephenson/ruby-build.
and then i run the following but build fails :(
rbenv install 2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...
BUILD FAILED
Inspect or clean up the working tree at /tmp/ruby-build.20130506102349.2564
Results logged to /tmp/ruby-build.20130506102349.2564.log
Last 10 log lines:
installing default gems: /home/shivin/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0 (build_info, cache, doc, gems, specifications)
bigdecimal 1.2.0
io-console 0.4.2
json 1.7.7
minitest 4.3.2
psych 2.0.0
rake 0.9.6
rdoc 4.0.0
test-unit 2.0.0.0
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?
Any help would be appreciated. Let me know if you need any more details. Thanks!
You are going to need libssl-dev. For best results install all of the requirements which rvm autolibs function will install for you. Some of them (like sqlite3) presume that you will ultimately be wanting to install Rails, but aren't harmful if you don't need them.
Most probably you need the openssl extension as a prerequisite :
sudo apt-get install openssl
should to the trick. Relaunch your RBENV install afterwards.
Hit the same issue. moschop's suggestion on the thread worked!
sudo apt-get install libssl-dev
and then
rbenv install 2.0.0-p247
You will have to rehash everytime you install a Ruby version or a gem
rbenv rehash
Make a Ruby version default:
rbenv global 2.0.0-p247
I had to do a lot of juggling when I tried to install Ruby 1.9.3, and it is mentioned in community that ruby1.9.1 is the package to be installed for Ruby 1.9.3. Now, if i run ruby, I get
<internal:gem_prelude>:1:in `require':
cannot load such file -- rubygems.rb (LoadError)
from <internal:gem_prelude>:1:in `<compiled>'
What can I do?
FYI, I uninstalled everything in my comp by sudo apt-get remove --purge ruby1.8 libruby1.8
Then I installed Ruby1.9.1 by sudo apt-get install ruby1.9.1 libruby1.9.1
What do i do?
EDIT:
After the comments, I used rvm to install newer ruby 1.9.3, ANd now everything is perfect.
MORAL:
dont use apt-get for ruby. Use rvm, gem and other ruby tools. It's brilliant.
If you installed Ruby system-wide with apt then the latest RubyGems won't be included in the install. Ruby is the language, RubyGems is the package manager which has to be installed separately.
To install RubyGems just go here and follow the instructions:
Download from above.
Unpack into a directory and cd there
Install with: ruby setup.rb (you may need admin/root privilege)
For more details and other options, see: ruby setup.rb --help
I'm running Ubuntu 11.10 and installed Ruby 1.9 like this:
$ sudo apt-get install ruby1.9 rubygems
Everything is working very well but ri seems to have empty documentations. ri told me that the documentations were empty and I had to install them. I executed this because I read it would help:
$ rdoc --all --ri
Now, when I try to open any documentations:
$ ri Array
Nothing known about Array
I get the same for everything else I search.
what about this ?
apt-get install ri1.8
EDIT
or try this: (non rvm)
gem install rdoc rdoc-data
rdoc-data --install
You are probably using ri1.8 by default. Try running 'ri1.9.1', as you would run ruby1.9.1 when needing that specific version. Using 'update-alternatives' you should be able to set 1.9.1 as default (somehow).
this works for me
sudo apt-get install ri
"install ri" installs 1.8 (on Ubuntu 12.04 at least). Use
sudo apt-get install ri1.9
The documentations do not come immediately with Ruby installations, even up to 1.9.3. An effective shortcut to installing Ruby Documentation is to use the code:
sudo apt-get install ri
No need to specify which version as terminal will capture the documentation from the latest Ruby information, and this should work as long as you have the latest Ruby version installed on Ubuntu.
apt-get install ruby
Installs ruby 1.8.7
When I install ruby 1.9.2 from sources via ./configure make install, ruby is not installed (ruby -v gives nothing).
So how can I install ruby 1.9.2 on Ubuntu?
I use rvm Ruby Version Manager on my ubuntu-10.04.1-desktop. With ruby-1.9.2 , ruby 1.8.7
no problem.
on 10.10 "Maverick Meerkat": apt-get install ruby1.9.1
on 10.04 "Lucid Lynx": Ruby 1.9.2 was only released a couple of weeks ago, it didn't exist when Lucid was frozen.
You can install ruby 1.9.1 with
sudo apt-get install ruby1.9.1
ruby 1.9.2 is not available for lucid (but I have not checked backports).
You can also proceed to upgrade the ruby installation,
as below,
sudo apt-get upgrade ruby