Unable to programmatically run a Jekyll build - ruby

I'm trying to run a Jekyll build programatically, but I'm having issues in that the build crashes when trying to load some gems used by the Jekyll site's plugins.
My code looks like this (line breaks added for readability):
%x(cd #{#config['input_directory']} &&
bundle install &&
bundle exec jekyll build --config #{File.join(#config['input_directory'], "_config.yml")} --source #{#config['input_directory']} --destination #{#config['output_directory']} --trace)
When this runs, I get a stack trace that looks like this:
/_plugins/jekyll_lunr_js_search.rb:80:in `require': cannot load such file -- nokogiri (LoadError)
from /_plugins/jekyll_lunr_js_search.rb:80:in `<top (required)>'
from /ruby-1.9.3-p448/gems/jekyll-1.3.0/lib/jekyll/site.rb:77:in `require'
from /ruby-1.9.3-p448/gems/jekyll-1.3.0/lib/jekyll/site.rb:77:in `block (2 levels) in setup'
from /ruby-1.9.3-p448/gems/jekyll-1.3.0/lib/jekyll/site.rb:76:in `each'
from /ruby-1.9.3-p448/gems/jekyll-1.3.0/lib/jekyll/site.rb:76:in `block in setup'
from /ruby-1.9.3-p448/gems/jekyll-1.3.0/lib/jekyll/site.rb:75:in `each'
from /ruby-1.9.3-p448/gems/jekyll-1.3.0/lib/jekyll/site.rb:75:in `setup'
from /ruby-1.9.3-p448/gems/jekyll-1.3.0/lib/jekyll/site.rb:29:in `initialize'
from /ruby-1.9.3-p448/gems/jekyll-1.3.0/lib/jekyll/commands/build.rb:5:in `new'
from /ruby-1.9.3-p448/gems/jekyll-1.3.0/lib/jekyll/commands/build.rb:5:in `process'
from /ruby-1.9.3-p448/gems/jekyll-1.3.0/bin/jekyll:77:in `block (2 levels) in <top (required)>'
from /ruby-1.9.3-p448/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
from /ruby-1.9.3-p448/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
from /ruby-1.9.3-p448/gems/commander-4.1.5/lib/commander/command.rb:155:in `run'
from /ruby-1.9.3-p448/gems/commander-4.1.5/lib/commander/runner.rb:402:in `run_active_command'
from /ruby-1.9.3-p448/gems/commander-4.1.5/lib/commander/runner.rb:78:in `run!'
from /ruby-1.9.3-p448/gems/commander-4.1.5/lib/commander/delegates.rb:11:in `run!'
from /ruby-1.9.3-p448/gems/commander-4.1.5/lib/commander/import.rb:10:in `block in <top (required)>'
The Gemfile of the input_directory looks like this, so I'm not sure why it's not able to load nokogiri.
source 'https://rubygems.org'
gem 'directory_watcher', '= 1.4.1' # http://stackoverflow.com/questions/15591000/jekylls-auto-doesnt-work
gem 'kramdown'
gem 'nokogiri'
gem 'yui-compressor'
gem "jekyll"
group :development do
gem 'capistrano'
gem 'rvm-capistrano'
end
Any pointers here are welcome. I get the feeling there are better ways of doing this Jekyll build programmatically too, this just seemed to be simplest to me.

Run bundle exec jekyll to ensure that it sets up the gem path correctly for Jekyll. If you're calling the program from an app that uses Bundler itself, you may need to also wrap the execution in a call to Bundler.with_clean_env.
The complete command should look like this:
Bundler.with_clean_env do
%x(cd #{#config['input_directory']} &&
bundle install &&
bundle exec jekyll build --config #{File.join(#config['input_directory'], "_config.yml")} --source #{#config['input_directory']} --destination #{#config['output_directory']} --trace)
end

Related

Creating local gem for Jekyll and keep getting "don't have jekyll-custom-plugin or one of its dependencies installed" as jekyll unable to find it

I creating new and custom gem called as "jekyll-custom-plugin" for my Jekyll and gem this is successfully build.
robbi#pc MINGW64 /d/Workplace/ruby/jekyll-custom-plugin(master)
$ gem build jekyll-custom-plugin.gemspec
Successfully built RubyGem
Name: jekyll-custom-plugin
Version: 1.0.3
File: jekyll-custom-plugin-1.0.3.gem
I open and modified my gemfile plugin with file path and file version as needed
group :jekyll_plugins do
# put here other jekyll plugins..
gem 'jekyll-custom-plugin', '1.0.3', :path => 'd:/Workplace/ruby/jekyll-custom-plugin'
end
and my jekyll _config.yml call the plugin as usual
plugins:
- jekyll-custom-plugin
but when I try to build up the website (bundle update, bundle install and bundle exec jekylly serve), i keep getting
robbi#pc MINGW64 /d/NOPE/robbinespu.gitlab.io (master)
$ bundle exec jekyll serve
Configuration file: D:/NOPE/robbinespu.gitlab.io/_config.yml
Theme Config file: C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/octoflavor-ee4be458ed67/_config.yml
Dependency Error: Yikes! It looks like you don't have jekyll-custom-plugin or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. If you've run Jekyll with `bundle exec`, ensure that you have included the jekyll-custom-plugin gem in your Gemfile as well. The full error message from Ruby is: 'cannot load such file -- jekyll-custom-plugin' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
------------------------------------------------
Jekyll 4.0.0 Please append `--trace` to the `serve` command
for any additional information or backtrace.
------------------------------------------------
This is weid because, I already install and it show up here
robbi#pc MINGW64 /d/NOPE/robbinespu.gitlab.io (master)
$ bundle install | grep custom
Using jekyll-custom-plugin 1.0.3 from source at `d:/Workplace/ruby/jekyll-custom-plugin`
robbi#pc MINGW64 /d/NOPE/robbinespu.gitlab.io (master)
$ bundle info jekyll-custom-plugin
* jekyll-custom-plugin (1.0.3)
Summary: A Jekyll plugin to provide XXX.
Homepage: https://github.com/robbinespu/XXX
Path: d:/Workplace/ruby/jekyll-custom-plugin
even bundle said it already installed and match the version
robbi#pc MINGW64 /d/NOPE/robbinespu.gitlab.io (master)
$ bundle list | custom
* jekyll-custom-plugin (1.0.3)
here the --trace log
$ bundle exec jekyll s --trace
Configuration file: D:/NOPE/robbinespu.gitlab.io/_config.yml
Theme Config file: C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/octoflavor-ee4be458ed67/_config.yml
Dependency Error: Yikes! It looks like you don't have jekyll-custom-plugin or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. If you've run Jekyll with `bundle exec`, ensure that you have included the jekyll-custom-plugin gem in your Gemfile as well. The full error message from Ruby is: 'cannot load such file -- jekyll-custom-plugin' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:73:in `rescue in block in require_with_graceful_fail': jekyll-custom-plugin (Jekyll::Errors::MissingDependencyException)
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:58:in `block in require_with_graceful_fail'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:57:in `each'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:57:in `require_with_graceful_fail'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/plugin_manager.rb:30:in `require_gems'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/plugin_manager.rb:22:in `conscientious_require'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/site.rb:125:in `setup'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/site.rb:35:in `initialize'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/commands/build.rb:30:in `new'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/commands/build.rb:30:in `process'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/command.rb:91:in `each'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/exe/jekyll:15:in `<top (required)>'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bin/jekyll:23:in `load'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bin/jekyll:23:in `<main>'
C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:60:in `require': cannot load such file -- jekyll-custom-plugin (LoadError)
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:60:in `block in require_with_graceful_fail'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:57:in `each'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/external.rb:57:in `require_with_graceful_fail'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/plugin_manager.rb:30:in `require_gems'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/plugin_manager.rb:22:in `conscientious_require'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/site.rb:125:in `setup'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/site.rb:35:in `initialize'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/commands/build.rb:30:in `new'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/commands/build.rb:30:in `process'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/command.rb:91:in `each'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bundler/gems/jekyll-2bc1e04620ce/exe/jekyll:15:in `<top (required)>'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bin/jekyll:23:in `load'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/bin/jekyll:23:in `<main>'
The exception message does not give the (root cause) reason for failure.
Add --trace as suggested, examine the file that is raising the error and see how the error that is being raised is constructed. This could follow a pattern like:
begin
# ...
rescue LoadError => e
raise "Generic error message not including anything from 'e.'"
end
... in which case change to:
begin
# ...
rescue LoadError => e
raise "Error message: #{e.class}: #{e}"
end
... and you'll have the root cause displayed.
If you are less fortunate, you'll see:
if $SOME_GLOBAL_FLAG
raise "Generic error message"
end
In this case the flag is set elsewhere in a rescue block for LoadError. You'll need to hunt that rescue down and print the error from there.
In either case I personally would report the omission of the root cause exception to the library that utilizes either pattern as a bug.

Why doesn't ruby find the 'dimensions' gem?

I am using Jekyll for quite a while now to generate my blog (source). Today, without having changed anything in the generation process, I got
[...]
jekyll build --config _config_prod.yml
Configuration file: _config_prod.yml
/home/moose/GitHub/MartinThoma.github.io/_plugins/caption_tag.rb:23:in `require': cannot load such file -- dimensions (LoadError)
from /home/moose/GitHub/MartinThoma.github.io/_plugins/caption_tag.rb:23:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:74:in `require'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:74:in `block (2 levels) in require_plugin_files'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:73:in `each'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:73:in `block in require_plugin_files'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:72:in `each'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:72:in `require_plugin_files'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:18:in `conscientious_require'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:79:in `setup'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:41:in `initialize'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:29:in `new'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:29:in `process'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `call'
from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `block in execute'
from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `each'
from /usr/lib/ruby/vendor_ruby/mercenary/command.rb:220:in `execute'
from /usr/lib/ruby/vendor_ruby/mercenary/program.rb:42:in `go'
from /usr/lib/ruby/vendor_ruby/mercenary.rb:19:in `program'
from /var/lib/gems/2.1.0/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
from /usr/local/bin/jekyll:23:in `load'
from /usr/local/bin/jekyll:23:in `<main>'
Makefile:35: recipe for target 'deploy' failed
make: *** [deploy] Error 1
I am not a Ruby developer, but I guess the problem is require 'dimensions'? However, when I execute this line in irb it only shows => true.
What is the problem and how can I fix it?
Diagnostic information
$ jekyll --version
jekyll 2.5.3
$ head -1 `which irb`
#!/usr/bin/ruby2.1
$ head -1 `which jekyll`
#!/usr/bin/ruby2.1
Executing RUBY_VERSION in irb gives => "2.1.5".
The problem was fixed by adding gem 'dimensions' to the file Gemfile. It now looks like this:
source "https://rubygems.org"
# see https://github.com/paulrobertlloyd/paulrobertlloyd.com/blob/master/Gemfile
# Guard (automates development tasks)
# Jekyll (generates static files)
gem 'jekyll'
group :jekyll_plugins do
gem 'jekyll-paginate'
gem 'dimensions'
gem 'rmagick'
end
# Rake (manages build tasks)
gem 'rake'

How to resolve ruby gem conflict involving rake on mac?

I am attempting to run rake under Mac OSX and I am getting the below error.
$ rake --trace
rake aborted!
Gem::ConflictError: Unable to activate releasy-0.2.2, because rake-10.3.2 conflicts with rake (~> 0.9.2.2)
/Library/Ruby/Site/2.0.0/rubygems/specification.rb:2112:in `raise_if_conflicts'
/Library/Ruby/Site/2.0.0/rubygems/specification.rb:1280:in `activate'
/Library/Ruby/Site/2.0.0/rubygems.rb:198:in `rescue in try_activate'
/Library/Ruby/Site/2.0.0/rubygems.rb:195:in `try_activate'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:39:in `require'
/Users/Development/RUBY/rakefile:5:in `<top (required)>'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:687:in `raw_load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:94:in `block in load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:93:in `load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:77:in `block in run'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'
gem list --local displays
rake (10.3.2, 0.9.6, 0.9.2.2)
How would I resolve a conflict between the rake gem I installed and the rake gem that is deployed with OSX? Should I just delete the newest update or is there a way to specify in my rake file to use the newest version and ignore the conflict?
If you are trying to run rake from within a project that uses a Gemfile, try this:
bundle exec rake --trace
This will load up the version of rake required for the project, instead of one that could possibly conflict (like your OSX default /usr/bin/rake binary).
If the bundle command isn't found, do this:
gem install bundler
Also, if this is a recent Rails app, you can also use the provided binstubs instead like this:
bin/rake --trace
If none of this works, try using RVM, Chruby, or RBEnv to manage your Ruby environments separately from the operating-system provided Ruby.

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.

jekyll serve --watch command raising an error outside of vagrant

Attempting to build a site with Jekyll using the jekyll-assets gem, I noticed that my changes were not being auto regenerated despite using the --watch flag on my jekyll serve command. Was a big headache having to stop the server every time I wanted to see changes in the browser so I tried to troubleshoot the problem and after a while learned that auto regeneration will not occur with the jekyll serve --watch command in Vagrant, which I'm using.
To avoid this headache I attempted to install necessary dependencies outside of Vagrant and jekyll serve --watch but am getting the following:
Configuration file: /Users/jamestargett/Code/jekyll_fingers/_config.yml
/Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- jekyll-assets (LoadError)
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/jamestargett/Code/jekyll_fingers/_plugins/ext.rb:1:in `<top (required)>'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:77:in `block (2 levels) in setup'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:76:in `each'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:76:in `block in setup'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:75:in `each'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:75:in `setup'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/site.rb:29:in `initialize'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/commands/build.rb:5:in `new'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/lib/jekyll/commands/build.rb:5:in `process'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/jekyll-1.4.2/bin/jekyll:97:in `block (2 levels) in <top (required)>'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:155:in `run'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/runner.rb:402:in `run_active_command'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/runner.rb:66:in `run!'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/delegates.rb:7:in `run!'
from /Users/jamestargett/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/import.rb:10:in `block in <top (required)>'
I've tried googling the problem but am pretty new to web development and a little lost.
I've also faced this problem. Looks like its a bug in the newest Jekyll 1.4.2 build. A fix can be uninstalling Jekyll 1.4.2 and installing a stable release, in my knowledge which is 1.2.1
Uninstall Jekyll and reinstall Jekyll 1.2.1 by following these commands
~ $ gem uninstall jekyll
~ $ gem install jekyll --version(="1.2.1")
Running gem install jekyll -v 1.2.1 would also work

Resources