Ruby has disappeared. Help me reinstall ruby-1.9.3-p194 - ruby

I'm brand new to Ruby and Ruby on Rails, and am currently going through Michael Hartl's Ruby on Rails tutorial. Or at least I was before trying to load install some open source code led me down a dark journey. I somehow managed to delete any version of Ruby from my computer and RVM won't let me reinstall it using rvm install 1.9.3 (or using the Jewelry Box). I also tried uninstalling Xcode and installing osx-gcc-installer per other instructions I found to no avail.
Added context: running ruby -v makes the system hang.
Here's the error:
ruby-1.9.3-p194 - #configuring
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/usr/local/rvm/usr/lib ./configure --enable-shared -- disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p194', please read /usr/local/rvm/log/ruby-1.9.3-p194/configure.log
There has been an error while running configure. Halting the installation.
Here's the relevant part of the log:
checking build system type... x86_64-apple-darwin12.2.0
checking host system type... x86_64-apple-darwin12.2.0
checking target system type... x86_64-apple-darwin12.2.0
checking whether the C compiler works... no
configure: error: in `/usr/local/rvm/src/ruby-1.9.3-p194':
configure: error: C compiler cannot create executables
See `config.log' for more details
Any help would be greatly appreciated!

Reinstall everything!!!
That may sound like a noob one-hit-wonder type of solution. But trust me when I say it will save you time
EDIT:
Things to do is...
Install homebrew, if you don't already have it.
Implode RVM. This would take down all the rubies and remove RVM
If you are on OS X Mountain Lion, run CC=/Developer/usr/bin/gcc. This uses good old gcc
Reinstall RVM
rvm install 1.9.3
Enjoy (:

If you're on Mac OS X, you might have a much easier time getting Ruby 1.9.3-p194 using homebrew.
The installation with homebrew installed should be as easy as:
$ brew install ruby
There are quite a few other resources available to you that are linked specifically by version; Lion, Snow Leopard, Leopard, etc... at download ruby.

I think you can edit as follows and it will be resolved
https://github.com/railsinstaller/railsinstaller-nix/issues/10

Related

Trouble installing Ruby 2.0.0-p247 via RVM (OSX Mountain Lion)

My ultimate goal is to install the current version of Ruby on Rails. I am running on OS X Mountain Lion. Here's my process so far:
Installed RVM
$ \curl -L https://get.rvm.io | bash -s stable
Checked for known (and I assume approved) installs
$ rvm list known
I see that the current stable build is available
[ruby-]2.0.0[-p247]
Key in command to install
$ rvm install 2.0.0-p247
Note: I also tried these install commands
$ rvm install ruby-2.0.0-p247
$ rvm install ruby=2.0.0-p247
I'm getting nowhere fast. Results:
$ rvm install 2.0.0-p247
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-2.0.0-p247.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/xxxxx/.rvm/rubies/ruby-2.0.0-p247, this may take a while depending on your cpu(s)...
ruby-2.0.0-p247 - #downloading ruby-2.0.0-p247, this may take a while depending on your connection...
ruby-2.0.0-p247 - #extracted to /Users/xxxxx/.rvm/src/ruby-2.0.0-p247 (already extracted)
ruby-2.0.0-p247 - #configuring........
Error running './configure --prefix=/Users/xxxxx/.rvm/rubies/ruby-2.0.0-p247 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --without-tcl --without-tk --enable-shared',
please read /Users/xxxxx/.rvm/log/ruby-2.0.0-p247/1375141206_configure.log
There has been an error while running configure. Halting the installation.
I also ran this command in debug mode. To avoid clutter, you can access it here.
Also, here is the log:
./configure
current path: /Users/xxxxx/.rvm/src/ruby-2.0.0-p247
command(7): ./configure --prefix=/Users/xxxxx/.rvm/rubies/ruby-2.0.0-p247 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --without-tcl --without-tk --enable-shared
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... x86_64-apple-darwin12.2.1
checking host system type... x86_64-apple-darwin12.2.1
checking target system type... x86_64-apple-darwin12.2.1
checking whether the C compiler works... no
configure: error: in `/Users/xxxxx/.rvm/src/ruby-2.0.0-p247':
configure: error: C compiler cannot create executables
See `config.log' for more details
This is my first installation via RVM. $rvm list returns no gems.
Please ask if any additional information might be helpful.
Edit - HERE is the log in case that might help anyone.
Something must have been wrong with either my Xcode or my Command Line Tools install. Reinstalling both made everything run beautifully.
For those that arrived here from google when you applied the same error as the query:
I got this same problem but did not want to go through the ridiculously long process of reinstalling xcode like the accepted answer suggested. All I did was run
rvm get stable And then run
rvm install ruby-2.0.0-p247 again
my original problem
then after I ran
rvm get stable
Make sure that you install command line tool within XCode because it does not do it automatically (yes, I agree, command line tool should be installed by default) but it isn't.
Install XCode -> Preferences -> Downloads -> "Command Line Tool"
EDIT* missed the whole "made everything run beautifully part" and typed this all out-
Cheers, glad everything worked out!

Trouble downgrading Ruby on OS X Mavericks

OS X 10.9 comes with ruby 2.0.0p195 but I need to install Ruby 1.8.7. I keep running into errors. I have Xcode5-DP install and I believe Command Line Tools is installed too.
In the terminal:
sudo rvm install 1.8.7
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10/x86_64/ruby-1.8.7-p371.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.
Installing Ruby from source to: /Users/alextoul/.rvm/rubies/ruby-1.8.7-p371, this may take a while depending on your cpu(s)...
ruby-1.8.7-p371 - #downloading ruby-1.8.7-p371, this may take a while depending on your connection...
ruby-1.8.7-p371 - #extracted to /Users/alextoul/.rvm/src/ruby-1.8.7-p371 (already extracted)
Patch stdout-rouge-fix was already applied.
Patch no_sslv2 was already applied.
ruby-1.8.7-p371 - #configuring...
Error running 'env CFLAGS=-O3 -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libxml2/include -I/usr/local/opt/libxslt/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl098/include LDFLAGS=-L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libxml2/lib -L/usr/local/opt/libxslt/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl098/lib ./configure --prefix=/Users/alextoul/.rvm/rubies/ruby-1.8.7-p371 --disable-install-doc --without-tcl --without-tk --enable-shared',
please read /Users/alextoul/.rvm/log/ruby-1.8.7-p371/1371228839_configure.log
There has been an error while running configure. Halting the installation.
1371228839_configure.log says:
./configure
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... i686-apple-darwin13.0.0
checking host system type... i686-apple-darwin13.0.0
checking target system type... i686-apple-darwin13.0.0
checking whether the C compiler works... no
configure: error: in `/Users/alextoul/.rvm/src/ruby-1.8.7-p371':
configure: error: C compiler cannot create executables
See `config.log' for more details
Other (useful) info:
ruby -v
> ruby 2.0.0p195 (2013-05-14 revision 40734) [universal.x86_64-darwin13]
brew update
> Already up-to-date.
gcc --version
> Configured with: --prefix=/Applications/Xcode5-DP.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode5-DP.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
> Apple LLVM version 5.0 (clang-500.1.58) (based on LLVM 3.3svn)
> Target: x86_64-apple-darwin13.0.0
> Thread model: posix
sudo rvm requirements
> Installing requirements for osx, might require sudo password.
> Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.
Thanks for your help.
10.9 is an early beta build of the OS. [Edit: please note the July 2013 date of this answer] If I were running 10.9 I would assume I'll have to reinstall the operating system from scratch at least 2 more times. (At least once during the beta cycle because, well, it's beta, and once when 10.9 comes out in general release, because, well, beta).
Given this I suggest four courses of action (pick 1 or many):
Work with the RVM guys and dig into 10.9's probably-changed compiler environment and get Ruby 1.8.7 compiling. This is trickier because technically this stuff is under NDA.
Instead, set up a VM and run Ruby 1.8.7 on the VM. Bonus points for using Vagrant and Chef/Puppet, because you may even need to rebuild the VM. (Just keep the Vagrantfile and Puppet or Chef config files on Github/Dropbox/whatever so you can clone them and regenerate your VM from scratch.)
OR simply reboot to 10.8 to get production work done. 10.8 is a production level OS, 10.9 should be treated with caution - it could eat your work. It really shouldn't be used for production purposes (aka: day to day writing Ruby code). If you're writing a 10.9 only app in Cocoa/Objective-C (or updating RubyMotion or something) that might be another thing (but I'd still keep good backups and treat it gently).
Work towards updating your code base for Ruby 2.0, as Ruby 1.8.7 is no longer officially supported anyway.
Edit (Oct 24, 2013): If you're here because you just installed Mavericks (released Oct 22, 2013), want to get Ruby 1.8.7 working a few days after this release, and RVM isn't working for you (because you're impatient and can't wait), here's what you can do (which should work, although I'm not an rbenv user):
Use macports to install port install ruby. This is Ruby 1.8.7. This compilation worked for me on my Mavericks machine (although you will need to install Macports from source at this writing and install the command line developer tools, even if you have XCode 5 installed. Yes, really).
Now, install rbenv.
Symlink /opt/local/bin/ruby1.8 in the ~/.rbenv/versions/ folder. Specifically ~/.rbenv/versions/ruby-1.8.7-p374
Read the rbenv documentation, but it should work now! (At least from the documentation. Again, not an rbenv user, but do play one on TV)
I'm sure you can do this with homebrew too, but I know Ruby 1.8.7 installs correctly with the latest Macports, because that's what I use (and it just installed cleanly for me).
When you see this error message:
configure: error: C compiler cannot create executables:
First of all, make sure you have upgraded your commandline tools:
$ xcode-select --install
Now Apple wants you to agree to their license before you can use these tools:
$ gcc
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
$ sudo gcc
You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.
[...]
After you have accepted it, the commandline tools will work as expected.
If you've installed developer tools on OS X Mavericks Ruby 1.8 is already installed along with 2.0.
So all you need to do is switch the 'Current' symbolic link to point to the 1.8 directory.
#Install Xcode Developer tools
xcode-select --install
#Delete Current symbolic link to Ruby 2.0
sudo rm /System/Library/Frameworks/Ruby.framework/Versions/Current
#Create new Current symbolic link to Ruby 1.8
sudo ln -s /System/Library/Frameworks/Ruby.framework/Versions/1.8 /System/Library/Frameworks/Ruby.framework/Versions/Current
#Check Ruby version is 1.8.7
ruby -v
Try this (ensure the dev toolchain is reachable):
$ sudo xcode-select -s /Applications/Xcode5-DP.app/Contents/Developer
Then retry.
Try switching your compiler
rvm install 1.8.7 --with-gcc=clang

