Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7521717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:18:32+00:00 2026-05-30T02:18:32+00:00

I am using Ruby on Rails 3.1.0 and DelayedJob. As many people on the

  • 0

I am using Ruby on Rails 3.1.0 and DelayedJob. As many people on the web I get the “Job failed to load: uninitialized constant Syck::Syck” error, but I think I discovered at least what generates the error (in my case). I have an ActiveModel like the following:

class Contact
  include ActiveModel::Conversion
  include ActiveModel::Validations
  include ActiveModel::Dirty
  extend  ActiveModel::Naming
  extend  ActiveModel::Translation

  attr_accessor :full_name, :email, :subject, :message

  def initialize(attributes = {})
    attributes.keys.each do |attr|
      instance_variable_set "@" + attr.to_s, attributes[attr.to_sym]
    end
  end

  validates_presence_of :full_name, :email, :subject, :message    

  def persist
    @persisted = true
  end

  def persisted?
    false
  end
end

The related controller action is:

def contact
  @contact = Contact.new(params[:contact])

  if @contact.valid?
    ::Contact::Mailer.delay.contact(@contact)

    respond_to do |format|
      format.html { redirect_to root_path }
    end
  else
    respond_to do |format|
      format.html { render :action => :contact }
    end
  end
end

I noted that my problem with the “famous”\”infamous” Job failed to load: uninitialized constant Syck::Syck happens only if I run the @contact.valid?. If I re-implement the above controller action like this:

def contact
  @contact = Contact.new(params[:contact])

  ::Contact::Mailer.delay.contact(@contact)

  respond_to do |format|
    format.html { redirect_to root_path }
  end
end

all work as expected: I don’t get the error and the e-mail is successfully sent. In few words, when I run @contact.valid? inside the controller action (I can run that also without using the if ... else statement) it generates the Job failed to load error. I really do not understand this strange behavior related to the DelayedJob gem and the valid? method.

Why it happens? How can I solve the problem?


More info at DelayedJob: “Job failed to load: uninitialized constant Syck::Syck”


UPDATES

If I debug the @contact.errors in both cases using or not using the @contact.valid? method…

… when I use the @contact.valid? method (DelayedJob does not work) I get

#<ActiveModel::Errors:0x00000101759408 @base=#<Contact:0x000001017597f0 @full_name="Sample name", @email="foo@bar.com", @subject="Sample subject", @message="Sample message content.", @validation_context=nil, @errors=#<ActiveModel::Errors:0x00000101759408 ...>>, @messages={}>

… when I do not use the @contact.valid? method (DelayedJob works) I get

#<ActiveModel::Errors:0x00000101759408 @base=#<Contact:0x000001017597f0 @full_name="Sample name", @email="foo@bar.com", @subject="Sample subject", @message="Sample message content.", @errors=#<ActiveModel::Errors:0x00000101759408 ...>>, @messages={}>

Note that in the second case the @validation_context=nil is not present and that in both cases there is a “nested” <ActiveModel::Errors:0x0000010175940 ...> statement. Is that a bug?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:18:34+00:00Added an answer on May 30, 2026 at 2:18 am

    I found a solution that works for me. You can redefine the ‘Object#to_yaml_properties’ method within your Contact class to only include the properties you need. And thus exclude the ‘errors’ variable.

    def to_yaml_properties
      ['@full_name', '@email', '@subject', '@message']
    end
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build a free web application using ruby/rails It should be
using Ruby on Rails 2.3.2, since I already created Scaffold for Story, so instead
I'm using Ruby on Rails to make an application where businesses can create accounts
I am using Ruby on Rails and I need to store a search result
I'm using ruby on rails 2.3.2 and also using the acts_as_taggable_on puglin. That generated
I'm using Ruby on Rails 2.3.5 and Ruby 1.9 and implmeneted Authlogic as my
I am using Ruby on Rails with Cucumber and Capybara. How would I go
I am using Ruby on Rails 3.2.2, cucumber-rails-1.3.0, rspec-rails-2.8.1, capybara-1.1.2 and factory_girl-2.6.3. I have
I am using Ruby on Rails 3.2.2 and Cucumber with the cucumber-rails gem. I
I am using Ruby on Rails 3.2.2, cucumber-rails-1.3.0, rspec-rails-2.8.1 and capybara-1.1.2 with the Selenium

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.