I installed compass on ubuntu 12.04 like so:
sudo gem install compass
sudo gem install sass
But after running this command:
compass version
I get this error:
/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in require': cannot load such file -- sass/script/node (LoadError)
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:inrescue in require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:144:in require'
from /usr/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in block in <top (required)>'
from /usr/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:ineach'
from /usr/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in <top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass.rb:5:in block in <top (required)>'
from /usr/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass.rb:4:ineach'
from /usr/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass.rb:4:in <top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/lib/ruby/gems/1.9.1/gems/compass-0.12.2/bin/compass:20:inblock in '
from /usr/lib/ruby/gems/1.9.1/gems/compass-0.12.2/bin/compass:8:in fallback_load_path'
from /usr/lib/ruby/gems/1.9.1/gems/compass-0.12.2/bin/compass:19:in'
from /usr/bin/compass:23:in load'
from /usr/bin/compass:23:in'
when i run this:
ruby -v
I get:
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
What need to be fixed here.
Solution:
As mentioned below:
gem uninstall compass
gem uninstall sass
gem install compass
gem uninstall sass
gem install sass
and that what fixed it for me.
Uninstall sass and reinstall it with the following:
gem uninstall sass
gem install sass
For some reason
gem install compass
brings along some bleeding edge version of sass which is pony.
This was working fine and then suddenly it wasn't. I wish i knew why. Really stuck and cannot find anything online. I'm working on an ObjectiveC project. I've tried reseting everything with:
$ sudo gem uninstall ruby
$ sudo gem uninstall cocoapods
then
$ sudo gem install ruby
$ sudo gem install cocoapods
$ sudo gem update ruby
$ sudo gem update cocoapods
then i when in my projects directory i run
$pod install
and get the following error. I get this on all projects.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require': cannot load such file -- cocoapods-core (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods.rb:8:in `<module:Pod>'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods.rb:4:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/bin/pod:23:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'
Any ideas/clues/answers would be very appreciated.
I reinstalled cocoa pods by running
$ sudo gem uninstall cocoapods-core cocoapods-downloader cocoapods
$ sudo gem install cocoapods
That resolved the issue for me
Looks like you're missing one of CocoaPod's dependencies. You should be able to install it with:
[sudo] gem install cocoapods-core
You should stop using "sudo" for tasks such as "gem install" etc. Here is a little tutorial on how to fix your ruby to ensure that you are not going to see issues with permissions for cocoapods (and other gems):
Can't get to work CocoaPods and Yosemite
I read a lot of the issues here before, unfortunately non of the described solutions worked for me. I'm on OSX and using ruby-1.9.3-p448 via rvm. Everything freshly set up.
Then I did sudo gem install compass for getting compass and sass.
No error messages.
stnwbr$ ruby -v
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.0]
stnwbr$ compass -v
Compass 0.12.2 (Alnilam)
stnwbr$ sass -v
Sass 3.2.10 (Media Mark)
but as soon as I do something like compass create or compass watch I get:
stnwbr$ compass create
LoadError on line ["51"] of /Users/stnwbr/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb: cannot load such file -- breakpoint
Run with --trace to see the full backtrace
Including --trace the result is the following:
stnwbr$ compass create --trace
LoadError on line ["51"] of /Users/stnwbr/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb: cannot load such file -- breakpoint
/Users/stnwbr/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:51:in `require'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/configuration/data.rb:161:in `require'
/Users/stnwbr/Dropbox/Projects/2013/11 OUA outdooradventures/OUA-sync/config.rb:1:in `get_binding'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:24:in `eval'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:24:in `parse_string'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:15:in `block in _parse'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in `open'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/configuration/serialization.rb:14:in `_parse'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/configuration/file_data.rb:7:in `block in new_from_file'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/configuration/inheritance.rb:204:in `with_defaults'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/configuration/file_data.rb:6:in `new_from_file'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/configuration/helpers.rb:42:in `configuration_for'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/configuration/helpers.rb:97:in `add_project_configuration'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/commands/project_base.rb:31:in `add_project_configuration'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/commands/installer_command.rb:9:in `configure!'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/commands/project_base.rb:15:in `initialize'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/commands/stamp_pattern.rb:69:in `initialize'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:42:in `new'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:42:in `perform!'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/exec/sub_command_ui.rb:15:in `run!'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/bin/compass:30:in `block in <top (required)>'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/bin/compass:44:in `call'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/bin/compass:44:in `<top (required)>'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/bin/compass:23:in `load'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/bin/compass:23:in `<main>'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `eval'
/Users/stnwbr/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `<main>'
Unfortunately that's where my understanding stops. All ideas appreciated! Thank you.
Uninstall sass and reinstall it with the following:
gem uninstall sass
gem install sass
For some reason
gem install compass
brings along some bleeding edge version of sass which is causing this error.
Then I did sudo gem install compass
NEVER
ever
use SUDO
with rvm
Follow the instructions here link
I would like to install compass through the terminal in mac. I installed sass. I now have Sass 3.3.0.alpha.175 (Bleeding Edge)
Then I tried to install compass with
sudo gem install compass
It gave me this warning
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
then stated the "1 gem installed"
When I run compass, it does not work, it gives me these lines:
/Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:110:in `gem_original_require': no such file to load -- sass/script/node (LoadError)
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:110:in `require'
from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2
from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `each'
from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass.rb:5
from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass.rb:4:in `each'
from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass.rb:4
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:20
from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:8:in `fallback_load_path'
from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:19
from /usr/bin/compass:23:in `load'
from /usr/bin/compass:23
Is there a way to fix this?
Up to now I used codekit. But I would like to take advantage of sourcemaps and I believe the terminal is the only way to do it. I tried watching sass along with source maps and the result is beautiful (in that I could use chrome as an editor). But I'd like to add compass in there as well.
Is there a way to get this working?
I am using os version 10.8.3
Compass is not compatible with sass 3.3.0 alpha (see gem doc). You should uninstall compass and sass, and the reinstall using sudo gem install compass which will install sass as well (with the right version).
EDIT:
Just tried to install compass with rvm today (26 Feb 2017) and stumbled upon another error: Error compiling Compass LoadError on line [“179”] .. data.rb: Cannot load such file. This answer worked for me.
For what it's worth, if you're using RVM, then don't use sudo. Here's how I solved this problem (and I got here using Alexandre's answer):
1) $ gem uninstall sass
(say yes to prompts alerting you about dependancies, you're about to reinstall anyway)
2) $ gem install sass -v 3.2.10
after that, compass is working great
in my solution: I have installed ruby.
brew install ruby (I know already installed with mac) then
sudo gem install compass
I'm having a problem with my compass watch command - it worked fine up until a few days ago. I have made no changes to my config files.
I reinstalled Compass, used rvm to update Ruby. I checked my custom_require.rb file but I really don't know what to look for. It seems to be trying to load the file "sass/script/node" somewhere and from http://sass-lang.com/docs/yardoc/Sass/Script/Node.html I gather the filepath - but I have nothing there.
/Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require': cannot load such file -- sass/script/node (LoadError)
from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in `<top (required)>'
from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in `block in <top (required)>'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `each'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `<top (required)>'
from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in `<top (required)>'
from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass.rb:5:in `block in <top (required)>'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass.rb:4:in `each'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass.rb:4:in `<top (required)>'
from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/bin/compass:20:in `block in <top (required)>'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/bin/compass:8:in `fallback_load_path'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/bin/compass:19:in `<top (required)>'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/bin/compass:19:in `load'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/bin/compass:19:in `<main>'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Anyone have any ideas?
Uninstall sass and reinstall it with the following:
gem uninstall sass
gem install sass
There was an issue with my installation of sass and doing this fixed the issue.
In my case, Sass version was not compatible with Compass.
FIX :
uninstall Sass AND Compass
gem uninstall compass
gem uninstall sass
install Compass who will install a compatible Sass engine automaticaly
gem install compass
This combination is finally working for me to bring Compass and SASS Sourcemaps together:
Gemfile
gem 'sass', '3.3.0.alpha.149'
gem 'compass', '0.12.2'
gem 'compass-sourcemaps', "~> 0.12.2.sourcemaps.57a186c"
Compass config.rb
sass_options = {:sourcemap => true}
This specific version works well on both:
gem 'sass', '3.3.0.alpha.149'
gem 'compass', '0.12.2'
They might not be compatible with each other that's why you're getting those errors (considering you're using a bleeding edge version).
In case you are using Ubuntu it may be a problem with apt-get and rvm colliding.
Try removing rvm with rvm implode
and then run
sudo apt-get install ruby-compass
compass watch worked for me after that.
A variation on the above answers: for me (using Bootstrap for Sass), it turned out to be
gem install bootstrap-sass
that was needed in order to fix this problem. For me, the LoadError problem with Compass started after I updated the version of Ruby I was using.
I believe this is due to versioning conflicts with sass.
https://rubygems.org/gems/compass gem is currently at v0.12.16 currently - add this to Gemfile
gem 'sass', '3.2.19'
gem 'compass', '0.12.6'
You may be required to uninstall all versions of both gems first.
I was able to fix it by doing this
gem uninstall sass
gem install sass -v 3.2.12
This is definitely due to a version dependency issue, you are better off fixing your grunt task to make it forward compatible with the newer versions of saas, compass and so on.
I had the same problem and then I realised that I had two compass versions, so by doing:
compass watch or compass compile
The compiler didn't know which compass version it should use to compile. So, what you can do is explicitly indicate the compass version to work with:
compass _1.0.3_ watch
There's another interesting thread.
The following combinations worked for me:
gem install compass --pre
gem install sass -v 3.3.3
I had to setup a gemfile with the correct versions (this error is caused by mismatched SASS and Compass versions, for me). I used thew following with bundle install to fix the problem:
source "https://rubygems.org"
gem 'bootstrap-sass', "~> 3.2.0"
gem 'sass', [ "< 3.5" , ">= 3.3.13" ]
gem 'compass', "~> 1.0.1"
gem 'compass-core', "~> 1.0.1"
gem 'compass-import-once', "~> 1.0.5"
gem 'chunky_png', "~> 1.2"
gem 'rb-fsevent', ">= 0.9.3"
gem 'rb-inotify', ">= 0.9"