Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Foundations Ruby Basics Installing Ruby

alborz
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
alborz
Full Stack JavaScript Techdegree Graduate 30,885 Points

Following the installation of OSX-gcc-installer, I cannot install gems, basically use Ruby in programming

When installing OSX-gcc installer, I found that I cannot install gems later on in the course when they are needed. So in effect it looks like something is broken. I'm not sure if it's because I have OSX 10.9 or that I already had XCode on my machine before installing OSX-gcc-installer. This stopped my progress in the Rails Development track until I can find a solution that hopefully doesn't break anything else.

For example, when typing: gem install money; or, gem install awesome_print in order to work with hashes, I cannot.

Terminal returns the following when I try to install the gems money and awesome_print:

albys-mbp:~ alby$ gem install money
ERROR:  Loading command: install (LoadError)
    dlopen(/Users/alby/.rbenv/versions/2.1.4/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle, 9): Library not loaded: @@HOMEBREW_CELLAR@@/openssl/1.0.1j/lib/libcrypto.1.0.0.dylib
  Referenced from: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Reason: image not found - /Users/alby/.rbenv/versions/2.1.4/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

When I try to install awesome_print terminal returns the following:

albys-mbp:~ alby$ gem install awesome_print
ERROR:  Loading command: install (LoadError)
    dlopen(/Users/alby/.rbenv/versions/2.1.4/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle, 9): Library not loaded: @@HOMEBREW_CELLAR@@/openssl/1.0.1j/lib/libcrypto.1.0.0.dylib
  Referenced from: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Reason: image not found - /Users/alby/.rbenv/versions/2.1.4/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

Additionally, when I run brew doctor, terminal returns the following:

albys-mbp:~ alby$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: You have an outdated version of /usr/bin/install_name_tool installed.
This will cause binary package installations to fail.
This can happen if you install osx-gcc-installer or RailsInstaller.
To restore it, you must reinstall OS X or restore the binary from
the OS packages.

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 run `xcode-select --install` to install the CLT.

I thought I could reinstall the Mavericks installer to fix it, but I can't even try and reinstall the Mavericks installer via http://osxdaily.com/2013/11/01/re-download-os-x-mavericks-installer-mac-app-store/ since when I try, the App Store says that OSX Mavericks is no longer available in the US.

Also, I tried this: https://github.com/Homebrew/homebrew/issues/29989#issuecomment-45585730. However when I try and run those commands the terminal just says that those files do not exist.

This https://stackoverflow.com/questions/9332196/how-to-remove-the-osx-gcc-installer doesn't work as when I reinstall XCode terminal still says that I have osx-gcc-installer on my machine.

So basically I just want to make sure I can find a solution that can fix what OSX-gcc-installer seemed to break without (hopefully) having to reinstall OSX.

Thanks in advance.

16 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Alborz M. before you take that drastic action, what about symlinking everything in that directory back to /usr/bin?

cd  /Library/Developer/CommandLineTools/
sudo ln -s * /usr/bin

Hi Alborz,

Well regarding the reinstall : it fixes the problems you encounter 99%.

Well to be honest I never tried Time Machine backup before and I'm using Macs for a loooooong time.

But I think you could restore only those files you want, but if I know the system enough you can just select the time machine backup and it restores all the data. But I could be wrong.

My solution was always a ext HD connected to my router and I have all my pic libraries, music and documents saved on that HD, 'cos I tend to test alot of apps, programs, procedures and so on. That's why I save all files directly to that HD. ( and to be honest I only have 128 GB Flash disk in my MacBook Pro 13, so there is no room :)).

Are you familiar with these commands: ./configure, make, make install ? Using prefixes for the configure procedure? Parsing library locations at configure time?

I can check myself what you are trying to install. But you'll sadly have to wait for a bit to get the answer: my daughter takes most of my time. But I could muster an walkthrough 'till tomorrow evening Vienna time. And we could maybe IM on skype to help you out.

Just let me know and we could arrange something to help you out.

alborz
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
alborz
Full Stack JavaScript Techdegree Graduate 30,885 Points

I am actually not familiar with those things you mentioned.

