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.
Related
When I run
RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl#3/3.0.1 rbenv install 3.1.0
I get this output:
Downloading ruby-3.1.0.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.0.tar.gz
Installing ruby-3.1.0...
ruby-build: using readline from homebrew
BUILD FAILED (macOS 11.6.2 using ruby-build 20211227-3-gcdc215e)
Inspect or clean up the working tree at /var/folders/ts/k_8jb10136s3zw9k2k08nz3c0000gn/T/ruby-build.20220113093111.65052.FVpqjp
Results logged to /var/folders/ts/k_8jb10136s3zw9k2k08nz3c0000gn/T/ruby-build.20220113093111.65052.log
Last 10 log lines:
The Ruby openssl extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/jeremy/.rbenv/versions/3.1.0
--enable-shared
--with-readline-dir=/usr/local/opt/readline
--with-openssl-dir=/usr/local/Cellar/openssl#3/3.0.1
CC=clang
LDFLAGS=-L/Users/jeremy/.rbenv/versions/3.1.0/lib
CPPFLAGS=-I/Users/jeremy/.rbenv/versions/3.1.0/include
I don't see any clues in the logs. I have tried lots of things like reinstalling rbenv and openssl, not specifying the configure opts, system updates, installing xcode, and more things from google. Maybe I am missing something.
Hi I also kept running into this on 'Mac OS X 10.15.7 using ruby-build' I had to set both of the following variables at the same time before the rbenv install 3.0.1 command:
OPENSSL_CFLAGS=-Wno-error=implicit-function-declaration RUBY_CONFIGURE_OPTS=--with-readline-dir="$(brew --prefix readline)" rbenv install 3.0.1
The first one tells the compiler to ignore where functions are implicitly declared rather than erroring out when this happens. And the second tells ruby which readline to use (in this case the one installed trough homebrew).
Ruby does not (yet) support OpenSSL 3.0. Implementing support for this newer version is tracked in https://github.com/ruby/openssl/issues/369
For now, you have to use Openssl 1.1 instead, which you can install with
brew install openssl#1.1
I am trying to install Ruby on my mac and that too the latest version but having trouble.
The pre-installed ruby on mac is of verion 2.0 however, I need to upgrade the same to latest.
I tried installing ruby with Homebrew like brew install ruby but whenever i check the version, it shows me the earlier version only. Refer Terminal screenshot:
Am trying to learn ruby but this thing got me stuck for long.
Have also tried another package manager rbenv and did rbenv install 2.5.1 but that failed with the following error I have no idea about
The Ruby zlib extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/vshukla/.rbenv/versions/2.5.1
--with-openssl-dir=/usr/local/opt/openssl
CC=clang
CFLAGS= -O3 -Wno-error=shorten-64-to-32
LDFLAGS=-L/Users/vshukla/.rbenv/versions/2.5.1/lib
CPPFLAGS=-I/Users/vshukla/.rbenv/versions/2.5.1/include
Please guide.
Homebrew has correctly installed the last version of ruby in /usr/local/bin. You can check it with:
/usr/local/bin/ruby --version
The macOS version of ruby is installed in /usr/bin. You can check it with:
/usr/bin/ruby --version
If you want to always run the Homebrew versions of installed tools, you have to put /use/local/bin before /usr/bin in your PATH environment variable. You can do this by adding the following line in your ~/.bash_profile:
export PATH="/usr/local/bin:$PATH"
P.S.: According to your macos ruby version, you don't have the last macOS version.
The compile error log contains:
The Ruby zlib extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Try installing "zlib" and then try again, by running:
brew install zlib
I was trying run gem install json and got the following error
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [generator.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /opt/boxen/repo/.bundle/ruby/2.0.0/gems/json-1.8.0 for inspection.
Results logged to /opt/boxen/repo/.bundle/ruby/2.0.0/extensions/universal-darwin-13/2.0.0/json-1.8.0/gem_make.out
I'm using:
Os X: 10.9.2
Xcode: 5.1 Build version 5B130a
Command Line Tools (CLT): 5.1.0.0.1.1393561416
Ruby: ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
Ruby Gem: 2.2.2
GCC: 4.2.1 Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
I am encountering the exact same problem after updating Xcode to 5.1 and news from Apple aren't good. From Xcode 5.1 Release Notes:
The Apple LLVM compiler in Xcode 5.1 treats unrecognized command-line options as errors. This issue has been seen when building both Python native extensions and Ruby Gems, where some invalid compiler options are currently specified.
Projects using invalid compiler options will need to be changed to remove those options. To help ease that transition, the compiler will temporarily accept an option to downgrade the error to a warning:
-Wno-error=unused-command-line-argument-hard-error-in-future
To workaround this issue, set the ARCHFLAGS environment variable to downgrade the error to a warning.
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install GemName
It seems that all gems violating the compiler options must be updated to use valid options. It is explicitly stated that: This option [downgrading error to warning] will not be supported in the future.
The clang note we are seeing (this will be a hard error (cannot be downgraded to a warning) in the future) corresponds to the change announced in the release notes.
To answer your question specifically, use the following to install the json gem:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install json
Note, however, that this is only a temporary fix.
One-liner to fix that
curl https://gist.githubusercontent.com/Paulche/9713531/raw/1e57fbb440d36ca5607d1739cc6151f373b234b6/gistfile1.txt | sudo patch /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb
To address the issue you can install the most recent version of ruby as described by #Sash. You can use the following commands to do so. In case you already have installed rvm, you don't need to reinstall it.
#Install rvm
\curl -sSL https://get.rvm.io | bash -s stable
#Install ruby version 2.0.0-p451
rvm install ruby-2.0.0-p451
#Print ruby version to verify that it was installed successfully
ruby -v
#Install json gem
sudo gem install json
Issue already addressed by Ruby:
https://bugs.ruby-lang.org/issues/9624
now we just need to wait for Apple to update their ruby version (2.0.0p247) to the one after the latest one (2.0.0p451) which hasn't come out yet ...
(or brew/macport it)
Update (2014-05-15): Mavericks 10.9.3 updates ruby to
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
And this seems to resolves the issue.
#Muncken has already provided an answer to install gem one by one:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install GemName
Base on Muncken's answer, I've tried that it also works when using bundle install
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future bundle install
In my case, I actually have similar problem, but not on the system ruby, but on rubies installed by rvm from OSX 10.8, and it has issues after upgrading to OSX 10.9.
A simple reinstall works: rvm reinstall ruby-2.1.1
On OSX 10.10, I had several issues when running rails new firstapp such as:
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
fatal error: 'ruby/config.h' file not found
I updated rvm with this configuration and all the errors are gone!:
rvm get stable --auto-dotfiles
You can tell from the app name that I just started fiddling with Ruby on Rails, so the above advice may or may not work for you.
Paul Chechetin's one-liner doesn't appear to work anymore (9/21/15). However, this reply to the post mentioned in Pete's reply solved the problem for me:
(a) Install Apple's XCode, then (b) launch it and accept the licensing terms (I had done (a), but not (b).)
sudo gem uninstall compass
sudo gem install compass
None of these worked for me.
What finally worked is running the command with a sudo -
gem install byebug -v '9.0.6'
It's been a while and I've got similar error. An alternative to folks using bundler is to add the flag to the build configuration like below example:
bundle config build.<gemname> --with-cflags="-Wno-error=implicit-function-declaration"
followed by
bundle install
Please note that you must replace <gemname> above with the name of the actual gem that is throwing the error while building native extensions.
I hope this becomes helpful to others that face similar issues in the future!
I used a simple solution... install through brew
brew install name
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
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.