Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Cache write error on Ubuntu 8.04

#16

When an user tries to install a plugin, Sashimi fails to write to cache with the following error:


Invalid cross-device link - /tmp/.plugins.7147.0 or .plugins

The problem seems to affect only Ubuntu 8.04 users.

I'm not sure if it's a Sashimi bug, because I use an ActiveSupport utility for write into the cache.

In order to isolate the problem, please check the source code and try it without Sashimi. http://github.com/jodosha/sashim...

Reported by Luca Guidi · September 30th, 2008 @ 10:08 AM

State: resolved
Milestone: 0.2.x
Assigned to: Luca Guidi Luca Guidi

Activity

  1. Luca Guidi
    Luca Guidi

    Ok, I tried with a virtualized Ubuntu 8.04.1 (Parallels Desktop), and both with ActiveSupport 2.1.0 and 2.1.1, it works for me.

    I also tried with irb to use File#atomic_write, and everything it's ok.

    September 30th, 2008 @ 10:56 AM

  2. max_dev
    max_dev

    Is because the temp directory is not on the same filesystem as the file trying to write (virtualized is on the same, I suppose):

    http://api.rubyonrails.com/class...

    I think a:

    File.atomic_write("uno.txt", "./") do |file|

    file.write("hello")
    
    

    end

    specifying a explicit different temporary directory (in the same filesystem) may solve the issue

    September 30th, 2008 @ 03:44 PM

  3. Luca Guidi
    Luca Guidi

    Theoretically, Dir#tmpdir should return the first writeable directory declared in certain env variables. If none of those directories are available it should return the current working one. http://www.ruby-doc.org/core/cla...

    I applied your fix, I don't care about the tmp dir, for me it's OK to perform all the operations inside ~/.rails/plugins.

    I build and attached the gem, please can you download, install and try if it works?

    Thank you!

    September 30th, 2008 @ 04:37 PM

  4. Luca Guidi
    Luca Guidi
    • State changed from new to resolved

    (from [8e28464043f09c42007e79edead46f3b0d5cc851]) Force File#atomic_write to use the current directory as temp path. [#16 state:resolved] http://github.com/jodosha/sashim...

    September 30th, 2008 @ 04:38 PM

  5. max_dev
    max_dev

    Deleted and installed jodosha-sashimi:

    gem install jodosha-sashimi --source=http://gems.github.com

    then:

    sashimi install git://github.com/jodosha/click-to-globalize.git

    Nothing changed in code:

      File.atomic_write(cache_file) do |file|
        file.write(plugins.to_yaml)
      end
    
    

    same error.

    September 30th, 2008 @ 07:13 PM

  6. Luca Guidi
    Luca Guidi

    You should install the attached gem with:

    
    (sudo) gem install --local sashimi-0.2.1.gem
    

    September 30th, 2008 @ 11:01 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.