Closed acandael closed 8 years ago
Hi Anthony,
How have you installed the gems. I've hit a problem where I get this error:
== Request: /sitemap.xml
error build/sitemap.xml
undefined method `call' for nil:NilClass
when I've installed gems using bundle install --path local_path
, but switching to system installed gems (bundle install --system
) fixes it.
Regards,
Rob.
Hi @acandael and @robwestwood –
Can you post the full stack trace, or is that the whole error?
Hi @Aupajo,
Thanks for taking a look.
Here's the output from a session first building it with gems install to vendor/bundle then installing them to system. I've snipped the output to keep it short enough not to get totally lost.
$ bundle install --path vendor/bundle
Using CFPropertyList (2.3.1)
.
.snip
.
Using padrino-support (0.12.5)
Using padrino-helpers (0.12.5)
Using rack (1.6.4)
Using rack-test (0.6.3)
Using middleman-core (3.3.12)
Using sprockets (2.12.3)
Using sprockets-helpers (1.1.0)
Using sprockets-sass (1.3.1)
Using middleman-sprockets (3.4.2)
Using uglifier (2.7.1)
Using middleman (3.3.12)
Using middleman-blog (3.5.3)
Using middleman-bootstrap-navbar (2.0.0)
Using middleman-favicon-maker (3.7)
Using middleman-google-analytics (1.1.0)
Using rack-livereload (0.3.15)
Using middleman-livereload (3.4.2)
.
.snip
.
Your bundle is complete!
It was installed into ./vendor/bundle
roberts-mbp:catalystcs robert$ rm -r build && bundle exec middleman build --verbose
== Activating: sprockets
== Reading: Local config
== Activating: automatic_image_sizes
== Activating: bh
== Activating: blog
== Activating: blog
== Activating: directory_indexes
== Activating: search_engine_sitemap
== Activating: s3_sync
== Activating: s3_redirect
== Activating: minify_css
== Activating: asset_hash
== Activating: relative_assets
== Activating: google_analytics
== Activating: favicon_maker
Loaded extensions:
== Extension: sprockets
== Extension: automatic_image_sizes
== Extension: bh
== Extension: blog
== Extension: directory_indexes
== Extension: search_engine_sitemap
== Extension: s3_sync
== Extension: s3_redirect
== Extension: minify_css
== Extension: asset_hash
== Extension: relative_assets
== Extension: google_analytics
== Extension: favicon_maker
== Extension: frontmatter
== File Change: .s3_sync
.
.snip
.
== Rebuilding resource list
== Prerendering CSS
create build/stylesheets/all-ee73118e.css
create build/stylesheets/normalize-6197e73d.css
== Checking for Compass sprites
== Building files
.
.snip
.
= Request: /sitemap.xml
error build/sitemap.xml
undefined method `call' for nil:NilClass
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/builder.rb:22:in `evaluate'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/rendering.rb:303:in `render_individual_file'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/rendering.rb:181:in `_render_with_all_renderers'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/rendering.rb:149:in `render_template'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/sitemap/resource.rb:127:in `block in render'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.11/lib/active_support/notifications.rb:161:in `instrument'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/util.rb:41:in `instrument'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/application.rb:235:in `instrument'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/sitemap/resource.rb:14:in `instrument'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/sitemap/resource.rb:100:in `render'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/request.rb:260:in `process_request'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/request.rb:210:in `block in call!'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/request.rb:209:in `catch'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/request.rb:209:in `call!'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/core_extensions/request.rb:195:in `call'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/urlmap.rb:66:in `block in call'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `each'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `call'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-more/extensions/asset_hash.rb:71:in `call'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-more/extensions/minify_css.rb:54:in `call'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/lint.rb:49:in `_call'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/lint.rb:37:in `call'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:153:in `call'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/rack-test-0.6.3/lib/rack/mock_session.rb:30:in `request'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/rack-test-0.6.3/lib/rack/test.rb:244:in `process_request'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/rack-test-0.6.3/lib/rack/test.rb:58:in `get'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:255:in `render_to_file'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:221:in `build_resource'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:213:in `each'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:213:in `execute!'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:128:in `invoke!'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/thor-0.19.1/lib/thor/actions.rb:94:in `action'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:70:in `build'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli.rb:72:in `method_missing'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:29:in `run'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:126:in `run'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/lib/middleman-core/cli.rb:20:in `start'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.12/bin/middleman:18:in `<top (required)>'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/bin/middleman:23:in `load'
/Users/robert/Documents/projects/catalyst/website/catalystcs/vendor/bundle/ruby/2.0.0/bin/middleman:23:in `<main>'
== Request: /manifest.json
== Finishing Request: manifest.json (0.0s)
create build/manifest.json
.
.snip
.
There were errors during this build
$ bundle install --system
Using CFPropertyList (2.3.1)
.
.snip
.
Using padrino-support (0.12.5)
Using padrino-helpers (0.12.5)
Using rack (1.6.4)
Using rack-test (0.6.3)
Using middleman-core (3.3.12)
Using sprockets (2.12.3)
Using sprockets-helpers (1.1.0)
Using sprockets-sass (1.3.1)
Using middleman-sprockets (3.4.2)
Using uglifier (2.7.1)
Using middleman (3.3.12)
Using middleman-blog (3.5.3)
Using middleman-bootstrap-navbar (2.0.0)
Using middleman-favicon-maker (3.7)
Using middleman-google-analytics (1.1.0)
Using rack-livereload (0.3.15)
Using middleman-livereload (3.4.2)
.
.snip
.
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
$ rm -r build && bundle exec middleman build --verbose
== Activating: sprockets
== Reading: Local config
== Activating: automatic_image_sizes
== Activating: bh
== Activating: blog
== Activating: blog
== Activating: directory_indexes
== Activating: search_engine_sitemap
== Activating: s3_sync
== Activating: s3_redirect
== Activating: minify_css
== Activating: asset_hash
== Activating: relative_assets
== Activating: google_analytics
== Activating: favicon_maker
== File Change: ../../../../../.rvm/gems/ruby-2.0.0-p195/gems/middleman-search_engine_sitemap-1.3.0/lib/middleman/search_engine_sitemap/templates/sitemap.xml.builder
Loaded extensions:
== Extension: sprockets
== Extension: automatic_image_sizes
== Extension: bh
== Extension: blog
== Extension: directory_indexes
== Extension: search_engine_sitemap
== Extension: s3_sync
== Extension: s3_redirect
== Extension: minify_css
== Extension: asset_hash
== Extension: relative_assets
== Extension: google_analytics
== Extension: favicon_maker
== Extension: frontmatter
== File Change: .s3_sync
.
.snip
.
== Rebuilding resource list
== Prerendering CSS
create build/stylesheets/all-ee73118e.css
create build/stylesheets/normalize-6197e73d.css
== Checking for Compass sprites
== Building files
.
.snip
.
== Request: /sitemap.xml
== Finishing Request: sitemap.xml (0.02s)
create build/sitemap.xml
== Request: /manifest.json
== Finishing Request: manifest.json (0.0s)
create build/manifest.json
.
.snip
.
$
Many thanks - sorry it's been a couple of days to reply, I've been away.
Regards,
Rob.
Thanks, @robwestwood. I think this is the same issue as #2.
Middleman's file watcher (a part of Middleman that tracks where each file lives), is set to ignore certain directories, such as vendor
.
This gem provides a template for the sitemap.
The problem is that if you bundle your gems into a vendor
directory, Middleman will lose awareness of the sitemap template, as it now resides inside vendor
. There's not a whole lot I can do about this (well, not without some work). There is one workaround, but it's a solution you want to be wary using.
Ultimately, I suppose, Middleman should either open the door to using templates in extensions, or I should rewrite this gem not to use templates.
Hi @Aupajo,
Many thanks for the explanation; we're happy to install the gems as system.
@acandael is this what you were seeing?
Regards,
Rob.
@robwestwood Alternatively, you can keep your bundled gems in a different path (e.g. bundle install --path gems
).
Hi @Aupajo, good idea, works a treat! Many thanks. Regards,
Rob.
As far as I can tell, this issue has now been addressed and fixed in Middleman 4.
If you're on Middleman 4, you can update your project by altering your Gemfile
as follows and then running bundle
:
gem 'middleman-search_engine_sitemap', '~> 1.4.0'
Let me know if you run into any issues with the new version!
Hmm, I'm seeing this error only on Travis, not locally. I'm still on v3 of Middleman, 1.3 of this lib.
Has anyone see that before? Pretty strange given the gem lock.
https://travis-ci.org/jc00ke/cookesauction.com/builds/150455067
Hi, I just installed middleman-search_engine_sitemap version 1.3.0 to my Middleman site, and added the lines
to the config.rb file
But when I go to http://localhost:4547/sitemap.xml, I getting the error:
not sure if I'm doing something wrong or if this is a bug. A couple of weeks ago I configered middleman-search_engine_sitemap version 1.3.0 exactly the same way for another project and everything worked fine.
greetings,
Anthony