0

Since upgrading to Yosemite I having trouble using my Ruby apps. I thought it was related to the app itself ( livereload ) but I get the same error on other web development apps. I've googled to no avail and am not proficient enough with Ruby to debug myself...

Here is the output if anyone could shed any light?

/Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:212:in `initialize': Permission denied - /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/nokogiri-1.6.1/gem_make.out (Errno::EACCES)
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:212:in `open'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:212:in `write_gem_make_out'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:132:in `build_error'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:171:in `rescue in build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:156:in `build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1436:in `block in build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/user_interaction.rb:45:in `use_ui'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1434:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/stub_specification.rb:60:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:925:in `block in find_inactive_by_path'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:924:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:924:in `find'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:924:in `find_inactive_by_path'
from /Library/Ruby/Site/2.0.0/rubygems.rb:185:in `try_activate'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb:2:in `<top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/lib/compass/sass_extensions/sprites/engines.rb:25:in `<top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/lib/compass/sass_extensions/sprites.rb:18:in `<top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/lib/compass/sass_extensions.rb:10:in `<top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/lib/compass.rb:5:in `block in <top (required)>'
from /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/lib/compass.rb:4:in `each'
from /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/lib/compass.rb:4:in `<top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/bin/compass:20:in `block in <main>'
from /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/bin/compass:8:in `fallback_load_path'
from /Applications/LiveReload.app/Contents/Resources/SASS.lrplugin/lib/compass/bin/compass:19:in `<main>'
jhodgson4
  • 1,566
  • 3
  • 20
  • 35
  • that's a permission error, which is typical of using OS X's system Ruby... use `rvm` or `rbenv` or `chruby` to install ruby instead of using the Apple one. – AlexChaffee Nov 07 '14 at 00:59

2 Answers2

0

I use ruby-install for long term ruby happiness :)

Here is what I do to setup a ruby environment in osx.

brew update
brew install ruby-install
brew install chruby
ruby-install ruby

The last line will take some time and install a fresh ruby 2.1.3 for you.

Now, Add the following to the end of ~/.bashrc or ~/.zshrc file:

source /usr/local/opt/chruby/share/chruby/chruby.sh

That's it!

This will install ruby in /Users/bibstha/.rubies/ruby-2.1.3/. Since this is your home folder, you won't have any permission issues when installing gems and they don't mess up your system.

Bibek Shrestha
  • 32,848
  • 7
  • 31
  • 34
  • Hi thanks for this, will I need to tell the system which version to use? And should I remove the old version? – jhodgson4 Nov 07 '14 at 11:04
  • `chruby` is responsible for switching different ruby versions. By default, yes your system ruby is preferred. But if you put a file `.ruby-version` inside your project with the content `2.1.3`, it will automatically switch to this version. Also executing `chruby ruby` will switch to the newly installed version. – Bibek Shrestha Nov 07 '14 at 12:15
0

Use RVM (http://rvm.io/):

curl -sSL https://get.rvm.io | bash -s stable

See also How to get Ruby / Homebrew / RVM to work on Yosemite?

Community
  • 1
  • 1
AlexChaffee
  • 8,092
  • 2
  • 49
  • 55