Comments (11)
This doesn't sound related to sitemap generator. Can you include the full trace please.
from sitemap_generator.
PS We are running Rails 2.3.8 with Bundler latest prereleases and don't have problems but let's see the trace
from sitemap_generator.
Well I'm not sure we have it setup correctly. We included sitemap_generator in the gemfile, and also included the tasks in our rakefile. So when I run a rake task that delivers email we get the URL error for any links in the email template. Removing the task from the rakefile alleviates this problem, however we can't use sitemap anymore.
from sitemap_generator.
Is it correct to include the rake tasks in our rakefile? The instructions don't say so for Rails 3, but the Rails 2 instructions say to include the gem it in the environment.rb and the rake tasks in the Rakefile
from sitemap_generator.
Here is the full stacktrace
undefined method `url_for' for #ActionView::Base:0x104f075a8
On line #3 of //projects/wp/app/mailer_views/appointment_reminder_mailer/review_request_email.text.html.erb
1:
2:
3:
4:
5:
(eval):16:in `doctor_for_seo_url'
app/helpers/application_helper.rb:52:in `doctor_friendly_path_to'
/app/mailer_views/appointment_reminder_mailer/review_request_email.text.html.erb:3
app/modules/appointment_reminder.rb:46:in `send_review_request_emails'
app/modules/appointment_reminder.rb:44:in `send_review_request_emails'
lib/tasks/email_tasks.rake:20
rake (0.8.7) lib/rake.rb:636:in `call'
rake (0.8.7) lib/rake.rb:636:in `execute'
rake (0.8.7) lib/rake.rb:631:in `each'
rake (0.8.7) lib/rake.rb:631:in `execute'
rake (0.8.7) lib/rake.rb:597:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
rake (0.8.7) lib/rake.rb:590:in `invoke_with_call_chain'
rake (0.8.7) lib/rake.rb:583:in `invoke'
rake (0.8.7) lib/rake.rb:2051:in `invoke_task'
rake (0.8.7) lib/rake.rb:2029:in `top_level'
rake (0.8.7) lib/rake.rb:2029:in `each'
rake (0.8.7) lib/rake.rb:2029:in `top_level'
rake (0.8.7) lib/rake.rb:2068:in `standard_exception_handling'
rake (0.8.7) lib/rake.rb:2023:in `top_level'
rake (0.8.7) lib/rake.rb:2001:in `run'
rake (0.8.7) lib/rake.rb:2068:in `standard_exception_handling'
rake (0.8.7) lib/rake.rb:1998:in `run'
rake (0.8.7) bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19
from sitemap_generator.
Removing this from our rakefile fixes the problem, but we don't have access to the generator then.
begin
require 'sitemap_generator/tasks'
rescue Exception => e
puts "Warning, couldn't load gem tasks: #{e.message}! Skipping..."
end
from sitemap_generator.
Because you are installed as a gem, in order to run the rake tasks you have to include them in your Rakefile because Rails doesn't automatically include tasks from gems.
If you install as a plugin, you don't have to include them in the Rakefile because Rails will load them automatically from the plugin.
If you're using Bundler, then there should be no reference to the sitemap_generator gem in environment.rb (because bundler should handle requiring the gems).
All you should have in your Rakefile is something like:
# Try to load gem tasks. rake gems:install fails if these gems have not yet been
# installed because the Rakefile falls over when it tries to require their tasks.
begin
require 'sitemap_generator/tasks'
rescue Exception => e
puts "Warning, couldn't load gem tasks: #{e.message}! Skipping..."
end
from sitemap_generator.
This is how we have it setup:
Gemfile:
gem "bundler", "0.9.26"
gem "rails", "2.3.5"
gem "sitemap_generator", "1.0.1"
Rakefile
begin
require 'sitemap_generator/tasks'
rescue Exception => e
puts "Warning, couldn't load gem tasks: #{e.message}! Skipping..."
end
So it must be a conflict or something....
from sitemap_generator.
Looks like this should help: http://groups.google.com/group/delayed_job/browse_thread/thread/751180252d49a65a?pli=1
from sitemap_generator.
Yeah, I tried that, from the same post too. I just tried updating Rails and Bundler to the latest and still get the same problem.
When I comment out the line:
require 'sitemap_generator'
in sitemap_generator_tasks.rake my tasks seem to work. It's gotta be some conflict with the default host options setup for ActionMailer and the default host setup for the SiteMapGenerator. When I get some time I'll fork this and see if I can get it working.
Thanks for your help.
from sitemap_generator.
This appears to be caused by the sitemap generator rake file (which loads every time rake does) requiring the sitemap_generator gem which, in turn, loads action_view. When another rake task loads the rails environment (task :foo => :environment) after action_view has already been loaded, this chaos ensues. Pull request forthcoming.
from sitemap_generator.
Related Issues (20)
- Feature Request: Remove unwanted options HOT 6
- Is it possible to override the default link options? HOT 3
- How to remove default priority, lastmod and changefreq from all urls HOT 1
- GoogleStorageAdapter - Can't create sitemap on buckets with uniform bucket-level access enabled HOT 3
- Allow disable acl for S3 bucket HOT 1
- Rails on Heroku with S3 sitemap hosting - google didn't like it HOT 2
- 【Worked】Ping failed for Bing: #<OpenURI::HTTPError: 410 Gone> HOT 4
- Is it possible to add additional metadata fields to the xml HOT 5
- Feature request : Make `default_host` optional / Allow full URL instead of path HOT 2
- Entity escaping in XML output
- google search console couldn't fetch sitemap but index is ok HOT 7
- Google search correct ping url HOT 2
- Readme install instructions fail HOT 1
- [BUG] Mobile sitemap link in Readme.md is giving 404
- TimeZone is ignored
- sitemap.xml.gz file not found on server
- Testing with frozen time does not work
- should sitemap show up automatically in google search console? HOT 2
- Should we drop default `lastmod` of `Time.now` as Google says "it needs to consistently match reality"? HOT 2
- Remove deprecated Google ping HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sitemap_generator.