开发者

Precompiling assets with Capistrano shows error on load 'deploy/assets'

I'm using rails 3.1.0 and trying to setup Capistrano to precompile assets. Capistrano v2.8.0 has "load 'deploy/assets'" in Capfile. But when I run "cap deploy" it shows the following error:

cap deploy
/usr/lib/ruby/1.8/capistrano/configuration/loading.rb:183:in `find_file_in_load_path': no such file to load -- deploy/assets (LoadError)
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:171:in `load_from_file'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from Capfile:3:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:172:in `load_from_file'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/1.8/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in `load_recipes'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in `each'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:64:in `load_recipes'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:30:in `execute!'
from /usr/lib/ruby/1.8/capistrano/cli/execute.rb:14:in `execute'
from /usr/bin/cap:4

U开发者_StackOverflowPDATE

It magically started working after I restarted my PC (Ubuntu).


Can you please demonstrate that the cap that you are using is indeed in the bundle?

Please share your Gemfile and your Capfile, chances are that "cap" isn't in the bundle, so it's loading a previous version, be sure to run with "bundle exec" (to make sure to use the correct capistrano)


As I encountered the same problem currently, I noticed that using RVM with a project specific .rvmrc was not reloaded after I switched branches with git checkout. The result was that the system wide capistrano version 2.6.0 was being used instead of the project specific capistrano version 2.9.0. This lead to the same error message 'no such file to load -- deploy/assets (LoadError)'.

A simple cd out of the project path and again into the project path solved the problem for me.


What worked for me for this issue was installing the latest version of capistrano (gem install capistrano).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