Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
360 views
in Technique[技术] by (71.8m points)

ruby - Error Installing Atomic

I'm trying to install gems to my new Ruby project using bundle install. I've set the version of Ruby using rbenv on my OS X 10.8.4 box. I get the following error:

An error occurred while installing atomic (1.1.13), and Bundler cannot continue.
Make sure that `gem install atomic -v '1.1.13'` succeeds before bundling.
Kikime:jazzcatalog curt$ gem install atomic
Building native extensions.  This could take a while...
Successfully installed atomic-1.1.13
1 gem installed
Kikime:jazzcatalog curt$ rbenv rehash
Kikime:jazzcatalog curt$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.1.0) 
Using i18n (0.6.5) 
Using minitest (4.7.5) 
Using multi_json (1.7.9) 
Installing atomic (1.1.13) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/curt/.rbenv/versions/2.0.0-p247/bin/ruby extconf.rb 
/Users/curt/.rbenv/versions/2.0.0-p247/bin/ruby: invalid option -R  (-h will show valid       options) (RuntimeError)


Gem files will remain installed in /Volumes/Data     RAID/htdocs/jazzcatalog/vendor/bundle/gems/atomic-1.1.13 for inspection.
Results logged to /Volumes/Data RAID/htdocs/jazzcatalog/vendor/bundle/gems/atomic- 1.1.13/ext/gem_make.out

An error occurred while installing atomic (1.1.13), and Bundler cannot continue.
Make sure that `gem install atomic -v '1.1.13'` succeeds before bundling.

The first two lines are the end of the output from first attempt. As you can see, I then successfully installed atomic as requested. I then tried again and got the same error. I've seen a few errors with installing atomic, but none like this one. It seems to have a problem with the option -R. Since I didn't enter it in the first place, I don't know where to change it.

Update

I started all over rbenv set to version 2.0.0-p0 and and ran rails new jazz catalog -d mysql. It died at the same place with this error:

Installing atomic (1.1.13)

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/curt/.rbenv/versions/2.0.0-p0/bin/ruby extconf.rb 
creating Makefile

make
compiling atomic_reference.c
 atomic_reference.c:50:9: warning: implicit declaration of function  'OSAtomicCompareAndSwap64' is invalid in C99 [-Wimplicit-function-declaration]
if (OSAtomicCompareAndSwap64(expect_value, new_value, &DATA_PTR(self))) {
    ^
1 warning generated.
linking shared-object atomic_reference.bundle

make install
/usr/bin/install -c -m 0755 atomic_reference.bundle /Volumes/Data   RAID/htdocs/jazzcatalog/vendor/bundle/gems/atomic-1.1.13/lib
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
           [-o owner] file1 file2
   install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
           [-o owner] file1 ... fileN directory
   install -d [-v] [-g group] [-m mode] [-o owner] directory ...
make: *** [install-so] Error 64


Gem files will remain installed in /Volumes/Data     RAID/htdocs/jazzcatalog/vendor/bundle/gems/atomic-1.1.13 for inspection.
Results logged to /Volumes/Data RAID/htdocs/jazzcatalog/vendor/bundle/gems/atomic- 1.1.13/ext/gem_make.out
An error occurred while installing atomic (1.1.13), and Bundler cannot continue.
Make sure that `gem install atomic -v '1.1.13'` succeeds before bundling.

SOLVED Sigh - does not handle spaces in path

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I had this problem. It turned out to be caused by installing Mac OS 10.9 (Mavericks), since Mavericks has a new stand alone command line tools separate from Xcode. To solve this, I deleted /Applications/Xcode and then installed the stand alone command line tools via:

Note: First line may not be needed, see comments below

sudo rm -rf /Applications/Xcode
xcode-select --install

then click 'install' from the OSX pop up window

source: http://www.computersnyou.com/2025/2013/06/install-command-line-tools-in-osx-10-9-mavericks-how-to/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...