3

I try to deploy my rails 3.1 application with capistrano but it fails with following output:

rake aborted!

File name too long - /srv/good2go.ch/cookbook/releases/20110727063856/tmp/cache/assets/sprockets%2Fsrv%2Fgood2go.ch%2Fcookbook%2Fshared%2Fbundle%2Fruby%2F1.9.1%2Fgems%2Faloha_rails-0.1.4%2Flib%2Fassets%2Fjavascripts%2Faloha%2Fplugins%2Fcom.gentics.aloha.plugins.HighlightEditables%2Fcss%2FHighlightEditables.css%3Asource20110727-2736-dx9guk.lock

Tasks: TOP => assets:precompile

It's this task who fails: RAILS_ENV=production rake assets:precompile

Anyone an idea what it could be?

raskhadafi
  • 1,323
  • 2
  • 14
  • 18
  • I'm having the same issue. It's because Sprockets is trying to compile your Javascript, or in this case the "aloha_rails" gem, into a single file and using the entire path to the script as the file name. Your OS doesn't support a file name that long. Don't have a solution yet. – Andrew France Jul 27 '11 at 14:59

2 Answers2

3

The problem is that sprockets uses a somewhat quoted URL identifier to the gem. This can get very long.

This issue has been reported to the sprockets issue tracker at github and has been fixed by using a hexdigest instead of the full URL in this commit.

As of today, there has been no new (beta) release containing the fix. But you may use the sprocket version by pointing to github in your Gemfile:

gem 'sprockets', :git => 'https://github.com/sstephenson/sprockets.git'
Simon Hürlimann
  • 3,931
  • 3
  • 18
  • 23
  • Thus to keep you informed: Current sprockets gem on github do work. No extra Gemfile magic needed anymore:-) Drop gem version dependency in Gemfile, run _bundle_ – Simon Hürlimann Nov 01 '11 at 00:56
1

I have the same issue when sprockets try to compile jquery from jquery-rails.

As a temporary solution, I copied and pasted the jquery files from jquery-rails into vendor of my application.

  • The deployment was successful but the aloha editor doesn't work as expected. On the first view some JS file are missing. Thanks anyway! – raskhadafi Jul 29 '11 at 07:21
  • 1
    Should not be needed. While this is a possible workaround for a second, this should be fixed properly: Drop gem version dependency in Gemfile, run _bundle_ – Simon Hürlimann Nov 01 '11 at 00:58