Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New Rails Project: 'bundle install' can't install rails in gemfile

I have installed a new rails project like so:

$ rails new site

and it executes and reaches:

bundle install

but then I get this error, when it appears to try installing a dependency

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
checking for libkern/OSAtomic.h... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling atomic_reference.c
atomic_reference.c:57:59: warning: incompatible pointer types passing 'void **' to      parameter of type 'volatile int64_t *' (aka 'volatile long long *') [-Wincompatible-pointer-types]
if (OSAtomicCompareAndSwap64(expect_value, new_value, &DATA_PTR(self))) {
                                                      ^~~~~~~~~~~~~~~
/usr/include/libkern/OSAtomic.h:507:93: note: passing argument to parameter '__theValue'   here
bool    OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue, volatile int64_t   *__theValue );
                                                                                        ^
1 warning generated.
linking shared-object atomic_reference.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: *** [atomic_reference.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/mikeguppy/.bundler/tmp/26234/gems/atomic-1.1.16 for inspection.
Results logged to /Users/mikeguppy/.bundler/tmp/26234/extensions/universal-darwin-13/2.0.0/atomic-1.1.16/gem_make.out
An error occurred while installing atomic (1.1.16), and Bundler cannot continue.
Make sure that `gem install atomic -v '1.1.16'` succeeds before bundling.

I have then tried installing atomic independently with:

gem install atomic

and again no luck.

I'm running Ruby 2.0 on Mac OS 10.9.2


Any help would be much appreciated!

like image 430
moreguppy Avatar asked Mar 17 '14 17:03

moreguppy


People also ask

How do I install everything in Gemfile?

run the command bundle install in your shell, once you have your Gemfile created. This command will look your Gemfile and install the relevant Gems on the indicated versions. The Gemfiles are installed because in your Gemfile you are pointing out the source where the gems can be downloaded from. Save this answer.

What is the difference between Gemfile and Gemfile lock?

The Gemfile is where you specify which gems you want to use, and lets you specify which versions. The Gemfile. lock file is where Bundler records the exact versions that were installed. This way, when the same library/project is loaded on another machine, running bundle install will look at the Gemfile.


2 Answers

this worked for me: sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install rails

like image 59
Hermann Avatar answered Sep 28 '22 08:09

Hermann


I had this same problem and what worked for me was installing RVM, installing Ruby 2.1.1 (an upgrade from the 2.0 that comes packaged in Mavericks)...

rvm get stable
rvm reinstall 2.1.1

(use whatever the latest version is, for me that's 2.1.1)

...and then run rvm use 2.1.1 to make sure that I had switched to using that version.

After that, my gem installs ran smoothly.

like image 28
Dylan Avatar answered Sep 28 '22 07:09

Dylan