No worries. Sure -- that sounds like a good plan. Just reply back to this chain so I'll see and I should be ready to chat via Skype if you'd like. Thanks.

Alborz you here?

You can add me on skype: nejc.vukovic and lets try to fix something. Last case scenario we use a hammer:D Let me just grab a beer:D

alborz
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
alborz
Full Stack JavaScript Techdegree Graduate 30,885 Points

Hi Joseph,

When I try and run:

/Library/Developer/4.1/uninstall-devtools -mode=all

I get:

 -bash: /Library/Developer/4.1/uninstall-devtools: No such file or directory

So it doesn't seem like this is working...

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Alborz M. try doing the following:

brew install openssl

Then reinstall ruby using rbenv and let us know if that fixes it. Sorry for the trouble!

alborz
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
alborz
Full Stack JavaScript Techdegree Graduate 30,885 Points

Hey Jason Seifer when I ran:

brew install openssl

I got the following:

alborzs-mbp:~ alby$ brew install openssl
Warning: openssl-1.0.1j already installed
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 run `xcode-select --install` to install the CLT.
Warning: You have an outdated version of /usr/bin/install_name_tool installed.
This will cause binary package installations to fail.
This can happen if you install osx-gcc-installer or RailsInstaller.
To restore it, you must reinstall OS X or restore the binary from
the OS packages.

Do I still need to try and reinstall Ruby using rbenv? Would I do that just by running the command rbenv install 2.1.4 as in just installing it again?

Thanks!

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Alborz M. we'll probably have to go back and forth a few times to get this fixed :( For now, do the following:

xcode-select --install

Then follow the instructions. After that, you'll need to reinstall homebrew and rbenv and try the installation again.

alborz
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
alborz
Full Stack JavaScript Techdegree Graduate 30,885 Points

Hey Jason Seifer glad to hear from you.

So after running xcode-select --install I get the following:

alborzs-mbp:~ alby$ xcode-select --install
Usage: xcode-select -print-path
   or: xcode-select -switch <xcode_folder_path>
   or: xcode-select -version
Arguments:
   -print-path                     Prints the path of the current Xcode folder
   -switch <xcode_folder_path>     Sets the path for the current Xcode folder
   -version                        Prints xcode-select version information
alborzs-mbp:~ alby$ 

Should I get something else? It just displays commands and not really instructions. I do already have XCode installed as well.

So then I thought I should try uninstalling XCode. I removed the application from the applications folder and emptied the bin; then I tried to uninstall XCode from the command line by running:

alborzs-mbp:~ alby$ sudo /Developer/Library/uninstall-devtools --mode=all
Password:
sudo: /Developer/Library/uninstall-devtools: command not found
alborzs-mbp:~ alby$ 

However this time nothing really happens... I remember removing it once before doing it this way and it did remove it.

Additionally, when I run

alborzs-mbp:~ alby$ xcode-select --version
xcode-select version 2003.
alborzs-mbp:~ alby$ 

It says I have a 2003 version even though the last time I installed it was from the app store...

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Alborz M. this is a bit weird. Try going to the Apple XCode Downloads site and downloading the Command Line Tools for XCode and running that installation and let me know how that goes.

alborz
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
alborz
Full Stack JavaScript Techdegree Graduate 30,885 Points

Jason Seifer So after installing The Command Line Tools for XCode, OS X 10.9, 6.1.1. GM seed -- after that installation finished, I opened up the XCode application it seemed fine. However the same thing as last time happens when I check to see which version of XCode I have from the command line; as well as when I try to run that installation command the same thing happens: commands populate instead of some kind of instructions.

alborz
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
alborz
Full Stack JavaScript Techdegree Graduate 30,885 Points

Jason Seifer Also I went back and uninstalled Ruby using rvm. After uninstalling I went and tried to install it again using rvm but I got the following failure:

alborzs-mbp:~ alby$ rvm install 2.1.4
Warning, new version of rvm available '1.26.3', you are using older version '1.26.0'.
You can disable this warning with:    echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable  auto-update  with:    echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/osx/10.9/x86_64/ruby-2.1.4.tar.bz2
Checking requirements for osx.
dyld: Library not loaded: @@HOMEBREW_CELLAR@@/openssl/1.0.1j/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/openssl/bin/openssl
  Reason: image not found