Installing Ruby - RVM - Mac OSX Mountain Lion

So I'm trying to install Ruby 1.9.3 on my Mac running Mountain Lion. I have xCode installed and up to date. I've installed RVM and now am trying to install Ruby using rvm install 1.9.3 When I run this it looks like it's going to install but gives me an error please see below:
rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p392.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Already up-to-date.
Certificates in '/Users/Colin/.rvm/etc/openssl/cert.pem' already are up to date.
Installing Ruby from source to: /Users/Colin/.rvm/rubies/ruby-1.9.3-p392, this may take a while depending on your cpu(s)...
ruby-1.9.3-p392 - #downloading ruby-1.9.3-p392, this may take a while depending on your connection...
ruby-1.9.3-p392 - #extracted to /Users/Colin/.rvm/src/ruby-1.9.3-p392 (already extracted)
ruby-1.9.3-p392 - #configuring........
Error running './configure --prefix=/Users/Colin/.rvm/rubies/ruby-1.9.3-p392 --with-opt-dir=/Users/Colin/.rvm/opt/libyaml:/Users/Colin/.rvm/opt/readline:/Users/Colin/.rvm/opt/libxml2:/Users/Colin/.rvm/opt/libxslt:/Users/Colin/.rvm/opt/libksba:/Users/Colin/.rvm/opt/openssl:/Users/Colin/.rvm/opt/sqlite --disable-install-doc --without-tcl --without-tk --enable-shared',
please read /Users/Colin/.rvm/log/ruby-1.9.3-p392/1366429269_configure.log
There has been an error while running configure. Halting the installation.
When I go to the /1366429269_configure.log file it says this:
[2013-04-19 20:41:09] ./configure
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... x86_64-apple-darwin12.2.1
checking host system type... x86_64-apple-darwin12.2.1
checking target system type... x86_64-apple-darwin12.2.1
checking whether the C compiler works... no
configure: error: in `/Users/Colin/.rvm/src/ruby-1.9.3-p392':
configure: error: C compiler cannot create executables
See `config.log' for more details
If anyone could help me out it would be greatly appreciated!
Edit:
I tried the solution here Can't install Ruby under Lion with RVM – GCC issues rvm install 1.9.3 --with-gcc=clang and it changed a bit, here is the new output:
rvm install 1.9.3 --with-gcc=clang
Installing requirements for osx, might require sudo password.
Already up-to-date.
Certificates in '/Users/Colin/.rvm/etc/openssl/cert.pem' already are up to date.
Warning: found user selected compiler 'clang', this will suppress RVM auto detection mechanisms.
Installing Ruby from source to: /Users/Colin/.rvm/rubies/ruby-1.9.3-p392, this may take a while depending on your cpu(s)...
ruby-1.9.3-p392 - #downloading ruby-1.9.3-p392, this may take a while depending on your connection...
ruby-1.9.3-p392 - #extracted to /Users/Colin/.rvm/src/ruby-1.9.3-p392 (already extracted)
ruby-1.9.3-p392 - #configuring.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
ruby-1.9.3-p392 - #compiling..................................................................
Error running 'make -j8',
please read /Users/Colin/.rvm/log/ruby-1.9.3-p392/1366431470_make.log
There has been an error while running make. Halting the installation.
And heres the log from that: http://pastebin.com/P6nTZRQY
EDIT
Not sure what happened but I just tried the same thing and now it's working perfect. Thank you everyone who left a helpful comment, it's greatly appreciated!
You need to update Command Line Tools to latest version, also for ruby 1.9.3 it is still preferred to use gcc-4.2 for compilation.
Also make sure you update RVM before trying again:
rvm get head
rvm install 1.9.2
Finally, Ruby 2.0.0 should be compatible with 1.9.3 and you should update.
I ran into similar issues trying to install Ruby on Rails on Lion a month ago. In the end, I used an installer. If using an installer is a viable option for you, check out the Rails Installer.
try to use this it will install all
wget --no-check-certificate https://raw.github.com/joshfng/railsready/master/railsready.sh && bash railsready.sh

