Compass gem throwing error - ruby

I'm trying to get started with Compass & Sass. I've installed the compass gem with three versions of ruby (1.9.1, 1.9.2, 1.9.3) and each time I get the same error:
martin#crunchbang:~$ compass
/home/martin/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/shared_helpers.rb:22:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
from /home/martin/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler.rb:213:in `default_gemfile'
from /home/martin/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler.rb:164:in `root'
from /home/martin/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler.rb:123:in `load'
from /home/martin/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler.rb:114:in `setup'
from /home/martin/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
from /home/martin/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.1/bin/compass:25:in `<top (required)>'
from /home/martin/.rvm/gems/ruby-1.9.3-p194/bin/compass:19:in `load'
from /home/martin/.rvm/gems/ruby-1.9.3-p194/bin/compass:19:in `<main>'
from /home/martin/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /home/martin/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
How can I resolve this issue?
Any help is much appreciated.

I've found the answer here, there seems to be some sort of issue with the compass gem and the new version of bundler.
To resolve just run:
rubygems-bundler-uninstaller

Related

Ruby dependency issue on MacOSX

I'm trying to get started with the excellent deliver tool (https://github.com/KrauseFx/deliver) but I know nothing about ruby. So when I try to run deliver init and I get this message, I don't know what to do about it:
/Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2052:in `raise_if_conflicts': can't activate json-1.6.8, already activated json-1.8.1 (Gem::LoadError)
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1262:in `activate'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:96:in `block in require'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:95:in `each'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:95:in `require'
from /Users/sarbogast/.rvm/gems/ruby-2.1.0#global/gems/deliver-0.3.6/lib/deliver.rb:1:in `<top (required)>'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/sarbogast/.rvm/gems/ruby-2.1.0#global/gems/deliver-0.3.6/bin/deliver:5:in `<top (required)>'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/bin/deliver:23:in `load'
from /Users/sarbogast/.rvm/rubies/ruby-2.1.0/bin/deliver:23:in `<main>'
from /Users/sarbogast/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/sarbogast/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
What should I do? By the way I'm on MacOSX Yosemite.
If you are using bundler and you have a Gemfile you can try to run it with bundle using:
bundle exec deliver init
In that way Gemfile will pick for you the right version of the json gem.
If you aren't using bundler you should uninstall the newer version of json using:
gem uninstall json
and choosing the 1.8.1 to uninstall. Then you can try to run again deliver init
As a matter of fact, all I had to do was to install json with "sudo gem install json" and it solved my problem.

Error: ENOENT util.rb No such file or directory after upgrading to compass 1.0.1/sass 3.4.2

Here's everything the terminal spits back, with --trace-
Errno::ENOENT on line ["670"] of /Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/util.rb: No such file or directory - /Users/aristidesstaffieri/sass
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/util.rb:670:in `realpath'
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/util.rb:670:in `realpath'
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/importers/filesystem.rb:16:in `initialize'
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/engine.rb:192:in `new'
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/engine.rb:192:in `block in normalize_options'
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/engine.rb:190:in `map'
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/engine.rb:190:in `normalize_options'
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/plugin/staleness_checker.rb:52:in `initialize'
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/plugin/compiler.rb:203:in `new'
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/plugin/compiler.rb:203:in `update_stylesheets'
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.2/lib/sass/plugin/compiler.rb:294:in `watch'
/Library/Ruby/Gems/2.0.0/gems/compass-1.0.1/lib/compass/sass_compiler.rb:46:in `watch!'
/Library/Ruby/Gems/2.0.0/gems/compass-1.0.1/lib/compass/commands/watch_project.rb:41:in `perform'
/Library/Ruby/Gems/2.0.0/gems/compass-1.0.1/lib/compass/commands/base.rb:18:in `execute'
/Library/Ruby/Gems/2.0.0/gems/compass-1.0.1/lib/compass/commands/project_base.rb:19:in `execute'
/Library/Ruby/Gems/2.0.0/gems/compass-1.0.1/lib/compass/exec/sub_command_ui.rb:43:in `perform!'
/Library/Ruby/Gems/2.0.0/gems/compass-1.0.1/lib/compass/exec/sub_command_ui.rb:15:in `run!'
/Library/Ruby/Gems/2.0.0/gems/compass-1.0.1/bin/compass:30:in `block in <top (required)>'
/Library/Ruby/Gems/2.0.0/gems/compass-1.0.1/bin/compass:44:in `call'
/Library/Ruby/Gems/2.0.0/gems/compass-1.0.1/bin/compass:44:in `<top (required)>'
/usr/bin/compass:23:in `load'
/usr/bin/compass:23:in `<main>'
This only started happening after I updated, and all of my gems are updated. I've tried uninstalling and re-installing compass/sass. Any suggestions?
I believe that the problem you were having is the new update of the gem. With this modification you get back to the previous version.
I modified Gemfile. I added this line gem 'compass','0.12.6'
This is my first lines at Gemfile
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', '~> 3.2.15'
group :assets do
gem 'sass-rails'
gem 'compass-rails'
gem 'compass','0.12.6'
gem "twitter-bootstrap-rails"
gem 'uglifier'
end
I think this is what you wanted, but if not, let me know as many times as you need.
The latest version of Sass (3.4.3) as of September 4th seems to fix this issue (confirmed with Ruby 2.0.0 and Compass 1.0.1).
You could try running gem update sass and see if it solves your problem.

