telling homebrew to use is own installed version of ruby#2.0 - homebrew

I have High Sierra Beta 6 Installed on my Mac Pro.
High sierra beta comes with Ruby 2.2 and brew doctor complains about it since it was tested only with ruby 2.0.
I can install ruby 2.0 with homebrew, is there a way to tell homebrew to actually use that version instead of the ruby version that comes with the OS ?

There’s no way to do that. High Sierra is still in beta so it’s normal it’s not fully supported by Homebrew.

Yes. You can change the ruby version used by homebrew. Just add these 2 lines to your .bash_profile
export HOMEBREW_DEVELOPER="yes"
export HOMEBREW_RUBY_PATH="/Users/USERNAME/.rbenv/shims/ruby"

Just updated to High Sierra. I experienced the same Ruby warnings after upgrade. What I did was:
1. brew doctor -- warnings shown
2. brew update
3. brew doctor -- no more warnings

Related

Is it possible to install an old version of Homebrew?

Since https://github.com/Homebrew/brew/pull/6083 Homebrew requires Xcode 10.2.1. However some projects I work on require Xcode 9.
How can I install an older version of Homebrew to work around this?

Trying to install rails, but I get the error "i386 architecture is deprecated on macOS."

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!
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
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.

Reinstalling Xcode on Mountain Lion after upgrading from Lion

I'm running OSX 10.8. My Mac had Snow Leopard when I got it, but I have since upgraded to Lion and then Mountain Lion. I'm trying to get my Ruby on Rails environment set up, and when I run Homebrew's "brew doctor" command, I get this:
Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please install the CLT or Xcode 5.0.1.
Warning: Your compilers are different from the standard versions for your Xcode.
If you have Xcode 4.3 or newer, you should install the Command Line Tools for
Xcode from within Xcode's Download preferences.
Otherwise, you should reinstall Xcode.
So I uninstalled and reinstalled Xcode (now have v 5.0.2) and the command line tools, and I'm still getting the same messages. I've tried doing:
sudo /Developer/Library/uninstall-devtools --mode=xcodedir
But I get this in response:
sudo: /Developer/Library/uninstall-devtools: command not found
Thanks in advance for any help.
Try which gcc to figure out which gcc you are using.
Then run which -a gcc to see all the gcc's that you have installed.
You'll probably find that you're using the osx version and that changing your path ordering in shell config, eg. bash.rc will fix this brew doctor error.

Rails 3 Compatibility Issue (Mac Snow Leopard 32 Bit)

I'm running Mac OS 10.6.8 on older iMac that is Core Duo, so it's 32-bit only. When I went to the terminal, I saw that I have Ruby 1.8.7, RubyGems 1.3.5, and Rails 2.3.5. I want to upgrade my Rails to 3 - which IS supported with Ruby 1.8.7 - and tried to do with RVM and all, but could not do so. I now almost suspect if it's the compatibility issue between Rails and RubyGems, but I'm not sure. I also do not seem to be able to upgrade RubyGems either.
If anyone can help, that would be great...I am not even sure if it's possible in the system since two resources on this issue - one by Hive Logic and another from Rails Installer - both spoke only of 64-bit systems. Is Rails 3 not possible in 32-bit only systems? Or is there any other issue that I'm not aware of?
UPDATE: I'm putting updates from my terminal. Thanks to everyone taking a look!
gem install rails
WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
/usr/bin aren't both writable.
WARNING: You don't have /Users/labuser/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
ERROR: Error installing rails:
bundler requires RubyGems version >= 1.3.6
UPDATE 2: Okay, so I tried again after installing RVM. I did it yesterday but deleted RVM after it wasn't working...but maybe someone can see what this means!
rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.6/i386/ruby-1.9.3-p392.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Can not find compiler and 'make' tool - make sure Xcode and/or Command Line Tools are installed.
UPDATE 3 (Resolved): Figured I would update it in case anyone has a similar problem in the future. I had to use sudo command to get things going... I wasn't able to upgrade my Ruby version (stuck at 1.8.7) but RubyGems and Rails both got updated, so things were able to move...It's not really smooth though, and I'm encountering additional problems that I didn't see before (just FYI).
To install rails/ruby on mac, here is what is needed.
Get the development tools: Install compatible version of Xcode & the needed tools to compile ruby will get bundled. or get the CLI Tools download.
Use rvm to install latest ruby. Don't use ruby 1.8.7, always 1.9.3 or newer.
The CLI Tools download is not supported for Snow leopard, I think. so your only option now is to find a version of xcode that's compatible with Mac OS X SL & then use rvm.
Here is a direct link to XCode 3.2.6 for Snow Leopard directly from Apple which I found after running a google search.
Lastly, as you may have noticed being on SL puts you on disadvantage & makes development hard. so I would advice you to upgrade to latest supported release.

How to use RVM to install Ruby 1.9.3 when Xcode 4.3.2 is installed and gcc is missing?

I got a new iMac with Lion and installed Xcode 4.3.2. After running
curl -L get.rvm.io | bash -s stable
I opened up a new bash, and used
$ rvm install 1.9.3
to install Ruby 1.9.3, but there were errors and the log said that the C compiler is not there. And rvm requirements says:
$ rvm requirements
[...]
Xcode 4.3+ users
- please be warned
- only ruby-1.9.3-p125+ is partially supported
- in case of any compilation issues:
* downgrade to Xcode 4.1
* uninstall Xcode and install osx-gcc-installer
and reinstall your rubies.
So does that mean I might need to downgrade to Xcode 4.1? What if I want to keep Xcode 4.3.2? Then will 1.9.3-p125+ be able to work, but only partially?
Update: or how about installing Ruby 1.9.2 -- will it work with the latest Rails 3.2.3? If so, how to add gcc? (using Xcode's gcc?)
To install 1.9.2 or lower you need to follow the instructions in this blog post. It outlines how it get a copy of GCC which does not conflict with Xcode but can be used to build Ruby.
Xcode 4.3, Homebrew and Ruby.
You cannot install the osx-gcc-installer as it will conflict with Xcode 4.3.2, overwriting the working versions of llvm-gcc and clang.
install osx-gcc-installer
use latest ruby:
rvm install ruby
it will be 1.9.3-p125 as it's latest ruby

Resources