3
votes

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?

2
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

2 Answers

3
votes

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'
1
votes

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.