Installing Compass on Mac OS X 10.12 Sierra - ruby

I am working on two separate machines; one that has Compass installed on it from when the machine was running OS X Yosemite (happy with this one); and one that I am trying to install Compass on that is currently running OS X Sierra (Not so happy about this one).
I had some trouble back in the day with gem install compass while running Yosemite and after searching Stack it seemed that the issue was a user could no longer write to the specified directory they were trying to when running this command. Some suggested using running sudo gem install compass (and this is how I got my first machine running Compass).
With this second machine I run sudo gem install compass and received the following error:
Building native extensions. This could take a while...
ERROR: Error installing compass:
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/ffi-1.9.14 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.14/ext/ffi_c/gem_make.out
I am not very familiar with CLI. Why am I unable to install Compass on Mac OS X Sierra 10.12?

It looks like you missing the devel headers.
I had a similar issue with another gem (ffi) and I solved it installing XCode (v. 8.0).
Once downloaded make sure to open Xcode, some components are only installed after the first time you open it. After that try again to run gem install.

I installed Homebrew as part of one solution I was trying, which installs the Xcode Command Line tools. (I had intended to use Homebrew to install Ruby and Compass in a different directory because I was initially getting permissions errors when using $ sudo gem install compass.) Once I installed Homebrew, I was able to use $ gem install compass successfully.

Related

Jekyll with Ruby 2.3 on macOS 10.13 (HighSierra)

When I run $ jekyllor $ jekyll serve it raises the following error:
-bash: /usr/local/bin/jekyll: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory
I checked /System/Library/Frameworks/Ruby.framework/Versions/ and Version 2.0 does not exist. It turns out that on the same day I updated on HighSierra, Version 2.3 was installed.
I think Jekyll still looks for Version 2.0. So how can I tell Jekyll to use Ruby 2.3?
Edit:
When I uninstall and then install jekyll, it fails:
$ gem install jekyll
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.18/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20171111-1004-fgop80.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.18 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/ffi-1.9.18/gem_make.out
Solution:
I googled can't find header files for ruby and it turned out that "Command Line Tools for Xcode" must be installed which you can download here: https://developer.apple.com/download/more/
However, I have macOS 10.13 and there is no command line tools for Xcode 8.x (which was the latest version I could install). That's why I searched for Xcode in the Mac App Store and installed Xcode 9. Once, it was installed, a window popped up that said "git requires command line tools. Do you want to install it?". I clicked install and still failed to run $gem install jekyll.
Then I tried $ brew doctor. There were some warnings which I fixed one by one and finally I'm able to run $ gem install jekyll.
I had the same issue. I just uninstalled jekyll
gem uninstall jekyll
and then installed it again.
gem install jekyll
Then it worked again.

Installing Metasploit Framework on OS X Yosemite, metasploit-framework -v '4.10.1.pre.dev' not found

I am trying to install Metasploit Framework on OS X Yosemite and whilst running bundle install the installer gets stuck on trying to install metasploit-framework -v '4.10.1.pre.dev'.
When I run gem install metasploit-framework -v '4.10.1.pre.dev' on it's own I get this error:
ERROR: Could not find a valid gem 'metasploit-framework' (= 4.10.1.pre.dev) in any repository
ERROR: Possible alternatives: test_framework, metasploit-yard, metasploit-runner, metasploit-erd,
metasploit-concern
Has anyone successfully installed msf on Yosemite that could help me out?
It seems like Gem needs more access, so if you are using RVM then Try this:
rvmsudo bundle install
Solved by going to the github page for the framework and cloning it into my /opt directory. After I just ran msfupdate everything installed as normal!

Installing Green Shoes on Mac OS X

I am trying to install "green_shoes" on a MacBook. Every time that I try to install the gem ('gem install green_shoes') I get an error:
Failed to build gem native extension
Ruby 2.0 is installed on the machine. What am I missing?

ERROR: Error installing vagrant: ERROR: Failed to build gem native extension

I'm trying to install vagrant on MacOS (Lion). But it keeps failing.
What happens...
sudo gem update --system
sudo gem install vagrant
Building native extensions. This could take a while... ERROR: Error
installing vagrant: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb mkmf.rb can't find header files for ruby at
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in
/Library/Ruby/Gems/1.8/gems/ffi-1.0.11 for inspection. Results logged
to /Library/Ruby/Gems/1.8/gems/ffi-1.0.11/ext/ffi_c/gem_make.out
I have XCode installed (installed it this morning from the AppStore).
Any ideas how I can fix this?
The problem was that XCode 4.3 doesn't in command line tools by default (not sure if this is the first version that doesn't do this). Installing them got it working.
Command Line Tools can be installed by going to Preferences > Downloads > Components.
I'm not sure why your build was failing, but starting with Vagrant 1.0 (not released yet, but RCs are out), the preferred installation method will be packages, so you can just download a pkg for Mac and install, even without XCode installed: http://downloads.vagrantup.com/

Cannot install rmagick gem in Lion: gems can't find ruby.h

I've got a clean instal of Mac OS X Lion, and I've installed the Developer Tools. I'm trying to install some ruby gems and the ones which need native extensions aren't building.
sudo gem install rmagick
For example will not build. I get back this error:
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
It looks like the ruby.h header file has moved in Lion, but I don't know how to point ruby gems to it.
I've also updated rubygems itself with
sudo gem update --system
But the issue persists. Ideas?
First, if you're still using sudo gem, you should probably switch to RVM, which manages lots of rubies and gemsets, all in your home directory so there's no permission problems, and cleanly switches between them.
RVM: http://rvm.beginrescueend.com
Second, even though you say you "installed the Developer Tools" you may not have gotten XCode and all the libraries. These days XCode for Lion is available on the Mac App Store -- for free, thankfully, though it was $4.99 for a few months, and annoyingly, the Leopard and Snow Leopard compatible versions of XCode are not on the Mac App Store.
XCode: http://itunes.apple.com/us/app/xcode/id448457090?mt=12
Third, rmagick depends on ImageMagick. The easiest way to get that these days is via HomeBrew (MacPorts had its day, but everybody's brewing now).
HomeBrew: Link
After all that, the following should work (and just now worked for me on my Lion laptop):
brew install imagemagick
gem install rmagick

Resources