Installing RVM getting errors with configure - ruby

I'm getting errors installing RVM, I have installed Ruby 2.0.0 with brew, and now I'm trying to run the RVM command at http://www.rvm.io
Error running './configure --prefix=/Users/name/.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/name/.rvm/log/ruby-2.0.0-p0/configure.log
There has been an error while running configure. Halting the installation.
This is what my log looks like
[2013-04-10 21:50:21] ./configure
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... i386-apple-darwin12.3.0
checking host system type... i386-apple-darwin12.3.0
checking target system type... i386-apple-darwin12.3.0
checking for gcc-4.2... no
checking for clang... no
checking for gcc... no
checking for cc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/name/.rvm/src/ruby-2.0.0-p0':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
I have Xcode installed too.

Do you have Xcode installed? You then have to go into its preference window to install the command line tools. Take a look at this question.

Related

Mac OS - m1: Can't install ruby 2.7.5 because of an error from configure

I need to install ruby 2.7.5 for my react native app but I can't install 2.7.5 through rvm. I tried many things to install any ruby version, I ended up to get this configure error.
Error running './configure --prefix=/Users/myname/.rvm/rubies/ruby-2.1.1 --disable-install-doc --enable-shared',
please read /Users/myname/.rvm/log/1672107647_ruby-2.1.1/configure.log
There has been an error while running configure. Halting the installation.
Here is the configure log
configure: WARNING: you should use --build, --host, --target
checking for ruby... /usr/bin/ruby
tool/config.guess already exists
tool/config.sub already exists
checking build system type... arm-apple-darwin22.2.0
checking host system type... arm-apple-darwin22.2.0
checking target system type... arm-apple-darwin22.2.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/myname/.rvm/src/ruby-2.7.1':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
I tried...
remove rvm and reinstall
rvm install 2.7.5
rvm install ruby-2.7.5
use rbenv
install openssl
brew install openssl
rvm install 2.6.7 --with-openssl-dir=/usr/local/opt/openssl
remove rvm by using rvm implode
all those throw same error message. After trying 4., all ruby versions are removed but still can't install any ruby version.
Please help!!!
Edit
I tried
CFLAGS="-Wno-error=implicit-function-declaration" rvm install 2.7.5
and got this error
Error running './configure --prefix=/Users/myname/.rvm/rubies/ruby-2.7.5 --with-opt-dir=/opt/homebrew/opt/libyaml:/opt/homebrew/opt/libksba:/opt/homebrew/opt/readline:/opt/homebrew/opt/zlib:/opt/homebrew/opt/openssl#1.1 --disable-install-doc --enable-shared',
please read /Users/myname/.rvm/log/1672116807_ruby-2.7.5/configure.log
There has been an error while running configure. Halting the installation.
EDIT-----
export LDFLAGS="-L/opt/homebrew/opt/openssl#1.1/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.1/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl#1.1/lib/pkgconfig"
export RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC
export optflags="-Wno-error=implicit-function-declaration"
export LDFLAGS="-L/opt/homebrew/opt/openssl#1.1/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.1/include"
CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl#1.1)"
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl#1.1)"
rvm install 2.7.5
this returns same error
but I got this configure log
checking for ruby... /usr/bin/ruby
tool/config.guess already exists
tool/config.sub already exists
checking build system type... aarch64-apple-darwin22.2.0
checking host system type... aarch64-apple-darwin22.2.0
checking target system type... aarch64-apple-darwin22.2.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/myname/.rvm/src/ruby-2.7.5':
configure: error: cannot run C compiled programs. // <---- new!
If you meant to cross compile, use `--host'.
See `config.log' for more details
------ EDIT --------
after 2days, I try to install 2.7.6 and got this message again.
checking for ruby... /Users/myname/.rvm/rubies/ruby-2.7.5/bin/ruby
tool/config.guess already exists
tool/config.sub already exists
checking build system type... aarch64-apple-darwin22.2.0
checking host system type... aarch64-apple-darwin22.2.0
checking target system type... aarch64-apple-darwin22.2.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/myname/.rvm/src/ruby-2.7.6':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Add Command Line Tools:
Ensure the command line tools are correctly installed. We might need to reinstall Xcode after OS upgrades.
Here are the exact steps to follow assuming we have openssl installed
export LDFLAGS="-L/opt/homebrew/opt/openssl#1.1/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.1/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl#1.1/lib/pkgconfig"
export RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC
export optflags="-Wno-error=implicit-function-declaration"
export LDFLAGS="-L/opt/homebrew/opt/openssl#1.1/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.1/include"
CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl#1.1)"
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl#1.1)"
rvm install 2.7.5
Do you have xcode developer tools installed? Run this "xcode-select --install"
xcode-select --install
Once you have developer tools installed you may need to refer to this comment:-
https://github.com/rbenv/ruby-build/discussions/1947#discussioncomment-2317356

Bundler failed on gem package em-udns -v '0.3.6.2' install