Failed reading certificates path for '/usr/local/opt/openssl/bin/openssl' with return code: (0).
RVM autolibs is now configured with mode '4' =>
  'Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X).',
please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
or visit https://rvm.io/rvm/autolibs for more information.
Requirements installation failed with status: 133.
alborzs-mbp:~ alby$ 

So then I tried installing Ruby using rbenv, but to no avail:

alborzs-mbp:~ alby$ rbenv install 2.1.4
Downloading ruby-2.1.4.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/bf9952cdeb3a0c6a5a27745c9b4c0e5e264e92b669b2b08efb363f5156549204
Installing ruby-2.1.4...

BUILD FAILED (OS X 10.9.5 using ruby-build 20141028-3-ge8a97b1)

Inspect or clean up the working tree at /var/folders/cf/swry5nb541lc6g6xnbcrh9b40000gn/T/ruby-build.20141118172954.35402
Results logged to /var/folders/cf/swry5nb541lc6g6xnbcrh9b40000gn/T/ruby-build.20141118172954.35402.log

Last 10 log lines:
installing rdoc:              /Users/alby/.rbenv/versions/2.1.4/share/ri/2.1.0/system
installing capi-docs:         /Users/alby/.rbenv/versions/2.1.4/share/doc/ruby
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?
Configure options used:
  --prefix=/Users/alby/.rbenv/versions/2.1.4
  --with-openssl-dir=/usr/local/opt/openssl
  --with-readline-dir=/usr/local/opt/readline
  CFLAGS= -O3 -Wno-error=shorten-64-to-32 
  LDFLAGS=-L/Users/alby/.rbenv/versions/2.1.4/lib 
  CPPFLAGS=-I/Users/alby/.rbenv/versions/2.1.4/include 

alborzs-mbp:~ alby$ rvm install 2.1.4
Warning, new version of rvm available '1.26.3', you are using older version '1.26.0'.
You can disable this warning with:    echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable  auto-update  with:    echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/osx/10.9/x86_64/ruby-2.1.4.tar.bz2
Checking requirements for osx.
dyld: Library not loaded: @@HOMEBREW_CELLAR@@/openssl/1.0.1j/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/openssl/bin/openssl
  Reason: image not found
Failed reading certificates path for '/usr/local/opt/openssl/bin/openssl' with return code: (0).
RVM autolibs is now configured with mode '4' =>
  'Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X).',
please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
or visit https://rvm.io/rvm/autolibs for more information.
Requirements installation failed with status: 133.
alborzs-mbp:~ alby$ rvm autolibs enable
alborzs-mbp:~ alby$ rvm install 2.1.4
Warning, new version of rvm available '1.26.3', you are using older version '1.26.0'.
You can disable this warning with:    echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable  auto-update  with:    echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/osx/10.9/x86_64/ruby-2.1.4.tar.bz2
Checking requirements for osx.
dyld: Library not loaded: @@HOMEBREW_CELLAR@@/openssl/1.0.1j/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/openssl/bin/openssl
  Reason: image not found
Failed reading certificates path for '/usr/local/opt/openssl/bin/openssl' with return code: (0).
RVM autolibs is now configured with mode '4' =>
  'Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X).',
please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
or visit https://rvm.io/rvm/autolibs for more information.
Requirements installation failed with status: 133.
alborz
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
alborz
Full Stack JavaScript Techdegree Graduate 30,885 Points

Hi Jason Seifer , so upon further research on the Internet I've come across what seems to be a very nasty problem.

Apparently installing OSX-gcc-installer breaks the 10.9 dev tools badly enough that one needs to reinstall the OS. On 10.9 the tools in /usr/bin are shims, but osx-gcc-installer overwrites them with obsolete tools. Xcode/CLT installers don't install them.

10.9 comes with shims for the commandline tools in /usr/bin. The real commandline tools are installed into /Library/Developer/CommandLineTools/. When the commandline tools are installed, the xcode path gets updated so the shims will call the CLT versions instead.

