Reinstalling Xcode on Mountain Lion after upgrading from Lion - ruby-on-rails

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.

Related

Error installing homebrew on MacOS 10.14 Beta Mojave

Im trying to install Homebrew on a fresh install of MacOS Mojave 10.14 beta.
Yet after running /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" (this is from https://brew.sh)
I am getting the error,
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Failed during: /usr/bin/sudo /usr/bin/xcode-select --install
I have both the current command line tools from Xcode 9.4 and the beta command line tools for Xcode 10.0 beta.
Is there currently any workaround to allow me to install Homebrew?
I believe the problem is that the Command Line Tools for Xcode 10 do not install headers in /usr/include, but the install script checks there:
https://github.com/Homebrew/install/blob/bbf4a3a8b247c7dba159c3d557cc3853dd764171/install#L110
Thankfully, the code that tries to run xcode-select --install is bypassed if STDIN is not a TTY. Try adding a 0<&- after the install command to close STDIN and skip this command. I just tried it and it worked for me.
As an aside, Homebrew does not officially support 10.14 yet, and the maintainers do not want you to file issues about any problems you find. (Pull requests seem welcome, though.) Unfortunately this means that the Homebrew issue tracker is not a place to discuss problems and solutions.

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

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

RoR: Fail on 'gem install mysql2' on Mac

I am on OS X Yosemite (10.10.3)
I have installed mysql via Homebrew
I get the following error when I run bundle on my project
My recent upgrade to yosemite might be causing the problem. I had xcode version 6.3, which I downgraded to 6.2 and tried bundle and it worked!

Installing Rails on Mavericks

Not sure what happened but when I upgraded to Mavericks it says that Rails it not install. I executed the following command:
rails --version
And it said "Rails is not currently installed and run sudo gem install rails".
I run sudo gem install rails and get the following:
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.1 for inspection.
UPDATE:
I ran the command gcc --version and got the following:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
You need to install the Command Line Developer Tools. Just open Terminal and type up a command that requires it -- for instance, git, gcc or make. Or use the following command:
$ xcode-select --install
You'll see an alert like this:
Just click Install and that's it. As of OS X 10.9, there's no longer need to install Xcode for Ruby development.
Credit for the steps and picture goes to Daniel Kehoe in his latest guide: http://railsapps.github.io/installrubyonrails-mac.html
I had the same problem which I have now been able to solve.
The problem for me was that I had updated to the latest version of Xcode through the appstore but hadn't actually opened the application to complete the install. So here's what solved it for me:
Updated Xcode
Opened Xcode application
Accepted license agreement
Installed rails
Hope it works for you too.
It wasn't working for me even when I reinstalled xcode and the command line tools for mavericks.
But after that, I just did a bundle update and, for some reason, it worked.
I think I had the same issues. I updated the xcode and open xcode to accept licence aggrement. Then it worked fine as far as I can remember.

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