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

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'

Related

Jekyll Build error

I am trying to build a jekyll site with the command jekyll build. When I run the command I get the following error:
/usr/local/share/ruby/gems/2.0/gems/bundler-1.13.1/lib/bundler/rubygems_ext.rb:45:in `full_gem_path': uninitialized constant Bundler::Plugin::API::Source (NameError)
from /usr/share/ruby/vendor_ruby/2.0/rubygems/specification.rb:1393:in `contains_requirable_file?'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:68:in `block in require'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/specification.rb:823:in `block in each'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/specification.rb:822:in `each'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/specification.rb:822:in `each'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:67:in `find'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:67:in `require'
from /usr/local/share/ruby/gems/2.0/gems/bundler-1.13.1/lib/bundler/plugin/api/source.rb:2:in `<top (required)>'
from /usr/local/share/ruby/gems/2.0/gems/bundler-1.13.1/lib/bundler/rubygems_ext.rb:45:in `full_gem_path'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/specification.rb:1393:in `contains_requirable_file?'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:68:in `block in require'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/specification.rb:823:in `block in each'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/specification.rb:822:in `each'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/specification.rb:822:in `each'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:67:in `find'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:67:in `require'
from /usr/local/share/ruby/gems/2.0/gems/bundler-1.13.1/lib/bundler.rb:11:in `<top (required)>'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:135:in `require'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from /usr/local/share/ruby/gems/2.0/gems/jekyll-3.2.1/lib/jekyll/plugin_manager.rb:34:in `require_from_bundler'
from /usr/local/share/ruby/gems/2.0/gems/jekyll-3.2.1/exe/jekyll:9:in `<top (required)>'
from /usr/local/bin/jekyll:23:in `load'
from /usr/local/bin/jekyll:23:in `<main>'
I am running Ruby version 2.2. My server is Amazon Linux AMI. Let me know if there is any other information needed to answer the question!
I ended up figuring this out. Apparently I was missing a javascript environment. Steps:
sudo rm -r Gemfile.lock
nano Gemfile. Add gem 'therubyracer'. Save and exit
bundle install
bundle exec jekyll build
This fixed the problem for me!
I ran into the same issue. This happens when you haven't initialized bundler and jekyll dependencies.
To fix this,
Go to root directory containing your jekyll files
Run jekyll new . --force. This will initialize the current folder with bundler and jekyll dependencies
Now run the server using bundler exec jekyll serve
jekyll new . --force works like git init for a new git repository. See the documentation for more information

Spree Error: --migrate=true is not a rails project

I cannot install a spree store in my application because of this error I keep getting:
spree install
Would you like to install the default gateways? (Recommended) (yes/no) [yes] y
Would you like to install the default authentication system? (yes/no) [yes] y
Would you like to run the migrations? (yes/no) [yes] y
Would you like to load the seed data? (yes/no) [yes] n
Would you like to load the sample data? (yes/no) [yes] n
gemfile spree
gemfile spree_gateway
gemfile spree_auth_devise
run bundle install from "."
--migrate=true is not a rails project.
here is my gemfile...
source 'https://rubygems.org'
gem 'rails_12factor'
gem 'paperclip'
gem 'cancan'
gem 'devise'
gem 'therubyracer'
gem 'twitter-bootswatch-rails'
gem 'twitter-bootswatch-rails-helpers'
gem 'rails', '4.1.6'
gem 'spree_cmd'
gem 'spree', '2.3.4'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-3-stable'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-3-stable'
then, when i run the other command, rails g spree:install, this is what happens:
rails g spree:install
Would you like to install the default gateways? (Recommended) (yes/no) [yes] y
Would you like to install the default authentication system? (yes/no) [yes] y
Would you like to run the migrations? (yes/no) [yes] y
Would you like to load the seed data? (yes/no) [yes] n
Would you like to load the sample data? (yes/no) [yes] n
gemfile spree
gemfile spree_gateway
gemfile spree_auth_devise
run bundle install from "."
--migrate=true is not a rails project.
/Users/claymccullough/Desktop/cybocars/config/initializers/devise.rb:132:in `block in <top (required)>': undefined method `expire_all_remember_me_on_sign_out=' for Devise:Module (NoMethodError)
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.2.4/lib/devise.rb:288:in `setup'
from /Users/claymccullough/Desktop/cybocars/config/initializers/devise.rb:3:in `<top (required)>'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `load'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `load'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/engine.rb:648:in `block in load_config_initializer'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.6/lib/active_support/notifications.rb:161:in `instrument'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/engine.rb:647:in `load_config_initializer'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/engine.rb:611:in `each'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/engine.rb:611:in `block in <class:Engine>'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/initializable.rb:30:in `run'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/claymccullough/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /Users/claymccullough/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /Users/claymccullough/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/claymccullough/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /Users/claymccullough/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/initializable.rb:44:in `each'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/claymccullough/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
from /Users/claymccullough/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /Users/claymccullough/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /Users/claymccullough/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /Users/claymccullough/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/application.rb:300:in `initialize!'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/railtie.rb:194:in `public_send'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/railtie.rb:194:in `method_missing'
from /Users/claymccullough/Desktop/cybocars/config/environment.rb:5:in `<top (required)>'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/application.rb:276:in `require_environment!'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:147:in `require_application_and_environment!'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:133:in `generate_or_destroy'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:51:in `generate'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/claymccullough/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.6/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
If anyone else who has faced this problem and solved it could help, that would be great. Thanks for your time. Also, I did not have this issue before I downloaded OS X Yosemite.
I had this problem. The way I resolved it was by following Spree's documentation instructions for installation verbatim:
gem install spree
rails _4.2.1_ new my_store
spree install my_store
Originally I was not including '__4.2.1_' in my rails new command