What's happened here is that osx-gcc-installer overwrote the shims, and the CLT install does not install anything to /usr/bin that would overwrite them. The only way to get them back is an OS reinstall, because they only come with the OS.

I'm assuming this is a clean reinstall rather than this kind of reinstall, "Use the built-in recovery disk to reinstall OS X while keeping your files and user settings intact.":

http://support.apple.com/kb/ph13871

Thanks

alborz
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
alborz
Full Stack JavaScript Techdegree Graduate 30,885 Points

Jason Seifer When I run those commands I get:

alborzs-mbp:~ alby$ cd  /Library/Developer/CommandLineTools/
alborzs-mbp:CommandLineTools alby$ ln -s * /usr/bin
ln: /usr/bin/Library: Permission denied
ln: /usr/bin/usr: Permission denied
alborzs-mbp:CommandLineTools alby$ 
Jason Seifer
Jason Seifer
Treehouse Guest Teacher

Sorry, add a sudo in front of the ln -s part and it should work.

Jason Seifer
Jason Seifer
Treehouse Guest Teacher

Yep! Try installing homebrew and rbenv and give it another shot.

alborz
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
alborz
Full Stack JavaScript Techdegree Graduate 30,885 Points

Jason Seifer AHHHH I am now able to install gems!!!!! Thank you Jason. You're the man... Now I can continue on the track I'm so happy -- I was just about to give up.... Seems like reinstalling ruby via rbenv did the trick.

Well, I just don't know if OSX-gcc-installer won't cause any build failures or things of that nature going forward. I mean, isn't it a hindrance to have on my machine if I'm going forward to seriously create some things via Rails?

I just wanted to check how things are so I ran brew doctor after being able to successfully install the money and awesome_print gems and got the following; not sure if the broken symlinks are an issue. Going forward, is there anything I should do and/or worry about?

alborzs-mbp:~ alby$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: You have an outdated version of /usr/bin/install_name_tool installed.
This will cause binary package installations to fail.
This can happen if you install osx-gcc-installer or RailsInstaller.
To restore it, you must reinstall OS X or restore the binary from
the OS packages.

