I am trying to install Ruby on rails on my Mac for the first time.
I ran the following command on my terminal windows -
rvm install 2.0.0
But I keep getting this error.
Error running './configure --prefix=/Users/tusharmathur/.rvm/rubies/ruby-2.0.0-p0 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libxml2:/usr/local/opt/libxslt:/usr/local/opt/libksba:/usr/local/opt/openssl:/usr/local/opt/sqlite --disable-install-doc --without-tcl --without-tk --enable-shared',
please read /Users/tusharmathur/.rvm/log/ruby-2.0.0-p0/configure.log
There has been an error while running configure. Halting the installation.
I saw the configure.log also, here is the information -
[2013-03-15 01:11:06] ./configure
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... i386-apple-darwin12.2.1
checking host system type... i386-apple-darwin12.2.1
checking target system type... i386-apple-darwin12.2.1
checking whether the C compiler works... no
configure: error: in `/Users/tusharmathur/.rvm/src/ruby-2.0.0-p0':
configure: error: C compiler cannot create executables
See `config.log' for more details
Here are some screenshots how to install command line tools for XCode (you can install XCode from Mac AppStore):
http://d.pr/i/YJJp
http://d.pr/i/ntLu
http://d.pr/i/cOFv
After installing command line tools you will have a C/C++ compiler on your machine.
Related
For some reason I can't get ruby 2.3.0 installed via RBENV. I got it to work with RVM though. Let me know if I need to provide further information.
Here's the error I get:
Downloading ruby-2.3.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.bz2
Installing ruby-2.3.0...
BUILD FAILED (OS X 10.10.5 using ruby-build 20160426)
Inspect or clean up the working tree at /tmp/ruby-build.20160426211028.6622
Results logged to /tmp/ruby-build.20160426211028.6622.log
Last 10 log lines:
config.guess already exists
config.sub already exists
checking build system type... x86_64-apple-darwin14.5.0
checking host system type... x86_64-apple-darwin14.5.0
checking target system type... x86_64-apple-darwin14.5.0
checking whether the C compiler works... no
configure: error: in `/tmp/ruby-build.20160426211028.6622/ruby-2.3.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found. Stop.
your system has too strict security policy, so add sudo for the rbenv to give the ability to add executions. So you will like something like:
sudo rbenv install 2.3.0
I'm trying to update ma ruby version.
I'm with ruby 1.8.7 and I would like to install 2.1.0.
I just installed rvm, rbenv, brew and gem.
But when I try to do
$ rbenv install 2.1.0.
I get an error about clang. I don't get the point between clang and ruby
Could you please help me?
Error:
$ rbenv install 2.1.0
Downloading ruby-2.1.0.tar.gz...
Installing ruby-2.1.0...
BUILD FAILED
...
Last 10 log lines:
...
checking build system type... x86_64-apple-darwin12.3.0
checking host system type... x86_64-apple-darwin12.3.0
checking target system type... x86_64-apple-darwin12.3.0
checking for gcc-4.2... no
checking for clang... no
checking for gcc... no
checking for cc... no
./configure: line 3390: -E: command not found
configure: error: clang version 3.0 or later is required
You need to install the Developer Tools command-line tools in order to build Ruby. As one option, you can install Xcode from the App Store, and Xcode will let you install the command line tools if they aren't automatically installed with your version.
You can install developer command line tools without installing Xcode. Just type the following in the terminal:
xcode-select --install
If I type xcodebuild -version it recognises that I have xcode installed:
Xcode 4.3.2
Build version 4E2002
But then when I try to check rvm requirements I get the following:
Notes for Mac OS X 10.7.3, No Xcode.
For JRuby: Install the JDK. See http://developer.apple.com/java/download/ # Current Java version "1.6.0_26"
For IronRuby: Install Mono >= 2.6
For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba'
You can use & download osx-gcc-installer: https://github.com/kennethreitz/osx-gcc- installer
** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix is to install Xcode over osx-gcc-installer.
We had reports of http://hpc.sourceforge.net/ making things work, but it looks like not easiest/safest to setup.
To use an RVM installed Ruby as default, instead of the system ruby:
rvm install 1.8.7 # installs patch 357: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems
rvm alias create default 1.8.7
And reopen your terminal windows.
Xcode 4.2:
* is only supported by ruby 1.9.3+ using command line flag: --with-gcc=clang
* it breaks gems with native extensions, especially DB drivers.
It seems that it is not recognising my xcode and when I try to install rvm 1.9.3 I get:
Fetching yaml-0.1.4.tar.gz to /Users/sikandarshukla/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/sikandarshukla/.rvm/src
Configuring yaml in /Users/sikandarshukla/.rvm/src/yaml-0.1.4.
Error running ' ./configure --prefix="/Users/sikandarshukla/.rvm/usr" ', please read /Users/sikandarshukla/.rvm/log/ruby-1.9.3-p125/yaml/configure.log
Compiling yaml in /Users/sikandarshukla/.rvm/src/yaml-0.1.4.
Error running 'make ', please read /Users/sikandarshukla/.rvm/log/ruby-1.9.3- p125/yaml/make.log
Database file /Users/sikandarshukla/.rvm/config/packages does not exist.
/Users/sikandarshukla/.rvm/scripts/functions/build: line 28: --version: command not found
Installing Ruby from source to: /Users/sikandarshukla/.rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)...
ruby-1.9.3-p125 - #fetching
ruby-1.9.3-p125 - #extracted to /Users/sikandarshukla/.rvm/src/ruby-1.9.3-p125 (already extracted)
ruby-1.9.3-p125 - #configuring
Error running ' ./configure --prefix=/Users/sikandarshukla/.rvm/rubies/ruby-1.9.3-p125 -- enable-shared --disable-install-doc --with-libyaml --with-opt- dir=/Users/sikandarshukla/.rvm/usr ', please read /Users/sikandarshukla/.rvm/log/ruby-1.9.3- p125/configure.log
There has been an error while running configure. Halting the installation.
Now if i read the log, the output of cat /Users/sikandarshukla/.rvm/log/ruby-1.9.3-p125/configure.log is the following:
./configure --prefix=/Users/sikandarshukla/.rvm/rubies/ruby-1.9.3-p125 --enable-shared -- disable-install-doc --with-libyaml --with-opt-dir=/Users/sikandarshukla/.rvm/usr
configure: WARNING: unrecognized options: --with-libyaml
checking build system type... i386-apple-darwin11.3.0
checking host system type... i386-apple-darwin11.3.0
checking target system type... i386-apple-darwin11.3.0
checking whether the C compiler works... no
configure: error: in `/Users/sikandarshukla/.rvm/src/ruby-1.9.3-p125':
configure: error: C compiler cannot create executables
See `config.log' for more details
and the output of cat /Users/sikandarshukla/.rvm/log/ruby-1.9.3-p125/yaml/configure.log is the following:
./configure --prefix="/Users/sikandarshukla/.rvm/usr"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/sikandarshukla/.rvm/src/yaml-0.1.4':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
Any ideas what to do, Thanks for your help
It's a bug in recognizing Xcode version, I have created a ticket and it should be solved shortly -> https://github.com/wayneeseguin/rvm/issues/846
All Xcode 4.2+ have the same issue:
4.2:
is only supported by ruby 1.9.3+ using command line flag: --with-gcc=clang
it breaks gems with native extensions, especially DB drivers.
To solve use osx-gcc-installer:
You can use & download osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer
I just installed Ruby Version Manager 1.10.2 and attempted to install Ruby 1.9.2 and I get the following error:
ayman-al-abdullahs-macbook:~ Terminal$ rvm install 1.9.2
Fetching yaml-0.1.4.tar.gz to /Users/Terminal/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/Terminal/.rvm/src
Configuring yaml in /Users/Terminal/.rvm/src/yaml-0.1.4.
Error running ' ./configure --prefix="/Users/Terminal/.rvm/usr" ', please read /Users/Terminal/.rvm/log/ruby-1.9.2-p290/yaml/configure.log
Compiling yaml in /Users/Terminal/.rvm/src/yaml-0.1.4.
Error running 'make ', please read /Users/Terminal/.rvm/log/ruby-1.9.2- p290/yaml/make.log
Database file /Users/Terminal/.rvm/config/packages does not exist.
Installing Ruby from source to: /Users/Terminal/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...
ruby-1.9.2-p290 - #fetching
ruby-1.9.2-p290 - #extracting ruby-1.9.2-p290 to /Users/Terminal/.rvm/src/ruby-1.9.2- p290
ruby-1.9.2-p290 - #extracted to /Users/Terminal/.rvm/src/ruby-1.9.2-p290
ruby-1.9.2-p290 - #configuring
Error running ' ./configure --prefix=/Users/Terminal/.rvm/rubies/ruby-1.9.2-p290 -- enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/Terminal/.rvm/usr ', please read /Users/Terminal/.rvm/log/ruby-1.9.2-p290/configure.log
There has been an error while running configure. Halting the installation.
I opened the .rvm/log/ruby-1.9.2-p290/configure.log I received the following error:
[2012-02-10 21:14:02] ./configure --prefix=/Users/Terminal/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/Terminal/.rvm/usr
configure: WARNING: unrecognized options: --with-libyaml
checking build system type... i386-apple-darwin10.8.0
checking host system type... i386-apple-darwin10.8.0
checking target system type... i386-apple-darwin10.8.0
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/Terminal/.rvm/src/ruby-1.9.2-p290':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
I tried rm the file and reinstalling it, and I still get the same error.
Does anyone have any clue what this could be?
Thank you!
UPDATE UPDATE
Fixed it!
Downloading xcode from Apple requires you to be a developer ($99) or pay $5 for version 10.7 (which requires Lion).
I was able to procure an older version of XCode made specifically for Snow Leapard (4.0.2). After downloading, and installing Ruby version 1.9.3 it ran perfectly.
Thank you all for your help!
Let me know if anyone else runs into this same issue and I'll be happy to walk you through my terminal steps (saved the terminal log).
It seems you don't have gcc. Install Apple Developer Tools.
I fixed it!
Downloading xcode from Apple requires you to be a developer ($99) or pay $5 for version 10.7 (which requires Lion).
I was able to procure an older version of XCode made specifically for Snow Leapard (4.0.2). After downloading, and installing Ruby version 1.9.3 it ran perfectly.
Thank you all for your help!
Let me know if anyone else runs into this same issue and I'll be happy to walk you through my terminal steps (saved the terminal log).
I am trying to install ruby1.9.2 using rvm on my Linux system (Mint-Linux distro), but I am unable to due to some errors which I cannot debug. This is the error I am getting when I run the install command.
$ rvm install 1.9.2
Installing Ruby from source to: /home/nnn/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...
ruby-1.9.2-p290 - #fetching
ruby-1.9.2-p290 - #extracted to /home/nnn/.rvm/src/ruby-1.9.2-p290 (already extracted)
Fetching yaml-0.1.4.tar.gz to /home/nnn/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /home/nnn/.rvm/src
Configuring yaml in /home/nnn/.rvm/src/yaml-0.1.4.
Compiling yaml in /home/nnn/.rvm/src/yaml-0.1.4.
Installing yaml to /home/nnn/.rvm/usr
ruby-1.9.2-p290 - #configuring
ERROR: Error running ' ./configure --prefix=/home/nnn/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml-dir=/home/nnn/.rvm/usr ',
please read /home/nnn/.rvm/log/ruby-1.9.2-p290/configure.log
ERROR: There has been an error while running configure. Halting the installation.
The configure.log file has the following errors.
./configure --prefix=/home/nnn/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml-dir=/home/nnn/.rvm/usr
configure: WARNING: unrecognized options: --with-libyaml-dir
configure: error: could not determine MAJOR number from version.h
Can you please help me out ?
Thanks
If you run
./configure --help
you will see that there is indeed no option 'with-libyaml-dir', it is not supported by Ruby's main configure script.
These "with-xxx-dir" parameters are often used during the compilation of extensions, where you create a Makefile by running
ruby extconf.rb --with-libimportantforextension-dir=...
In your case a workaround solution would be to install libyaml using apt-get:
sudo apt-get install libyaml
This way RVM will probably recognize that it is already installed and will not attempt to download and install it to a custom location, so you shouldn't receive the error you currently get anymore.