When I am trying to run bundle install on macOs , I got error on
An error occurred while installing em-udns (0.3.6.2), and Bundler cannot continue.
Make sure that `gem install em-udns -v '0.3.6.2' --source '{sourcepath}'` succeeds before bundling.
After the open of log files I am find the
"tar zxf /Users/user/.rbenv/versions/2.5.9/lib/ruby/gems/2.5.0/gems/em-udns-0.3.6.2/ext/udns-0.4-patched.tar.gz"
./configure
configure... udns package
checking for C compiler... gcc
checking whenever C compiler (gcc) is GNU CC... yes
checking whenever the C compiler (gcc -Wall -W -O2 -pipe)
can produce executables... yes
checking for ranlib... ranlib
checking for getopt()... yes
checking for libraries needed for socket and connect... not found
configure: fatal: cannot find libraries needed for sockets**
how can I fix the issue ?

Unable to build Ruby 2.1.3 on OSX 10.10 GM 3.0 with rbenv

I have found several threads where other users have had similar issues but none of them are seem to be like this.
After issuing the command:
rbenv install 2.1.3
I get the following errors:
Installing ruby-2.1.3...
BUILD FAILED (OS X 10.10 using ruby-build 20140926)
Inspect or clean up the working tree at /var/folders/y_/5mjltxsn35q0n_k5817bszlw0000gn/T/ruby-build.20141010202255.63586
Results logged to /var/folders/y_/5mjltxsn35q0n_k5817bszlw0000gn/T/ruby-build.20141010202255.63586.log
Last 10 log lines:
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... no
configure: error: something wrong with CFLAGS=" -O3 -Wno-error=shorten-64-to-32 "
make: *** No targets specified and no makefile found. Stop.
The Homebrew package for gcc on Yosemite seems to be broken. That's why it doesn't work.
Had the same issue. Running:
CC=/usr/bin/gcc rbenv install 2.1.3
worked for me.
This has been fixed in ruby-build for rbenv. Please update by the following:
cd ~/.rbenv/plugins/ruby-build/
git pull

configuration error in RVM

I am trying to download ruby 1.9.3 (for learning purposes, this is the version in the book)
When I run $rvm install 1.9.3 I get a configuration error:
Error running './configure --prefix=/Users/john/.rvm/rubies/ruby-1.9.3-p545 --with-opt-dir=/usr/local/Cellar/libyaml/0.1.6:/usr/local/Cellar/readline/6.3.3:/usr/local/Cellar/libksba/1.3.0:/usr/local/Cellar/openssl/1.0.1g --without-tcl --without-tk --disable-install-doc --enable-shared',
showing last 15 lines of /Users/john/.rvm/log/1398181983_ruby-1.9.3-p545/configure.log
Then the last 15 lines are:
[2014-04-22 10:53:15] ./configure
current path: /Users/john/.rvm/src/ruby-1.9.3-p545
PATH=/usr/local/Cellar/pkg-config/0.28/bin:/usr/local/Cellar/libtool/2.4.2/bin:/usr/local/Cellar/automake/1.14.1/bin:/usr/local/Cellar/autoconf/2.69/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Users/john/.rvm/bin:/Users/john/.rvm/bin
command(7): ./configure --prefix=/Users/john/.rvm/rubies/ruby-1.9.3-p545 --with-opt-dir=/usr/local/Cellar/libyaml/0.1.6:/usr/local/Cellar/readline/6.3.3:/usr/local/Cellar/libksba/1.3.0:/usr/local/Cellar/openssl/1.0.1g --without-tcl --without-tk --disable-install-doc --enable-shared
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... i386-apple-darwin13.1.0
checking host system type... i386-apple-darwin13.1.0
checking target system type... i386-apple-darwin13.1.0
checking whether the C compiler works... no
configure: error: in `/Users/john/.rvm/src/ruby-1.9.3-p545':
configure: error: C compiler cannot create executables
Does anyone know what is wrong here? Since I'm new, I'm assuming it is something simple...
Thanks in advance!
Issue is with the c compliers. You should be doing
sudo apt-get install clang && rvm install 1.9.3 --with-gcc=clang

Errors installing Ruby 1.9.3 using RVM

I'm trying to install Ruby 1.9.3-p385 on my work machine using Mountain Lion.
I've installed RVM and run
rvm install 1.9.3
But I get this error...
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p385 --with-opt-dir=/usr/local/rvm/usr --disable-shared', please read /usr/local/rvm/log/ruby-1.9.3-p385/configure.log
There has been an error while running configure. Halting the installation.
This is the contents of configure.log that the error points to...
[2013-02-18 10:10:50] ./configure
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 `/usr/local/rvm/src/ruby-1.9.3-p385':
configure: error: C compiler cannot create executables
See `config.log' for more details
It's all a bit cryptic to me. If anyone can help it would be appreciated.
This is problem with railsinstaller default settings, check this answer https://stackoverflow.com/a/12929017/497756
See this question and my answer.
To sum up, install MacPorts and run:
sudo port selfupdate
sudo port install gcc-apple42
CC=/opt/local/bin/gcc-apple-4.2 rvm install ruby-1.9.3-p194 --enable-shared --without-tk --without-tcl

Resources