nanoc installation setup in Linux

I'm a newbie to Ruby. Trying to setup nanoc in my machine. I'm running Ubuntu 14.04.
After the nanoc installation, when I type
$nanoc --version
I get the following errors:
/home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler/shared_helpers.rb:24:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:248:in `default_gemfile'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:192:in `root'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:99:in `bundle_path'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:400:in `configure_gem_home_and_path'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:90:in `configure'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:151:in `definition'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:116:in `setup'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
from /home/ananth/.rvm/gems/ruby-head/gems/nanoc-3.7.0/bin/nanoc:7:in `<top (required)>'
from /home/ananth/.rvm/gems/ruby-head/bin/nanoc:23:in `load'
from /home/ananth/.rvm/gems/ruby-head/bin/nanoc:23:in `<main>'
from /home/ananth/.rvm/gems/ruby-head/bin/ruby_executable_hooks:15:in `eval'
from /home/ananth/.rvm/gems/ruby-head/bin/ruby_executable_hooks:15:in `<main>'
Am I missing something from my rvm? Anything to do with $PATH, .bashrc or .bash_profile?
Thanks for the help in advance!
This is a bug in 3.7.0 that will be fixed in 3.7.1.
3.7.0 unintentionally requires a Gemfile to be present when Bundler is installed.
To avoid this bug, either temporarily switch back to 3.6.11, or use a Gemfile (I recommend the latter).

Trouble running compass on OSX - LoadError on line ["51"]

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

uninitialized constant Rake::DSL in Ruby Gem

I have been working on updating my gem (whm_xml at https://github.com/ivanoats/whm_xml_api_ruby ) to make it work with ruby 1.9.2, latest rubygems, latest bundler, latest rdoc, latest rake. It works fine in 1.8.7 but has the "uninitialized constant Rake::DSL" error only in 1.9.2 . I thought that rake 0.9.2 fixed that but maybe not? I have read a lot on StackOverflow but am still stuck. Any ideas on where to look?
ivan:~/Development/ruby/whm_xml_api_ruby [git:master+] → bundle exec rake -T
(in /Users/ivan/Development/ruby/whm_xml_api_ruby)
rake aborted!
uninitialized constant Rake::DSL
/Users/ivan/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
/Users/ivan/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in `<class:TaskLib>'
/Users/ivan/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in `<module:Rake>'
/Users/ivan/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in `<top (required)>'
/Users/ivan/.rvm/gems/ruby-1.9.2-p180/gems/rdoc-3.6.1/lib/rdoc/task.rb:37:in `require'
/Users/ivan/.rvm/gems/ruby-1.9.2-p180/gems/rdoc-3.6.1/lib/rdoc/task.rb:37:in `<top (required)>'
/Users/ivan/Development/ruby/whm_xml_api_ruby/Rakefile:3:in `require'
/Users/ivan/Development/ruby/whm_xml_api_ruby/Rakefile:3:in `<top (required)>'
/Users/ivan/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2373:in `load'
/Users/ivan/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/Users/ivan/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/Users/ivan/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/Users/ivan/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/Users/ivan/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:1991:in `run'
/Users/ivan/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/ivan/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `load'
/Users/ivan/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `<main>'
This SO Question might help you out. The suggestion there is to add require 'rake/dsl_definition' above require 'rake' in your Rakefile.
I think this is something that happened with the rake 0.9.0 release. Try putting this in your Gemfile: gem 'rake', '0.8.7'
Update
You could try adding
include Rake::DSL if defined?(Rake::DSL)
to your app; it worked for my Rails app at one point.
I fooled around with the include Rake::DSL, etc and just got other errors.
adding
gem 'rake', '0.8.7'
to the Gemfile seems to work for me
I had the same problem with 0.9.1, installed the 0.9.2 and it worked but the db:migrate command sent a message WARNING: Global access to Rake DSL methods is deprecated. Please....
it got solved adding to the rake file
module ::yourappname
class Application
include Rake::DSL
end
end
and
require 'rake/dsl_definition'
before the .. LoadTask entry

Resources