Git Product home page Git Product logo

Comments (11)

kjvarga avatar kjvarga commented on July 17, 2024

This doesn't sound related to sitemap generator. Can you include the full trace please.

from sitemap_generator.

kjvarga avatar kjvarga commented on July 17, 2024

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.

nick-desteffen avatar nick-desteffen commented on July 17, 2024

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.

nick-desteffen avatar nick-desteffen commented on July 17, 2024

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.

nick-desteffen avatar nick-desteffen commented on July 17, 2024

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:

Good Morning <%= @appointment.patient.full_name %>!

2:

3:
We would appreciate feedback on your recent visit with <%= link_to @appointment.doctor.full_name_and_title, doctor_friendly_path_to(@appointment.doctor, true) %>.

4:
Please post a review on <%= link_to "wp.com", login_url %> to share your experience.

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.

nick-desteffen avatar nick-desteffen commented on July 17, 2024

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.

kjvarga avatar kjvarga commented on July 17, 2024

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.

nick-desteffen avatar nick-desteffen commented on July 17, 2024

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.

kjvarga avatar kjvarga commented on July 17, 2024

Looks like this should help: http://groups.google.com/group/delayed_job/browse_thread/thread/751180252d49a65a?pli=1

from sitemap_generator.

nick-desteffen avatar nick-desteffen commented on July 17, 2024

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.

reidab avatar reidab commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.