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 6872601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:57:00+00:00 2026-05-27T03:57:00+00:00

I been working on porting my application on Rails 3.0.7 ,ever since I started

  • 0

I been working on porting my application on “Rails 3.0.7” ,ever since I started to employ caching for my application either (file cache,memcache or any other) . I always happen to get the above error “can’t dump File” .

I Google a bit and found that it has something to do with Marshal dump as ruby interpreter does allow Marshal dump of object that have Procs or lambdas in them so I looked upon my code but I could not find any Proc and lambda in my whole applications

Now to discover the problem I drill down the ActiveRecord 3.0.7 code and here are few interesting finding that I came up with

1 . “includes” in Rails 3 + internally call the define name scope OK this I give the answer that there is Proc and Lambada associated with the object so the error but this doesn’t explain why the same code work sometime and report with errors(above errors) other times I mean If the error is for the Marshalling and object that hold a Proc or a Lambada then code should definitely not work and should always report errors no matter how many times the same code is ran but that not the case over here the code return errors sometimes and work well other times

Code

Rails.cache.fetch(“accessible_websites_1”)
{ Website.includes(:account) }

2 . If the “.includes” in Rails 3.0 + has problem then what up with other ‘include’ syntax does it too report error (above error)
so I ran the code with older syntax of include

Here is it

Rails.cache.fetch(“accessible_websites_1”)
{ Website.all(:include =>
:account) }

well surprisingly it ran but it never preloaded the account related for all the website ( which is where weird) but at least It never gave and error
so did a forensic on Active Record 3.0 + once again to discover how the older version of include(Rails 2.3 +) work surprise to know that the older version of include syntax internally call the .includes method of ActiveRecord 3.0 +

whoo How is that possible
two different syntax both call the same internal method one report with error sometimes ( not every time but preload the associated object) and other does not report with error but neither preload the associated object as said earlier.

OK , Hearing all this if anyone can help me out then I would be utmost grateful

By the way

Here what I’m trying to achieve

Rails.cache.fetch(“accessible_websites_1”)
{ Website.includes(:account) }

the equivalent code of above in Rails 2.3.5 and Rails 3 + (but does not preload the associated account object of all websites)
i.e

Rails.cache.fetch(“accessible_websites_1”)
{ Website.find(:all,:include =>
:account) }

Work perfectly fine without any issue

I using

Ruby = “ruby 1.8.7 (2010-01-10
patchlevel 249) [i486-linux]” Rails
= ” Rails 3.0.7″

The same Problem even persisted on Rails 3.1.0

am I missing something

I can also provide the model structure if required

  • 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-27T03:57:01+00:00Added an answer on May 27, 2026 at 3:57 am

    The problem is that

    Website.includes(:account)
    

    does not load the data, it just provides you with a proxy object that will load the objects on demand when you do something like calling #each or #to_s, if you force the fetching by adding a #to_aat the end it should work, e.g. try

    Marshal.dump(Website.includes(:account))
    Marshal.dump(Website.includes(:account).to_a)
    

    #all(x=>y) does not do the same thing as #x(y), that is why you can do X.includes.joins.where but not X.all.where.

    Not sure where the reference to a File comes from though.

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

Sidebar

Related Questions

I've been working on a project of porting an old solaris CL program to
I been working on parsing out bookmarks from an export file generated by google
I am working on porting a VB6 application to C# (Winforms 3.5) and while
I've been working on porting a C# implementation of a LLRBT to F# and
The project that I've been working on involves porting some old code. Right now
I have finished developing the core of a web application I have been working
I'm porting an app i've been working on from Linux to Mac and i'm
So, I've been working on an application for a client that communicates with wireless
Hi i've been working on a task of porting some code from some old
We are currently working on porting an old VB6 application to WPF. The plan,

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.