Capistrano - undefined method `map'

I am using capistrano through Magentify. I am using RVM as a regular user on archlinux. I have it using Ruby 2.0.0 and I ran gem install magentify in a gemset I defined for this purpose. It installed Capistrano 3.0.1 and a about 9 other gems. When I set the recipe, I tried
cap -T
and it writes
cap aborted!
undefined method `map' for :except:Symbol
/home/dirtymikeandtheboys/.rvm/gems/ruby-1.9.3-p484/gems/magentify-0.0.6/lib/nonrails.rb:24:in `block in <top (required)>'
I also tried cap deploy with the same result (not sure what I expected.) How do I get started trying to fix this?
Edit: ran --trace with command cap -T:
cap aborted!
undefined method `map' for :except:Symbol
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/task.rb:304:in `set_arg_names'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/task_manager.rb:29:in `define_task'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/task.rb:360:in `define_task'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/dsl_definition.rb:32:in `task'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/magentify-0.0.6/lib/nonrails.rb:24:in `block in <top (required)>'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/task_manager.rb:196:in `in_namespace'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/dsl_definition.rb:104:in `namespace'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/magentify-0.0.6/lib/nonrails.rb:7:in `<top (required)>'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/magentify-0.0.6/lib/mage.rb:1:in `load'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/magentify-0.0.6/lib/mage.rb:1:in `<top (required)>'
/home/dirtymike/public_html/project/Capfile:3:in `load'
/home/dirtymike/public_html/project/Capfile:3:in `<top (required)>'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/application.rb:637:in `raw_load_rakefile'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/application.rb:94:in `block in load_rakefile'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/application.rb:93:in `load_rakefile'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/capistrano-3.0.1/lib/capistrano/application.rb:22:in `load_rakefile'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/application.rb:77:in `block in run'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/capistrano-3.0.1/lib/capistrano/application.rb:12:in `run'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/gems/capistrano-3.0.1/bin/cap:3:in `<top (required)>'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/bin/cap:23:in `load'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/bin/cap:23:in `<main>'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `eval'
/home/dirtymike/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `<main>'
EDIT
This is fixed in version 0.0.7 of the Gem. I submitted a patch and it now forces to Capistrano 2.X, which is the only compatible version. The original answer was wrong, the problem was not with Rake.
Original Answer
It seems that the problem is with Rake and not with Capistrano. You may need to, either use an older version of rake (possibly 0.9.6), or update the Magentify gem to work with rake 10. Maybe you can open an issue on that repo.
EDIT
Confirmed: It works with rake 0.9.6.
You can add this Gemfile to your project:
source 'http://rubygems.org'
gem 'rake', '~> 0.9'
gem 'magentify'
and then running it like bundle exec cap -T

Unable to programmatically run a Jekyll build

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

Rake task not working with postgresql and sinatra-activerecord

I was trying to setup facebook app locally, using ruby and sinatra, in Kubuntu 12.04.
I have included following gems in my gemfile. I have postgresql installed in my system and I am able to run the postgresql command line and run basic commands as createdb, create table etc.
gem "sinatra"
gem "koala"
gem "json", "1.5.5"
gem "httparty"
gem "thin"
gem "rack", "1.3.10"
gem "pg"
gem "activerecord"
gem "sinatra-activerecord"
And in my app.rb file added these files,
require "rubygems"
require "sinatra"
require "sinatra/activerecord"
require "koala"
require "./config/environment" #database configuration
Running
rake -T
in my terminal gives me the following error.
rake aborted!
(<unknown>): found character that cannot start any token while scanning for the next token at line 2 column 1
/var/lib/gems/1.9.1/gems/sinatra-activerecord-1.2.2/lib/sinatra/activerecord.rb:39:in `database_file='
/var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1033:in `set'
/var/lib/gems/1.9.1/gems/sinatra-activerecord-1.2.2/lib/sinatra/activerecord.rb:50:in `registered'
/var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1317:in `block in register'
/var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1315:in `each'
/var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1315:in `register'
/var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1648:in `register'
/var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1688:in `register'
/var/lib/gems/1.9.1/gems/sinatra-activerecord-1.2.2/lib/sinatra/activerecord.rb:76:in `<module:Sinatra>'
/var/lib/gems/1.9.1/gems/sinatra-activerecord-1.2.2/lib/sinatra/activerecord.rb:6:in `<top (required)>'
/home/nitin/facebook_app/guarded-gorge-3234/app.rb:3:in `<top (required)>'
/home/nitin/facebook_app/guarded-gorge-3234/Rakefile:1:in `<top (required)>'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:589:in `raw_load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:89:in `block in load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:88:in `load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:72:in `block in run'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
Could any one please help. Thank you.
As #iain mentioned, this is due to a parse error in your config/database.yml file.
Check that it is valid syntax, and replace any tabs with spaces.

Resources