/bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory - error during CocoaPods installation - cocoapods

I am trying to initialize a React-Native project, and following the docs, I did:
brew install node
brew install watchman
sudo gem install cocoapods
Also uninstalling react-native-cli, as suggested in the docs here.
Nothing wrong with those steps, until:
npx react-native init AwesomeProject
Then I got a error message:
###### ######
### #### #### ###
## ### ### ##
## #### ##
## #### ##
## ## ## ##
## ### ### ##
## ######################## ##
###### ### ### ######
### ## ## ## ## ###
### ## ### #### ### ## ###
## #### ######## #### ##
## ### ########## ### ##
## #### ######## #### ##
### ## ### #### ### ## ###
### ## ## ## ## ###
###### ### ### ######
## ######################## ##
## ### ### ##
## ## ## ##
## #### ##
## #### ##
## ### ### ##
### #### #### ###
###### ######
Welcome to React Native!
Learn once, write anywhere
✔ Downloading template
✔ Copying template
✔ Processing template
⠏ Installing CocoaPods dependencies (this may take a few minutes)Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Downloading dependencies
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.61.5)
Installing FBReactNativeSpec (0.61.5)
Installing Folly (2018.10.22.00)
Installing RCTRequired (0.61.5)
Installing RCTTypeSafety (0.61.5)
Installing React (0.61.5)
Installing React-Core (0.61.5)
Installing React-CoreModules (0.61.5)
Installing React-RCTActionSheet (0.61.5)
Installing React-RCTAnimation (0.61.5)
Installing React-RCTBlob (0.61.5)
Installing React-RCTImage (0.61.5)
Installing React-RCTLinking (0.61.5)
Installing React-RCTNetwork (0.61.5)
Installing React-RCTSettings (0.61.5)
Installing React-RCTText (0.61.5)
Installing React-RCTVibration (0.61.5)
Installing React-cxxreact (0.61.5)
Installing React-jsi (0.61.5)
Installing React-jsiexecutor (0.61.5)
Installing React-jsinspector (0.61.5)
Installing ReactCommon (0.61.5)
Installing Yoga (1.14.0)
Installing boost-for-react-native (1.63.0)
Installing glog (0.3.5)
[!] /bin/bash -c
set -e
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
set -e
PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
CURRENT_ARCH="${CURRENT_ARCH}"
if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then
# Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg.
# it's better to rely on platform name as fallback because architecture differs between simulator and device
if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then
CURRENT_ARCH="x86_64"
else
CURRENT_ARCH="armv7"
fi
fi
export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"
export CXX="$CC"
# Remove automake symlink if it exists
if [ -h "test-driver" ]; then
rm test-driver
fi
./configure --host arm-apple-darwin
# Fix build for tvOS
cat << EOF >> src/config.h
/* Add in so we have Apple Target Conditionals */
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <Availability.h>
#endif
/* Special configuration for AppleTVOS */
#if TARGET_OS_TV
#undef HAVE_SYSCALL_H
#undef HAVE_SYS_SYSCALL_H
#undef OS_MACOSX
#endif
/* Special configuration for ucontext */
#undef HAVE_UCONTEXT_H
#undef PC_FROM_UCONTEXT
#if defined(__x86_64__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
#elif defined(__i386__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
#endif
EOF
# Prepare exported header include
EXPORTED_INCLUDE_DIR="exported/glog"
mkdir -p exported/glog
cp -f src/glog/log_severity.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/raw_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/stl_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/vlog_is_on.h "$EXPORTED_INCLUDE_DIR/"
/bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./AwesomeProject/ios && pod install".
CocoaPods documentation: https://cocoapods.org/
I tried to follow the recommendation and run
cd ./AwesomeProject/ios && pod install
But got another error here:
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Downloading dependencies
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.61.5)
Installing FBReactNativeSpec (0.61.5)
Installing Folly (2018.10.22.00)
Installing RCTRequired (0.61.5)
Installing RCTTypeSafety (0.61.5)
Installing React (0.61.5)
Installing React-Core (0.61.5)
Installing React-CoreModules (0.61.5)
Installing React-RCTActionSheet (0.61.5)
Installing React-RCTAnimation (0.61.5)
Installing React-RCTBlob (0.61.5)
Installing React-RCTImage (0.61.5)
Installing React-RCTLinking (0.61.5)
Installing React-RCTNetwork (0.61.5)
Installing React-RCTSettings (0.61.5)
Installing React-RCTText (0.61.5)
Installing React-RCTVibration (0.61.5)
Installing React-cxxreact (0.61.5)
Installing React-jsi (0.61.5)
Installing React-jsiexecutor (0.61.5)
Installing React-jsinspector (0.61.5)
Installing ReactCommon (0.61.5)
Installing Yoga (1.14.0)
Installing boost-for-react-native (1.63.0)
Installing glog (0.3.5)
[!] /bin/bash -c
set -e
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
set -e
PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
CURRENT_ARCH="${CURRENT_ARCH}"
if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then
# Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg.
# it's better to rely on platform name as fallback because architecture differs between simulator and device
if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then
CURRENT_ARCH="x86_64"
else
CURRENT_ARCH="armv7"
fi
fi
export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"
export CXX="$CC"
# Remove automake symlink if it exists
if [ -h "test-driver" ]; then
rm test-driver
fi
./configure --host arm-apple-darwin
# Fix build for tvOS
cat << EOF >> src/config.h
/* Add in so we have Apple Target Conditionals */
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <Availability.h>
#endif
/* Special configuration for AppleTVOS */
#if TARGET_OS_TV
#undef HAVE_SYSCALL_H
#undef HAVE_SYS_SYSCALL_H
#undef OS_MACOSX
#endif
/* Special configuration for ucontext */
#undef HAVE_UCONTEXT_H
#undef PC_FROM_UCONTEXT
#if defined(__x86_64__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
#elif defined(__i386__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
#endif
EOF
# Prepare exported header include
EXPORTED_INCLUDE_DIR="exported/glog"
mkdir -p exported/glog
cp -f src/glog/log_severity.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/raw_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/stl_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/vlog_is_on.h "$EXPORTED_INCLUDE_DIR/"
/bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
I tried to do it the old way too, by re-installing react-native-cli, but get the same error.
Can someone please help explain what's the problem (bash / glog / some configuration file?
And how should I fix this?
My environment is currently:
MacOS Catalina 10.15.3
XCode cersion 11.3.1 (11C504)
Node version 13.8.0
npm version 6.13.6
Homebrew version 2.2.7
Gem version 3.1.2
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
Your help is greatly appreciated ! :) thank you

