我正在尝试使用 bundle install 将 gems 安装到我的新 Ruby 项目中。我已经在我的 OS X 10.8.4 机器上使用 rbenv 设置了 Ruby 的版本。我收到以下错误:
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.
前两行是第一次尝试输出的结尾。如您所见,然后我按要求成功安装了 atomic。然后我再次尝试并得到了同样的错误。我在安装 atomic 时看到了一些错误,但没有一个像这样。选项-R似乎有问题。由于我一开始没有输入它,所以我不知道在哪里更改它。
更新
我开始将 rbenv 设置为版本 2.0.0-p0 并运行 rails new jazz catalog -d mysql。它在同一个地方死了这个错误:
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.
解决 了叹息 - 不处理路径中的空格