2

I have just wasted 2 days of my life trying to figure this out, and I need some help please!

I am a complete noob to ruby, and all I want to do is install octopress so that I can have a blog. I think I messed up my mac dev environment somehow - when I try to install ruby with rbenv, it fails and tells me that it cannot find make? How do I fix this?

Thanks for your help in advance.

Mike

Installing ruby-2.4.0...

BUILD FAILED (OS X 10.12.3 using ruby-build 20170201)

Inspect or clean up the working tree at /var/folders/d7/xhd01lr92rvglw0vw9hzkx1m0000gn/T/ruby-build.20170214143528.84918
Results logged to /var/folders/d7/xhd01lr92rvglw0vw9hzkx1m0000gn/T/ruby-build.20170214143528.84918.log

Last 10 log lines:
checking for sigsetjmp as a macro or function... yes
checking for setjmp type... _setjmp
checking for prefix of external symbols... _
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking if make is GNU make... ./configure: /usr/local/bin/make: /usr/local/opt/ruby/bin/ruby: bad interpreter: No such file or directory
no
checking for safe null command for make... configure: error: no candidate for safe null command
/usr/local/bin/ruby-build: /usr/local/bin/make: /usr/local/opt/ruby/bin/ruby: bad interpreter: No such file or directory

Here is the output of the following commands:

$ which ruby
/usr/bin/ruby

head /usr/local/bin/make
#!/usr/local/opt/ruby/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'make' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

And here is the output of echo $PATH:

/Users/michaelhenry/.rbenv/shims:/Users/michaelhenry/.rbenv/bin:/usr/local/bin:/Users/michaelhenry/.rbenv/shims:/Users/michaelhenry/.rbenv/bin:/usr/local/Cellar/coreutils/8.26/libexec/gnubin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
  • I think you've installed Ruby with Homebrew previously. But that installation (`/usr/local/opt/ruby`) seems broken. You need to uninstall the Homebrew version and try again. Someone had a similar issue here: https://github.com/rbenv/rbenv/issues/886 – Casper Feb 14 '17 at 22:27
  • Also see this in case you broke your system Ruby http://stackoverflow.com/a/8864749/823617 – Casper Feb 14 '17 at 22:33
  • Thanks for your input - I had already seen those two posts, and none of the suggestions worked. I even tried booting into the mac recovery partition and reinstalling Sierra - then I installed homebrew, rbenv, and the newest version of the Xcode command line tools. I STILL get the same error. Any thoughts? – Michael Henry Feb 15 '17 at 17:56
  • Also, this is the terminal output when I `echo $PATH`: `/Users/michaelhenry/.rbenv/shims:/Users/michaelhenry/.rbenv/bin:/usr/local/bin:/Users/michaelhenry/.rbenv/shims:/Users/michaelhenry/.rbenv/bin:/usr/local/Cellar/coreutils/8.26/libexec/gnubin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands` – Michael Henry Feb 15 '17 at 18:00
  • Ok in that case please append the results of the following commands to your question: `which ruby` and `head /usr/local/bin/make`. – Casper Feb 15 '17 at 18:15
  • Why do you even have a `make` command in `/usr/local/bin`. That doesn't usually belong there. How did it get there? – Casper Feb 15 '17 at 18:18
  • I have *no idea* how `make` got into that directory. In my efforts to fix the problem, I am sure that I messed it up more... Anyway, here are the results of the commands: `$ which ruby /usr/bin/ruby` `#!/usr/local/opt/ruby/bin/ruby # This file was generated by RubyGems. # # The application 'make' is installed as part of a gem, and # this file is here to facilitate running it. # require 'rubygems'` – Michael Henry Feb 15 '17 at 18:27
  • Also, how do I get rid of the duplicate entries in my `$PATH`? My `.bash_profile` does not have any duplicates, as far as I can tell, and my `.bashrc` file is empty. – Michael Henry Feb 15 '17 at 18:31
  • Put that text in the question..the formatting will be much better there and it complements the question, making it easier to understand. In any case let's move it out of the way for now: `sudo mv /usr/local/bin/make /usr/local/bin/make_old`. Then see if you can get everything to work. – Casper Feb 15 '17 at 18:32
  • Holy crap, that worked. I cannot thank you enough. – Michael Henry Feb 15 '17 at 18:50
  • Great :) Somehow you managed to install a ruby gem named "make" into `/usr/local/bin`. Have no clue how it got there, but I suspect it should never be there ever. So you can just keep it named as `make_old`, or probably even remove it. As for the PATH, you have to research how the shell loads its PATH variable (there are files in `/etc` also), but the problem could be coming from rbenv setup too. You'll figure it out eventually if you research a bit (or make a new SO question). Good luck. – Casper Feb 15 '17 at 18:57
  • Thanks, I really appreciate it :) – Michael Henry Feb 15 '17 at 19:08

0 Answers0