Make does not work during installation of json-1.8.0 with the unrecognized "-arch" option on OSX 10.8.4

I'm trying to set up my ruby โ€‹โ€‹environment correctly, but keep getting errors when trying to bundle install my test application.

First, I get an error when trying to bundle install :

 $ rails new app // [...] run bundle install Fetching gem metadata from https://rubygems.org/.. Resolving dependencies... Using rake (10.1.0) Using i18n (0.6.5) Using multi_json (1.7.9) Using activesupport (3.2.9) Using builder (3.0.4) Using activemodel (3.2.9) Using erubis (2.7.0) Using journey (1.0.4) Using rack (1.4.5) Using rack-cache (1.2) Using rack-test (0.6.2) Using hike (1.2.3) Using tilt (1.4.1) Using sprockets (2.2.2) Using actionpack (3.2.9) Using mime-types (1.23) Using polyglot (0.3.3) Using treetop (1.4.14) Using mail (2.4.4) Using actionmailer (3.2.9) Using arel (3.0.2) Using tzinfo (0.3.37) Using activerecord (3.2.9) Using activeresource (3.2.9) Using bundler (1.3.5) Using coffee-script-source (1.6.3) Using execjs (1.4.0) Using coffee-script (2.2.0) Using rack-ssl (1.3.3) Installing json (1.8.0) Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/ryan/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb creating Makefile make compiling generator.c gcc-4.6: error: x86_64: No such file or directory gcc-4.6: error: unrecognized option '-arch' make: *** [generator.o] Error 1 Gem files will remain installed in /Users/ryan/.rvm/gems/ruby-1.9.3-p327/gems/json-1.8.0 for inspection. Results logged to /Users/ryan/.rvm/gems/ruby-1.9.3-p327/gems/json-1.8.0/ext/json/ext/generator/gem_make.out An error occurred while installing json (1.8.0), and Bundler cannot continue. Make sure that `gem install json -v '1.8.0'` succeeds before bundling. 

Following the last line of the error message, I try to run gem install json -v '1.8.0' , but I get the following:

 Building native extensions. This could take a while... ERROR: Error installing json: ERROR: Failed to build gem native extension. /Users/ryan/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb creating Makefile make compiling generator.c gcc-4.6: error: x86_64: No such file or directory gcc-4.6: error: unrecognized option '-arch' make: *** [generator.o] Error 1 Gem files will remain installed in /Users/ryan/.rvm/gems/ruby-1.9.3-p327/gems/json-1.8.0 for inspection. Results logged to /Users/ryan/.rvm/gems/ruby-1.9.3-p327/gems/json-1.8.0/ext/json/ext/generator/gem_make.out 

Any help would be greatly appreciated ... I am currently using the following versions of rvm, ruby โ€‹โ€‹+ rails:

 $ ruby -v ruby 1.9.3p327 (2012-11-10) [x86_64-darwin12.2.0] $ rails -v Rails 3.2.9 $ rvm -v rvm 1.22.1 (stable) by Wayne E. Seguin < wayneeseguin@gmail.com >, Michal Papis < mpapis@gmail.com > [https://rvm.io/] 

Please let me know if you need any other information.

+6
source share
5 answers

it sounds like this might be caused by binary ruby, try:

 rvm get head rvm reinstall 1.9.3-p327 --disable-binary 
+9
source

remove gemfile.lock and run the package

+5
source

If you have rvm installed, this should work:

 rvm reinstall 2.0.0-p247 --disable-binary 

If you just upgraded OS X, you can try something else first. See the manual for thought .

0
source

I had this problem, I decided to change the Ruby version for the default version 1.9.3p327.

Leave the project folder and run the command:

 rvm use 1.9.3-P327 --default 

I donโ€™t know why this is because rvm changes the version in the project, but after that it didnโ€™t give an error when executing 'bundle install'

0
source

I think you should install the correct version of your rvm. for example, if your application is developed in Ruby 1.9.3, you should install "rvm use 1.9.3". Then you can enter the install package command. Maybe this will help you.

thanks

0
source

Source: https://habr.com/ru/post/951755/


All Articles