1

The full text of the error

The most important line, to my untrained eye, seems to be: ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
But am I really supposed to modify the Xcode build settings?

I am trying $ sudo gem install rails.

My specs:
macOS High Sierra 10.13.6
Xcode version: 10.0 (10A255)
Ruby version: 2.3.7p456
Gem version: 2.7.8

Recommendations I've found so far:
1) Install xcode command line tools. They are installed.
2) bundle config build.nokogiri --use-system-libraries.
/\ I've read that I should not do this.

Any help would be greatly appreciated!

miken32
  • 42,008
  • 16
  • 111
  • 154
shodak
  • 65
  • 10
  • 2
    Don’t use system Ruby. Install Ruby with RVM, then retry `gem install rails`. – anothermh Dec 18 '18 at 21:14
  • Thank you. Should I remove this question? Does leaving it up help the next person? And is there a reason you didn't post a reply rather than a comment? – shodak Dec 18 '18 at 21:17
  • 1
    Because I make the same comment several times a week on nearly identical questions. The answer is always: [don't](https://robots.thoughtbot.com/psa-do-not-use-system-ruby) [use](https://chrisherring.co/posts/why-you-shouldn-t-use-the-system-ruby) [system Ruby](http://billpatrianakos.me/blog/2014/05/15/never-use-system-ruby-ever/), and short/glib responses are better suited to comments. – anothermh Dec 18 '18 at 21:26
  • 1
    Going forward, never post your error message by supplying a link to an external website. Post it **here**, in your question. Links die; external sites may be blocked; etc. – anothermh Dec 18 '18 at 21:28
  • @anothermh so do you have a dupe to flag against? – miken32 Dec 19 '18 at 00:31
  • I could find dozens of questions where the gist is "I'm having trouble installing a gem with system Ruby" but I'm not sure it's worth the time to look for even one. The answer is simple: don't use system Ruby. – anothermh Dec 19 '18 at 01:26

2 Answers2

1

As @anothermh mentioned, you shouldn't use system ruby. I'd mention further that you don't want to, and shouldn't need to, run sudo to install gems.

Use a ruby version manager such as asdf (my recommended), rvm (probably one of the most popular), or rbenv (also a solid choice).

I'd also recommend, if you haven't done it already, that you grab homebrew because you'll need a few dependencies. Highly recommend at least:

brew install gcc libxml2 readline
Jay Dorsey
  • 3,563
  • 2
  • 18
  • 24
0

I've tried to bundle install and had issue like this. In my case upgrading rails from 4.2.5. to 4.2.9 fixed error. Maybe it will help someone to not lose time.

  • 1
    https://stackoverflow.com/questions/53528115/i386-arch-error-installing-old-scrypt-gem-version-with-os-x-mojave - this will work for Mojave – Roman Koshynskyi Dec 27 '19 at 13:17