How do I install Ruby 1.9.3 with RVM? - ruby

I am attempting to install Ruby with RVM. I already have Ruby installed, but I have now installed RVM and am trying to install Ruby 1.9.3 using rvm 1.9.3 and I get the following error:
Error running ' ./configure --prefix=/Users/anderskitson/.rvm/rubies/ruby-1.9.3-p0 --
enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/anderskitson/.rvm/usr ', please read /Users/anderskitson/.rvm/log/ruby-1.9.3-p0/configure.log
There has been an error while running configure. Halting the installation.

rvm 1.9.3 will not install Ruby. It will tell RVM to switch to using Ruby 1.9.3 after it has been installed. Did you mean rvm install 1.9.3?
Have you installed all the dependencies? Try rvm requirements.
Check the output of rvm info, and make sure everything looks sane.
To uninstall XCode: https://stackoverflow.com/a/7960899/128421

Related

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

Unable to uninstall Ruby 2.0.0

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.

Can't install Ruby 1.9.3 on Mac OSX 10.7.5

Yes, I know there's some questions posted regarding issues of installing Ruby 1.9.3 on Lion, mainly because of problems with later versions of Xcode (4.3.2 in my case).
However, I've tried all there is to try that's posted here on Stack regarding this manner, and nothing helps. It starts to compile, one minute or two passes and then suddenly halts.
As examples I've tried with the following (of course I have GCC installer installed):
rvm install 1.9.3
rvm install 1.9.3 --with-gcc=clang
rvm install 1.9.3 --with-gcc=gcc-4.2
If running rvm install 1.9.3 the following error shows during the compilation (which halts the installation):
Error running 'make', please read /Users/henrikpetersson81/.rvm/log/ruby-1.9.3-p374/make.log
There has been an error while running make. Halting the installation.
Here you can read the log file from the latest build fail:
http://jsfiddle.net/hyhrk/
Last thing I've tried was to follow the updated guide in this answer. Same problem.
What can be the problem here?
NOTE. I've the following installed:
Ruby 1.8.7
Homebrew 0.7.1
RVM 1.17.10
GCC installer 4.2.1
Xcode 4.3.2
Command Line Tools
RVM has an updated command to install all required libraries:
rvm get head
rvm requirements run
It might ask you for your password (for sudo).
After that run:
rvm install 1.9.3 --with-opt-dir=`brew --prefix readline` --without-tcl --without-tk
Update RVM 1.19+
RVM takes care of it all:
rvm get stable
rvm autolibs homebrew
rvm install 1.9.3
It looks like there are issues with readline. Since you're using Homebrew, you can try this:
brew install readline
rvm install 1.9.3 --with-readline=`brew --prefix readline`

Which ruby version is installed?

Sounds strange but I cannot tell which ruby version is installed. If I do
rvm rubies
I get
ruby-1.9.2-p180 [ i686 ]
but with
ruby -v
I get
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
When trying to
rvm upgrade 1.8.7-p302 1.9.2-p180
I get an error
ERROR: Ruby 'ruby-1.8.7-p302' is not installed - please install it first.
ERROR: Error migrating gems.
So, which one is it? 1.8.7-p302 or 1.9.2-p180 ???
Please help me out here! Thanks
You get 1.8.7 from the installed version of your system. Use rvm use --default 1.9.2 in order to set the Ruby installed via rvm as default.
RVM basically changes your $PATH variable to point to a different Ruby version than the one installed on your system.
Please also make sure that you have done steps 2 and 3 of the installation guide and confirmed that RVM is correctly set up.
You might have 1.8.7 because you did sudo apt-get install ruby or something like that, and then later ran rvm install 1.9.2. Is that the case?
The answer is both as mentioned by other posters. As a recommendation you should uninstall the ruby packages that come with the system if you choose to manage ruby version using rvm.

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