Unable to uninstall Ruby 2.0.0 - ruby

i'm using rvm, i installed ruby 2.0 with rvm but i need to uninstall it to get ruby 1.9.3. But my terminal is doing strange things:
MacBook-Pro-Kuba:~ Kuba$ gem install bundler
Successfully installed bundler-1.3.5
Parsing documentation for bundler-1.3.5
1 gem installed
MacBook-Pro-Kuba:~ Kuba$ sudo rvm all do uninstall ruby
Preparing Uninstall...
Uninstall Began...
Uninstall Failed...
Reason: ErrorMissingBundle
So as you can see i'm definitely having bundler installed, and it's throwing this error. What should i do?
(i use mountain lion)

Why do you need to uninstall ruby2.0 to get ruby1.9.3? The whole idea of rvm is that you can have (and switch between) many different versions.
List the Rubies with rvm list.
Install (if required) with rvm install 1.9.3.
Swap to it with rvm use 1.9.3.

Related

can't get sass command working on mac with 'brew install sass/sass/sass'

I installed Ruby many moons ago but never use it. Perhaps I inadvertently broke it as I seem to be having troubles with getting it working with the sass command.
After running the brew install sass/sass/sass I get the following error with sass command:
rbenv: sass: command not found
The `sass' command exists in these Ruby versions:
2.1.10
2.5.0
ruby -v yields:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
which I'm guessing is the stock version of Ruby on a mac.
The rbenv command prints out help so it looks like I have that installed. brew list shows I have the ruby package installed. I upgraded ruby with brew but that didn't help (it reported I upgraded from 2.6.1 to 2.6.2. I don't appear to have rvm installed.
If you're using RVM you shouldn't need to brew install anything, in fact you shouldn't.
See documentation here https://github.com/sass/ruby-sass which is deprecated and will refer you to use https://github.com/sass/sassc-ruby instead.
brew uninstall any ruby and ruby packages and just use rbenv to manage your ruby versions.
Once you set your ruby version with rbenv global 2.6.1 for example or whatever version you want, then just do
gem install sassc
Or in your Gemfile add
gem 'sassc`
and run
bundle install

Error installing gems: cannot load such file -- zlib

I'm trying to install bundler gem on Mac OS Yosmite
~/code/hello gem install bundler
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
I've done the following:
Install zlib through homebrew
Upgrade Rubygems
Reinstall RVM and Ruby 2.2.2
Switched to Rbenv and Ruby 2.2.2
This is really doing my head in. Ruby 2.2.1 works fine but 2.2.2 causes this issue whenever I try to install a gem.
Anyone got any ideas?
The following worked for me:
brew install homebrew/dupes/zlib
rvm reinstall 2.2.2 --with-zlib-dir=/usr/local/Cellar/zlib/1.2.8
Hope this helps anyone else who runs into it.
Try rvm pkg install zlib
(from this question)
RVM pkg docs: https://rvm.io/packages
It also looks like RVM has a more up to date way of managing packages called autolibs. Check rvm autolibs show, which I hope will be default(enabled) since you just installed. If it's not, rvm autolibs enable, or you can even tell it to use Homebrew instead of its own manager with rvm autolibs homebrew.
RVM autolibs docs: https://rvm.io/rvm/autolibs

Ruby 1.9.3 Not overriding 1.9.1 gems

I am using Ubuntu 12.04 and I have system default ruby 1.8 and 1.9.1 and 1.9.3. The problem is that I do manage to switch to 1.9.3 but not the gems for the 1.9.3 and by default system is using the 1.9.1 gems. This causes a lot of errors while using the rails and other ruby libs which are dependent on the 1.9.3.
I tried to use
sudo update-alternatives --config ruby
sudo update-alternatives --config gems
and it doesn't offered me to choose 1.9.3 gems but only managed to switch the ruby interpreter. I tried rbenv and rvm but no use. While using the rails and the shoes, I get plenty of errors related to the gems of 1.9.1.
Also when I use the switch with rvm, it asks me to install ruby 1.9.3 which is already installed but doesn't show up for rvm and rbenv.
Is there something wrong with ruby on this system?
you might be confusing compatibility level with the real ruby version, all ruby 1.9.x will have 1.9.1 in their paths - it is the intended behavior.
using rvm you can mount system installed rubies:
rvm automount
OR:
rvm mount /path/to/bin/ruby193 -n system193
but those system rubies might have some extra configuration that can make them not to work well with RVM, you might be better with just installing fresh ruby:
rvm get head
rvm requirements # make sure to read it
rvm use 1.9.3 --install
if you care for performance and value your time you an use falcon patch and compilation on more cores:
rvm install 1.9.3 --patch falcon -j 3
rvm use 1.9.3

When I tell rvm to install ruby 1.9.2 It ends up installing 1.8.7

Well, when I run rvm install 1.9.2. It tells me to issue rvm reinstall 1.9.2. Though, when I do so, I get 1.8.7 reinstalled. 1.8.7 is the only interpreter listed by rvm list.
The O.S. is Ubuntu without rvm-ruby installed. Rvm is at its latest version.
Any suggestion on how to fix this?
I fixed this by removing the .rvmrc file from my home directory and then issuing rvm install 1.9.2.

I'm confused, what's the easiest way to install Ruby 1.9.2 on OS X?

My current version is ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10]
Step 1. Install Homebrew: https://github.com/mxcl/homebrew
This enables you to install various *IX projects on a mac. You may need to install xcode as part of this, so you may need your OS X disc to hand. Homebrew is useful for many other things - a good thing to have installed anyway.
Step 2. Install Ruby Version Manager:
brew install rvm
Step 3. Install whichever Ruby version you want. This means you can have multiple Ruby installations (with their own sets of rubygems) running independently of one another. for 1.9.2 try this:
rvm install 1.9.2
If you get a 'readline' error, try this:
rvm package install readline
rvm remove 1.9.2
rvm install 1.9.2 --with-readline-dir=$rvm_path/usr
You should now be able to do this to test your ruby version:
ruby --version
To switch back to another version of ruby, just use the rvm command.
You can try rvm to install whatever the version of ruby.
if you will get error
undefined method `path' for Gem:Module (NoMethodError)
during command
~/rubygems-1.3.7 $ ruby setup.rb
remove ruby and rubygems with command
sudo autoremove ruby
sudo autoremove rubygem
ant try to install all again

Resources