Finally someone solved it with Sublime Text editor, since converting the file with dos2unix and vim didn't work somehow. Please follow the link here.

Related

gem install compass error after Mac OS Sierra 10.12.6 update

A few days ago I did a Mac OS Sierra 10.12.6 Security Update 2018-005. Yesterday I ran grunt and got a:
Warning: Running "sass:dist" (sass) task
Warning: spawn sass ENOENT Use --force to continue.
Aborted due to warnings.
I followed the instructions here: https://github.com/appseed-io/supermodular/issues/45
xcode-select --install
sudo gem update --system
sudo gem install -n /usr/local/bin compass
I was still getting grunt errors:
Running "sass:build" (sass) task
ERROR: Cannot load compass.
Warning: Exited with error code 1 Use --force to continue.
Aborted due to warnings.
I then followed the instruction here: https://halfelf.org/2017/grunt-cant-build-sass-on-high-sierra/
brew install rbenv ruby-build
rbenv install 2.4.2
rbenv global 2.4.2
sudo gem update --system
sudo gem install -n /usr/local/bin sass
Still getting the grunt ERROR: Cannot load compass.
Then tried sudo gem install -n /usr/local/bin compass again, but get the following error:
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
I checked the mkmf.log file which says:
"pkg-config --exists libffi"
package configuration for libffi is not found
"xcrun clang -o conftest -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin16 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/backward -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GCC_ATOMIC_BUILTINS -iwithsysroot /usr/local/libressl/include conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib -L. -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr/local/libressl/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr/local/lib -arch x86_64 -arch i386 -lruby.2.3.0 -lpthread -ldl -lobjc "
In file included from conftest.c:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
^~~~~~~~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
What I take from that (not really knowing) is that package configuration for libffi is not found and fatal error: 'ruby/config.h' file not found.
Additional info:
Xcode Version 9.2 (9C40b)
ruby -v
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin16]
sass -v
Sass 3.4.25 (Selective Steve)
compass -v
-bash: /usr/local/bin/compass:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory
Thanks in advance.
UPDATE
I ran gem env. This is the output:
RubyGems Environment:
- RUBYGEMS VERSION: 2.7.8
- RUBY VERSION: 2.3.7 (2018-03-28 patchlevel 456) [universal.x86_64-darwin16]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.3.0
- USER INSTALLATION DIRECTORY: /Users/username/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- SPEC CACHE DIRECTORY: /Users/username/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-16
- GEM PATHS:
- /Library/Ruby/Gems/2.3.0
- /Users/username/.gem/ruby/2.3.0
- /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/username/.nvm/versions/node/v8.4.0/bin
- /Users/username/.wp-cli/bin
- /usr/local/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
Don't do sudo gem install -n /usr/local/bin compass
The whole point of using rbenv is to let it handle all of your dependencies and not have to deal at all with your OS system ruby or it's gems. You need to get your $PATH configuration right and then you won't need to ever use sudo in fact you should NOT with gem install or any gem commands after getting your environment setup correctly.
Did you happen to try npm install -g grunt-cli ?
UPDATE: as expect your $PATH is not correct.
Close all terminals. Start a new one. Then run this.
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
This should help you figure out what's wrong in your $PATH setting.
Refer to https://github.com/rbenv/rbenv#installation
But first specifically try:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
Then restart your terminal and check gem env again and see if your path includes .rbenv
If these steps don't get you working then I suggest to fully uninstall rbenv and start over from step 1 of https://github.com/rbenv/rbenv#installation