Getting Ruby 1.8.7 installed on Mountain Lion (10.8)

I'm having a lot of trouble getting Ruby 1.8.7 installed on my clean install of Mountain Lion. I've looked around on Stack Overflow and don't see anything that specifically addresses this issue and hope that someone might have encountered this before.
I'm using the command line tools that can be downloaded with Xcode
I haven't had any problems installing Ruby 1.9.3 via RVM and HomeBrew. When I try to install 1.8.7 I get the following message after it tries to compile:
I first ran the command
rvm install 1.8.7
This gave me this error
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
After digging around a bit I tried
rvm install 1.8.7 --with-gcc=clang
Error running 'make ', please read /Users/paulzaich/.rvm/log/ruby-1.8.7-p370/make.log
There has been an error while running make. Halting the installation.
Ruby 'ruby-1.8.7-p370' was built using clang - but it's not (fully) supported, expect errors.
Please be aware that you just installed a ruby that requires 2 patches just to be compiled on up to date linux system.
This may have known and unaccounted for security vulnerabilities.
Please consider upgrading to Ruby 1.9.3-194 which will have all of the latest security patches.
At this point I did some more searching and found something about needing compile my own readline. RVM Does Not Install Ruby 1.9.2 on Snow Leopard: 'Error running 'make '
This unfortunately seemed to corrupt my entire rvm install including 1.9.3. I tried to reinstall 1.9.3 and got the same errors I as I was getting with 1.8.7. I completely deleted RVM at this point and reinstalled. Had no problem installing 1.9.3 again.
I also tried updating all versions of rvm based off of this post RVM issue with Mountain Lion. No luck there either.
Update: I also tried using this walkthrough for REE 1.8.7 which recommended installing gcc-4.2. No luck unfortunately.
Update 2: I reference rvm requirements and installed the following packages
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
So far so good. Then I referenced this post on needing to reference the GCC compiler. I determined that the links referenced might not be correct because I'm using homebrew? I found the compiler in my Cellar folder and used the following command
CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 rvm install 1.8.7
No luck. Same error messages as before.
I just figured it out! Please reference this question on SO
rvm can no longer install 1.8.7-p352 on Mac OS X Mountain Lion
rvm reinstall 1.8.7 --without-tcl --without-tk
Alternatively, try this installation order if you have Homebrew.
brew install tcl-tk
rvm reinstall 1.8.7
Just to follow up to Paul's post. I'm running OSX 10.8.2, had 1.9.3 install without issues, but 1.8.7-p370 also failed. I symlinked gcc-4.2:
sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2
...successfully ran:
brew install tcl
...but tk failed:
brewk install tk
If you're in the same spot, this command did the trick:
CC=/usr/local/bin/gcc-4.2 rvm reinstall 1.8.7 --without-tk
Latest Xcode provides only clang - not GNU gcc, you need to install gcc-4.2 to be able to compile Ruby 1.8.7 properly, following command will show available options:
rvm requirements
currently only ruby 1.9.3-p125 and later has limited support for clang, but this is limited support, and still errors can be found.

Failed to configure Ruby with RVM on Fedora15

I run rvm install 1.9.3 to update Ruby on my Fedora 15.
But it failed and showed the message:
checking for an ANSI C-conforming const... no
checking for working volatile... yes
configure: error: ANSI C-conforming const and volatile are mandatory
Searched all over but cant find a solution.
Anyone could help? thx in advance.
I cannot run rvm to install any version of ruby with gcc-4.6.3.
Finally get it resolved via suggestion in the post:
install bundler using rvm, ruby 1.8.7 with gcc 4.7 on linux
Have you installed all required dependencies? If not, run rvm notes and then install the required packages.
I ran into this error when installing in linux. Turns out it was because i added the --64 option which may be for MAC only. When I removed that flag, that error message was gone.

Resources