Warning: Broken symlinks were found. Remove them with `brew prune`:
  /usr/local/bin/aclocal
  /usr/local/bin/aclocal-1.14
  /usr/local/bin/autoconf
  /usr/local/bin/autoheader
  /usr/local/bin/autom4te
  /usr/local/bin/automake
  /usr/local/bin/automake-1.14
  /usr/local/bin/autoreconf
  /usr/local/bin/autoscan
  /usr/local/bin/autoupdate
  /usr/local/bin/cscope
  /usr/local/bin/erb
  /usr/local/bin/gem
  /usr/local/bin/glibtool
  /usr/local/bin/glibtoolize
  /usr/local/bin/gpg-error
  /usr/local/bin/gpg-error-config
  /usr/local/bin/ifnames
  /usr/local/bin/irb
  /usr/local/bin/ksba-config
  /usr/local/bin/ocs
  /usr/local/bin/pkg-config
  /usr/local/bin/rake
  /usr/local/bin/rdoc
  /usr/local/bin/ri
  /usr/local/bin/ruby
  /usr/local/bin/testrb
  /usr/local/include/gpg-error.h
  /usr/local/include/ksba.h
  /usr/local/include/libltdl
  /usr/local/include/ltdl.h
  /usr/local/include/ruby-2.1.0
  /usr/local/include/yaml.h
  /usr/local/lib/libgpg-error.0.dylib
  /usr/local/lib/libgpg-error.dylib
  /usr/local/lib/libksba.8.dylib
  /usr/local/lib/libksba.dylib
  /usr/local/lib/libltdl.7.dylib
  /usr/local/lib/libltdl.a
  /usr/local/lib/libltdl.dylib
  /usr/local/lib/libruby.2.1.0-static.a
  /usr/local/lib/libruby.2.1.0.dylib
  /usr/local/lib/libruby.2.1.dylib
  /usr/local/lib/libruby.dylib
  /usr/local/lib/libyaml-0.2.dylib
  /usr/local/lib/libyaml.a
  /usr/local/lib/libyaml.dylib
  /usr/local/lib/pkgconfig/ruby-2.1.pc
  /usr/local/lib/pkgconfig/yaml-0.1.pc
  /usr/local/lib/ruby/2.1.0
  /usr/local/lib/ruby/gems
  /usr/local/share/aclocal/README
  /usr/local/share/aclocal/argz.m4
  /usr/local/share/aclocal/dirlist
  /usr/local/share/aclocal/gpg-error.m4
  /usr/local/share/aclocal/ksba.m4
  /usr/local/share/aclocal/libtool.m4
  /usr/local/share/aclocal/ltdl.m4
  /usr/local/share/aclocal/ltoptions.m4
  /usr/local/share/aclocal/ltsugar.m4
  /usr/local/share/aclocal/ltversion.m4
  /usr/local/share/aclocal/lt~obsolete.m4
  /usr/local/share/aclocal/pkg.m4
  /usr/local/share/aclocal-1.14
  /usr/local/share/autoconf
  /usr/local/share/automake-1.14
  /usr/local/share/common-lisp
  /usr/local/share/doc/automake
  /usr/local/share/doc/pkg-config/pkg-config-guide.html
  /usr/local/share/emacs
  /usr/local/share/info/gpgrt.info
  /usr/local/share/info/ksba.info
  /usr/local/share/info/libtool.info
  /usr/local/share/info/libtool.info-1
  /usr/local/share/info/libtool.info-2
  /usr/local/share/libtool
  /usr/local/share/man/man1/aclocal-1.14.1
  /usr/local/share/man/man1/aclocal.1
  /usr/local/share/man/man1/autoconf.1
  /usr/local/share/man/man1/autoheader.1
  /usr/local/share/man/man1/autom4te.1
  /usr/local/share/man/man1/automake-1.14.1
  /usr/local/share/man/man1/automake.1
  /usr/local/share/man/man1/autoreconf.1
  /usr/local/share/man/man1/autoscan.1
  /usr/local/share/man/man1/autoupdate.1
  /usr/local/share/man/man1/config.guess.1
  /usr/local/share/man/man1/config.sub.1
  /usr/local/share/man/man1/cscope.1
  /usr/local/share/man/man1/erb.1
  /usr/local/share/man/man1/glibtool.1
  /usr/local/share/man/man1/glibtoolize.1
  /usr/local/share/man/man1/gpg-error-config.1
  /usr/local/share/man/man1/ifnames.1
  /usr/local/share/man/man1/irb.1
  /usr/local/share/man/man1/pkg-config.1
  /usr/local/share/man/man1/rake.1
  /usr/local/share/man/man1/ri.1
  /usr/local/share/man/man1/ruby.1
  /usr/local/Library/LinkedKegs/autoconf
  /usr/local/Library/LinkedKegs/automake
  /usr/local/Library/LinkedKegs/cscope
  /usr/local/Library/LinkedKegs/libgpg-error
  /usr/local/Library/LinkedKegs/libksba
  /usr/local/Library/LinkedKegs/libtool
  /usr/local/Library/LinkedKegs/libyaml
  /usr/local/Library/LinkedKegs/pkg-config
  /usr/local/Library/LinkedKegs/ruby

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 run `xcode-select --install` to install the CLT.
alborzs-mbp:~ alby$ 

My opinion and practice:

If I have some packages that could cause problems like this and the system says that they are "Legacy" modules that could cause problems - I always use source code and compile it on my own to another folder ( brew is ok for fast installation but it really gives me a headache when I don't know where those files are installed), then parsing the libraries it should use and work my way through the dependencies myself to get a better view of what going on the system.

It takes more time to do it initially but it's better in the long run.

alborz
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
alborz
Full Stack JavaScript Techdegree Graduate 30,885 Points

Hi Nejc, thanks for your response. Unfortunately I'm not quite sure on where to begin in order to accomplish what you've outlined above. I haven't yet that experience. Any resource or guide I could use?

Also, even if I were to reinstall my OS X, and I already have my HD backed up, would I be able to select from the HD backup what I need and want? (I've used Time Machine with the HD backup.)