Cant install postgres on docker with ruby/sinatra

I am trying to make a tesseract api using docker, but when at the point of bundle install i get this error:
Fetching data_mapper 1.2.0
Installing data_mapper 1.2.0
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/var/lib/gems/2.3.0/gems/do_postgres-0.10.17/ext/do_postgres
/usr/bin/ruby2.3 -r ./siteconf20171013-5-6l2bdy.rb extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for postgres.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.3
--with-pgsql-server-dir
--without-pgsql-server-dir
--with-pgsql-server-include
--without-pgsql-server-include=${pgsql-server-dir}/include
--with-pgsql-server-lib
--without-pgsql-server-lib=${pgsql-server-dir}/lib
--with-pgsql-client-dir
--without-pgsql-client-dir
--with-pgsql-client-include
--without-pgsql-client-include=${pgsql-client-dir}/include
--with-pgsql-client-lib
--without-pgsql-client-lib=${pgsql-client-dir}/lib
--with-pqlib
--without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not
created
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/do_postgres-0.10.17/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.3.0/gems/do_postgres-0.10.17
for inspection.
Results logged to
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/do_postgres-0.10.17/gem_make.out
An error occurred while installing do_postgres (0.10.17), and Bundler cannot
continue.
Make sure that `gem install do_postgres -v '0.10.17'` succeeds before bundling.
In Gemfile:
dm-postgres-adapter was resolved to 1.2.0, which depends on
do_postgres
The command '/bin/sh -c /bin/bash -l -c "bundle install"' returned a non-zero code: 5
My docker file looks like this:
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y \
ruby-dev \
postgresql postgresql-contrib libpq-dev \
autoconf \
autoconf-archive \
automake \
build-essential \
checkinstall \
cmake \
g++ \
git \
libcairo2-dev \
libcairo2-dev \
libicu-dev \
libicu-dev \
libjpeg8-dev \
libjpeg8-dev \
libpango1.0-dev \
libpango1.0-dev \
libpng12-dev \
libpng12-dev \
libtiff5-dev \
libtiff5-dev \
libtool \
pkg-config \
wget \
xzgv \
zlib1g-dev \
vim \
python-pip
# SSH for diagnostic
RUN apt-get update && apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:root' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's#session\s*required\s*pam_loginuid.so#session optional pam_loginuid.so#g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
# Directories
ENV SCRIPTS_DIR /home/scripts
ENV PKG_DIR /home/pkg
ENV BASE_DIR /home/workspace
ENV LEP_REPO_URL https://github.com/DanBloomberg/leptonica.git
ENV LEP_SRC_DIR ${BASE_DIR}/leptonica
ENV TES_REPO_URL https://github.com/tesseract-ocr/tesseract.git
ENV TES_SRC_DIR ${BASE_DIR}/tesseract
ENV TESSDATA_PREFIX /usr/local/share/tessdata
RUN mkdir ${SCRIPTS_DIR}
RUN mkdir ${PKG_DIR}
RUN mkdir ${BASE_DIR}
RUN mkdir ${TESSDATA_PREFIX}
COPY ./container-scripts/* ${SCRIPTS_DIR}/
RUN chmod +x ${SCRIPTS_DIR}/*
RUN ${SCRIPTS_DIR}/repos_clone.sh
RUN ${SCRIPTS_DIR}/tessdata_download.sh
# Install pytesseract
RUN pip install --upgrade pip \
&& pip install pytesseract==0.1.6
# Add textcleaner from Fred's ImageMagick Scripts
# http://www.fmwconcepts.com/imagemagick/textcleaner/
ADD ./bin/textcleaner /usr/local/bin
# Setup app
WORKDIR /app
ADD . /app
RUN /bin/bash -l -c "gem install pg -- --with-pg-lib=/usr/lib"
RUN /bin/bash -l -c "gem install bundler"
RUN /bin/bash -l -c "bundle install"
ENTRYPOINT ["ruby", "app.rb"]
# create user tesseract for use with this server
RUN groupadd -r tesseract && useradd -r -g tesseract tesseract
USER tesseract
I am just running a small sinatra app with a single endpoint where you send the image an it returns the text as a json file and im stumbling at this point.
I have googled around a fair amount and tried a few solutions such as pointing to where the config file is but they all seem to give a similar error.
Any help would be great
Why use ubuntu:16.04 at all in the first place. I think the problem is that your docker environment has not been properly setup to run ruby and bundler.
To get past this gory setup process, I suggest you use a ruby image with an alpine or slim tag if storage space is a problem. Then the setup process becomes much easier and you avoid all these errors

qtbindings ubuntu install error

I try install qtbindings gem on my new virtual machine. I did everything according to the instructions on gem page, but something is wrong. I have installation errors:
vagrant#machine:~$ sudo gem install qtbindings
Building native extensions. This could take a while...
ERROR: Error installing qtbindings:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
make
mkdir ext/build
mkdir bin/1.9
mkdir bin/plugins
mkdir bin/plugins/accessible
mkdir bin/plugins/bearer
mkdir bin/plugins/codecs
mkdir bin/plugins/designer
mkdir bin/plugins/graphicssystems
mkdir bin/plugins/iconengines
mkdir bin/plugins/imageformats
mkdir bin/plugins/phonon_backend
mkdir bin/plugins/qmltooling
mkdir bin/plugins/sqldrivers
mkdir lib/1.9
cd ext/build; rm -rf CMakeFiles
cd ext/build; rm -rf generator
cd ext/build; rm -rf smoke
cd ext/build; rm -rf ruby
cd ext/build; rm *
rm: cannot remove '*': No such file or directory
make: [clean] Error 1 (ignored)
cd ext/build; \
cmake -DCMAKE_MINIMUM_REQUIRED_VERSION=2.6 \
-G "Unix Makefiles" \
-Wno-dev \
-DRUBY_EXECUTABLE=/usr/bin/ruby1.9.1 \
..
/bin/sh: 2: cmake: not found
make: [build] Error 127 (ignored)
cd ext/build; make
make[1]: Entering directory `/var/lib/gems/1.9.1/gems/qtbindings-4.8.6.3/ext/build'
make[1]: *** No targets specified and no makefile found. Stop.
make[1]: Leaving directory `/var/lib/gems/1.9.1/gems/qtbindings-4.8.6.3/ext/build'
make: *** [build] Error 2
Gem files will remain installed in /var/lib/gems/1.9.1/gems/qtbindings-4.8.6.3 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/qtbindings-4.8.6.3/./gem_make.out
OS Ubunu 16.04. What i did wrong?
SOLVED
install cmake and qt-sdk
Thanks ajinkya-pisal
Of note, if you use multiple Ruby versions via RVM, you need to make sure you have 2.2.6 installed and selected. To check which versions you have installed, run
rvm list
If you do not have Ruby 2.2.6 installed, you will need to install it by running
rvm install 2.2.6
To select 2.2.6, run
rvm use 2.2.6
If it's a new installation, you'll also need to add 2.2.6 gems to your PATH. Do this by running
rvm get stable --auto-dotfiles

Installation of camlp4 with opam on OS X 10.9 failed

I do not understand why this installation on a fresh opam installation failed.
Fresh means that there was no .opam directory
I run opam init
and then opam install ocamlfind, which worked
followed by opam install camlp4, which failed.
what's wrong?
$ opam install camlp4
The following actions will be performed:
- install camlp4.4.02.1+system
=== + 1 ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫
=-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫
Copying ~/.opam/repo/default/packages/camlp4/camlp4.4.02.1+system/files/install to ~/.opam/system/build/camlp4.4.02.1+system/
Copying ~/.opam/repo/default/packages/camlp4/camlp4.4.02.1+system/files/check-camlp4.sh to ~/.opam/system/build/camlp4.4.02.1+system/
Building camlp4.4.02.1+system:
sh ./check-camlp4.sh
[ERROR] The compilation of camlp4.4.02.1+system failed.
Removing camlp4.4.02.1+system.
Nothing to do.
#=== ERROR while installing camlp4.4.02.1+system ==============================#
# opam-version 1.2.0
# os darwin
# command sh ./check-camlp4.sh
# path $home/.opam/system/build/camlp4.4.02.1+system
# compiler system (4.02.1)
# exit-code 1
# env-file $home/.opam/system/build/camlp4.4.02.1+system/camlp4-94259-58c514.env
# stdout-file $home/.opam/system/build/camlp4.4.02.1+system/camlp4-94259-58c514.out
# stderr-file $home/.opam/system/build/camlp4.4.02.1+system/camlp4-94259-58c514.err
### stdout ###
# ...[truncated]
# 4.02 by switching to a local installation via `opam switch 4.02.1`.
#
# Here are some installation instructions for camlp4 if you obtained OCaml
# via the OPAM binary packages:
#
# http://software.opensuse.org/download.html?project=home%3Aocaml&package=ocaml
#
# * Debian/Ubuntu: sudo apt-get install camlp4-extra
# * RHEL/CentOS/Fedora: sudo yum install ocaml-camlp4
#
### stderr ###
# ./check-camlp4.sh: line 3: camlp4orf: command not found
Actually the answer is already contained in the OPAM output. Just to clarify, you're using system compiler, i.e., a compiler that is already installed on your operating system (using macports or brew). That means, that camlp4 being de facto a part of compiler, is needed to be installed from the system too. So, you need either install it using your package manager, e.g.,
sudo port install ocaml-camlp4
or just switch to a local installation (the recommended way). This will require you to create a new compiler installation,
opam switch 4.02.1
eval `opam config env`
And afterwards everything will work as a charm.

Can't install Ruby under Lion with RVM – GCC issues

Most questions regarding this problem are due to missing Xcode; I have Xcode 4.2 installed.
Install attempt:
rvm install 1.9.3
Installing Ruby from source to: /Users/jamie/.rvm/rubies/ruby-1.9.3-p0, this may take a while depending on your cpu(s)...
ruby-1.9.3-p0 - #fetching
ruby-1.9.3-p0 - #extracted to /Users/jamie/.rvm/src/ruby-1.9.3-p0 (already extracted)
Fetching yaml-0.1.4.tar.gz to /Users/jamie/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/jamie/.rvm/src
Configuring yaml in /Users/jamie/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/jamie/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/jamie/.rvm/usr
ruby-1.9.3-p0 - #configuring
ERROR: Error running ' ./configure --prefix=/Users/jamie/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/jamie/.rvm/usr ', please read /Users/jamie/.rvm/log/ruby-1.9.3-p0/configure.log
ERROR: There has been an error while running configure. Halting the installation.
configure.log:
[2011-11-07 04:32:17] ./configure --prefix=/Users/jamie/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/jamie/.rvm/usr
configure: WARNING: unrecognized options: --with-libyaml-dir
checking build system type... x86_64-apple-darwin11.2.0
checking host system type... x86_64-apple-darwin11.2.0
checking target system type... x86_64-apple-darwin11.2.0
checking whether the C compiler works... no
configure: error: in `/Users/jamie/.rvm/src/ruby-1.9.3-p0':
configure: error: C compiler cannot create executables
See `config.log' for more details
GCC is available:
gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
ls /usr/bin | grep gcc
gcc
i686-apple-darwin11-llvm-gcc-4.2
llvm-gcc
llvm-gcc-4.2
Based on config.log (posted at bottom due to size) I tried symlinking gcc-4.2 to gcc and then installing:
rvm install 1.9.3
ERROR: The autodetected CC(/usr/bin/gcc-4.2) is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`, and set CC=/path/to/gcc .
So I could probably just grab gcc elsewhere, but I'm mostly concerned as to why this is happening. Shouldn't installing Xcode be enough?
config.log:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure --prefix=/Users/jamie/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/jamie/.rvm/usr
## --------- ##
## Platform. ##
## --------- ##
hostname = Wilson.local
uname -m = x86_64
uname -r = 11.2.0
uname -s = Darwin
uname -v = Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64
/usr/bin/uname -p = i386
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = Mach kernel version:
Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64
Kernel configured for up to 4 processors.
4 processors are physically available.
4 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3
Primary memory available: 8.00 gigabytes
Default processor set: 110 tasks, 546 threads, 4 processors
Load average: 1.28, Mach factor: 2.71
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /Users/jamie/.rvm/usr/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin
PATH: /usr/X11/bin
PATH: /Users/jamie/bin
PATH: /Users/jamie/.rvm/bin
PATH: /Users/jamie/.rvm/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2764: checking build system type
configure:2778: result: x86_64-apple-darwin11.2.0
configure:2849: checking host system type
configure:2862: result: x86_64-apple-darwin11.2.0
configure:2882: checking target system type
configure:2895: result: x86_64-apple-darwin11.2.0
configure:3376: checking for C compiler version
configure:3385: gcc-4.2 --version >&5
./configure: line 3387: gcc-4.2: command not found
configure:3396: $? = 127
configure:3385: gcc-4.2 -v >&5
./configure: line 3387: gcc-4.2: command not found
configure:3396: $? = 127
configure:3385: gcc-4.2 -V >&5
./configure: line 3387: gcc-4.2: command not found
configure:3396: $? = 127
configure:3385: gcc-4.2 -qversion >&5
./configure: line 3387: gcc-4.2: command not found
configure:3396: $? = 127
configure:3416: checking whether the C compiler works
configure:3438: gcc-4.2 conftest.c >&5
./configure: line 3440: gcc-4.2: command not found
configure:3442: $? = 127
configure:3480: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define CANONICALIZATION_FOR_MATHN 1
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3485: error: in `/Users/jamie/.rvm/src/ruby-1.9.3-p0':
configure:3487: error: C compiler cannot create executables
See `config.log' for more details
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=x86_64-apple-darwin11.2.0
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-apple-darwin11.2.0
ac_cv_prog_CC=gcc-4.2
ac_cv_target=x86_64-apple-darwin11.2.0
## ----------------- ##
## Output variables. ##
## ----------------- ##
ALLOCA=''
AR=''
ARCHFILE=''
ARCH_FLAG=''
AS=''
ASFLAGS=''
BASERUBY='ruby'
BUILTIN_ENCOBJS=''
BUILTIN_TRANSOBJS=''
BUILTIN_TRANSSRCS=''
CAPITARGET=''
CC='gcc-4.2'
CCDLFLAGS=''
CFLAGS=''
CHDIR=''
COMMON_HEADERS=''
COMMON_LIBS=''
COMMON_MACROS=''
COUTFLAG=''
CP=''
CPP=''
CPPFLAGS=''
CPPOUTFILE=''
CXX='g++-4.2'
CXXFLAGS=''
DEFS=''
DLDFLAGS=''
DLDLIBS=''
DLEXT2=''
DLEXT=''
DLLWRAP=''
DOT=''
DOXYGEN=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
ENABLE_SHARED=''
EXECUTABLE_EXTS=''
EXEEXT=''
EXPORT_PREFIX=''
EXTOUT=''
EXTSTATIC=''
GCC=''
GNU_LD=''
GREP=''
INSTALLDOC=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
LDFLAGS=''
LDSHARED=''
LDSHAREDXX=''
LIBEXT=''
LIBOBJS=''
LIBPATHENV=''
LIBPATHFLAG=''
LIBRUBY=''
LIBRUBYARG=''
LIBRUBYARG_SHARED=''
LIBRUBYARG_STATIC=''
LIBRUBY_A=''
LIBRUBY_ALIASES=''
LIBRUBY_DLDFLAGS=''
LIBRUBY_LDSHARED=''
LIBRUBY_RELATIVE=''
LIBRUBY_SO=''
LIBS=''
LINK_SO=''
LN_S=''
LTLIBOBJS=''
MAINLIBS=''
MAJOR='1'
MAKEDIRS=''
MAKEFILES=''
MANTYPE=''
MINIOBJS=''
MINIRUBY=''
MINOR='9'
MKDIR_P=''
NM=''
NROFF=''
NULLCMD=''
OBJCOPY=''
OBJDUMP=''
OBJEXT=''
OUTFLAG=''
PACKAGE=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PKG_CONFIG=''
PREP=''
RANLIB=''
RDOCTARGET=''
RI_BASE_NAME=''
RM=''
RMALL=''
RMDIR=''
RMDIRS=''
RPATHFLAG=''
RUBYW_BASE_NAME='rubyw'
RUBYW_INSTALL_NAME=''
RUBY_BASE_NAME='ruby'
RUBY_INSTALL_NAME=''
RUBY_PROGRAM_VERSION='1.9.3'
RUBY_RELEASE_DATE='2011-10-30'
RUBY_SO_NAME=''
RUNRUBY=''
SET_MAKE=''
SHELL='/bin/sh'
SOLIBS=''
STATIC=''
STRIP=''
SYMBOL_PREFIX=''
TEENY='1'
TEST_RUNNABLE=''
THREAD_MODEL=''
TRY_LINK=''
UNIVERSAL_ARCHNAMES=''
UNIVERSAL_INTS=''
USE_RUBYGEMS=''
WERRORFLAG=''
WINDRES=''
XCFLAGS=''
XLDFLAGS=''
XRUBY=''
XRUBY_LIBDIR=''
XRUBY_RUBYHDRDIR=''
XRUBY_RUBYLIBDIR=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_OBJCOPY=''
ac_ct_OBJDUMP=''
arch=''
bindir='${exec_prefix}/bin'
build='x86_64-apple-darwin11.2.0'
build_alias=''
build_cpu='x86_64'
build_os='darwin11.2.0'
build_vendor='apple'
cflags=' ${optflags} ${debugflags} ${warnflags}'
configure_args=''
cppflags=''
cxxflags=' ${optflags} ${debugflags} ${warnflags}'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
debugflags=''
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec=''
exec_prefix='NONE'
host='x86_64-apple-darwin11.2.0'
host_alias=''
host_cpu='x86_64'
host_os='darwin11.2.0'
host_vendor='apple'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
optflags=''
pdfdir='${docdir}'
prefix='/Users/jamie/.rvm/rubies/ruby-1.9.3-p0'
program_transform_name='s&^&&'
psdir='${docdir}'
ridir=''
ruby_pc=''
ruby_version=''
rubyhdrdir=''
rubylibprefix=''
rubyw_install_name=''
sbindir='${exec_prefix}/sbin'
setup=''
sharedstatedir='${prefix}/com'
sitearch=''
sitedir=''
sitehdrdir=''
sysconfdir='${prefix}/etc'
target='x86_64-apple-darwin11.2.0'
target_alias=''
target_cpu='x86_64'
target_os='darwin11.2.0'
target_vendor='apple'
try_header=''
vendordir=''
vendorhdrdir=''
warnflags=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define CANONICALIZATION_FOR_MATHN 1
configure: exit 77
This answer was edited multiple times and now contains several alternative solutions. Try the simple “Edit 3” solution first.
Ruby 1.9.3-p125 and later have official support for clang, so if you are installing such a version you should not need GCC. If you’re installing an older version of Ruby, read on.
To compile Ruby with GCC, you need a non-LLVM version of GCC, which is no longer included with Xcode 4.2. Install it yourself (or downgrade to Xcode 4.1 temporarily), then do CC=/usr/local/bin/gcc-4.2 rvm install 1.9.3 --enable-shared (substituting the path to your non-LLVM gcc).
Edit: https://github.com/kennethreitz/osx-gcc-installer/downloads may help for installing GCC. There is also some info available by running rvm requirements.
Edit 2: For an easier solution, you can try adding --with-gcc=clang to the arguments to configure for Ruby to use clang instead of GCC.
Edit 3: rvm install 1.9.3 --with-gcc=clang does that for you.
Note: With current versions of Xcode you need to install the command-line tools separately from the Xcode menu -> Preferences -> Downloads -> Components. This is a pre-requisite for doing any compiling with Xcode on the command-line, not just Ruby.
Note 2: If something doesn't work after following the steps, try doing a reboot or re-login to ensure that the environment gets set correctly.
Note 3: Ruby versions prior to 1.9.3-p125 may not always be fully compatible with clang, so test your software thoroughly if using the “edit 3” solution in a production environment.
SUMMARY FOR STACK OVERFLOW
I was trying to install SiriProxy on a clean Lion installation on Xcode from App Store
I kept getting errors like :
The provided CC(/usr/bin/gcc) is LLVM based.
bash-3.2$ rvm install 1.9.3
ERROR: The provided CC(/usr/bin/gcc) is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
After 2 days finally got it working with these two lines:
http://stackoverflow.com/questions/8000145/ruby-rvm-llvm-and-mysql
bash-3.2$ rvm get head
bash-3.2$ CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared
Before that I had tried every stackoverflow article on Ruby and Lion so doing these may have done some setup that helped the above 2 steps work:
Things I tried included:
Running Install Xcode.app (I had downloaded from App Store - running this does futher installation)
Installing
https://github.com/kennethreitz/osx-gcc-installer/downloads may help for installing GCC.
Set up CC in
more /Users//.bash_profile
bash-3.2$ more /Users/<USERNAME>/.bash_profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
export CC=/usr/share/TargetConfigs/bin/gcc
First line came from SiriProxy install instruction
https://github.com/plamoni/SiriProxy
2nd line export CC never seemed to work. So dont add.
It had many versions each pointing
I finally used CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared
rvm install 1.9.3 --with-gcc=clang
Worked for me. This was on a brand new Lion with Xcode (had no "traditional" GCC).
OK I didn't have to install gcc-4.2 separately, I used the one delivered in Xcode, but I had an issue where the --with-gcc=clang wasn't getting passed through. Added the following line to my .rvmrc:
export rvm_configure_flags="--with-gcc=clang"
Worked as required
rvm upgrade ruby-1.9.2-p290 ruby-1.9.3-p125
...
ruby-1.9.3-p125 - #extracted to /Users/leif/.rvm/src/ruby-1.9.3-p125 (already extracted)
ruby-1.9.3-p125 - #configuring
ruby-1.9.3-p125 - #compiling
ruby-1.9.3-p125 - #installing
....
Successfully migrated ruby-1.9.2-p290 to ruby-1.9.3-p125
Upgrade complete!
bang:$ ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
Note my env is the following
OS
Darwin bang.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64
Xcode
Xcode 4.2.1 Build 4D502
GCC
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
lrwxr-xr-x 1 root wheel 12 22 Dec 21:30 /usr/bin/gcc -> llvm-gcc-4.2
I tried using the answer of passing --with-gcc=clang on the command line to the rvm upgrade command, but it didn't work, it didn't appear to get pass from rvm to configure. Apparently the problem in RVM of arguments not being passed to configure is fixed (in commit 1641ceb0 in 2011), but even after upgrading RVM to latest (via rvm get latest) it still didn't get passed. Using the .rvmrc file was the only way it would work for me.
Only answering here because I can can't up vote/comment on leandro's comment on the original question. After spending days trying to get this to work, His solution was the one that finally got it working for me:
edit3 didn'work for me (Xcode 4.2.1), but after installing readline
rvm pkg install readline
and passing an extra parameter
rvm install 1.9.3 --with-gcc=clang --with-readline-dir=$rvm_path/usr
it installed successfully.
You can try to install Command Line Tools for Xcode, it includes GCC, LLMV and other tools that excluded in Xcode 4.2 and higher.
I will suggest brew from rvm requirements I have installed it while I have already installed latest Xcode Version 4.4 (4F250)
Homebrew:
If you are using Homebrew, you can install the apple-gcc42 and
required libraries from homebrew/dupes:
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
This can live side by side with an existing Xcode 4.2+ install or
Command Line Tools for Xcode.
And you can always do
$ brew cleanup [specific-formula or without-formula to clean all]
and then if necessary
$ brew remove apple-gcc42
or any other installed program through brew (see the docs for explanation on those 2 commands), also you can
/join #machomebrew
on freenode (not #homebrew I think that is real homebrew beer and related)
Just tell configure to use gcc instead of gcc-4.2 on Lion (Mac OSX 10.7.2)
Compiling ruby-1.9.3 from source
You can see in your configure output:
configure:3385: gcc-4.2 --version >&5
./configure: line 3387: gcc-4.2: command not found
If you search the config.log you see:
CC='gcc-4.2'
I had the same problem, so I run configure while selecting gcc instead of gcc-4.2:
> CC=gcc ./configure --prefix=/usr/local
> make
> make install
> ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
(I'm not sure what is the configure: WARNING: unrecognized options: --with-libyaml-dir in your output I guess you figured that one out?)
Download and use JewelryBox The official RVM GUI for Mac OS. Inside "Add Ruby" select your version of Ruby. Before installing, make sure you select "Use Clang" just as what Edit 3 of the accepted answer in this thread suggests.
Make sure you're on the latest rvm. Using rvm 1.10.0 none of the above worked for me. Furthermore, rvm get latest erroneously told me "You already have the latest version!" so I had to rvm implode and reinstall rvm (1.15.4), which automatically gave me ruby 1.9.3-p194 with no fuss.
For me, none of the above worked as-is. What finally worked was
rvm get head
rm -rf /usr/local/lib/libsqlite3*
CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared
The special trick was to remove the libsqllite that, according to the build log, was missing the required 64-bit architecture or something.
A more recent simpler solution is to just use railsinstaller.org. It has osx-gcc packaged within it, so it's as easy as a download and install. After meddling with a new shell recently, i landed up mucking my rails environment. After trying many of the above solutions (which previously worked I might add), I landed up following the below steps to get things working again:
nuke your local environment, (think rvm implode and uninstall Xcode)
download the pkg from railsinstaller.org
double click and install
The installer takes some time considering it installs git, rvm , homebrew and a bunch of other goodies.
With brew you can install ruby in a one-liner:
brew install ruby193
Worked out of the box for me on OS X 10.8.4. (If you want 2.0, just run brew install ruby instead)
More generally, brew search ruby shows you the different repos available, and if you want to get really specific you can use brew versions ruby and checkout a specific version instead.
You might need Xcode and command-line tools, but brew's setup will check all that for you.
Got same issue, since I am using Xcode 4.3.2 and Lion 10.7.3, and I changed my laptop few days ago and then transfer all contents from the old laptop. Apparently, some of binaries not get transfer over, such as gcc.
ANd then I did following:
Remove Xcode 4.3.2 by dragging it to trash
Download the gcc install package v2 from https://github.com/kennethreitz/osx-gcc-installer/downloads
Install it
Then rvm install 1.9.2 working for me
Try:
rvm install 1.9.3 --force-autoconf

Resources