アプリケーションをデプロイするときにエラーが発生します:
[neon.locum.ru] executing command
*** [err :: neon.locum.ru] find: `/home/hosting_grandinvest/projects/demo/releases/20130116145843/public/images /home/hosting_grandinvest/projects/demo/releases/20130116145843/public/stylesheets /home/hosting_grandinvest/projects/demo/releases/20130116145843/public/javascripts': Нет такого файла или каталога
command finished in 91ms
triggering after callbacks for `deploy:update_code'
* 2013-01-16 16:58:45 executing `make_images_link'
* executing "ln -s /home/hosting_grandinvest/projects/demo/shared/public/images /home/hosting_grandinvest/projects/demo/releases/20130116145843/public/images"
ご覧のとおり、最初に/ public /imagesdirを見つけようとするためです。その後、そのディレクトリのシンボリックリンクを作成します。私のdeploy.rbの始まり
require 'bundler/capistrano'
after "deploy:update_code", :make_images_link
task :make_images_link, roles => :app do
images_dir = "#{shared_path}/public/images"
run "ln -s #{images_dir} #{release_path}/public/images"
end
デプロイが終了します
Gem.source_index called from /home/hosting_grandinvest/projects/demo/shared/gems/ruby/1.8/gems/rails-2.3.15/lib/rails/gem_dependency.rb:21.
master process ready
worker=0 ready
reaped #<Process::Status: pid=18656,exited(0)> worker=0
master complete
public / images dirには、css(background: url(/images/front/logo.gif) no-repeat 0 0;
)で使用されるいくつかのファイルがあり、それらは表示されません!しかし、これらのファイルに直接アクセスしようとすると()、それらhttp://hosting.net/images/front/logo.gif
を見ることができます!
このエラーを解決し、capistranoを機能させる方法に関する提案はありますか?
更新1
リポジトリにpublic/images / frontを含め、コードのデプロイ後に空のフォルダーをリンクと交換しました
after "deploy:update_code", :make_images_link
task :make_images_link, roles => :app do
images_dir = "#{shared_path}/public/images"
realease_images = "#{release_path}/public/images"
run "rm -rf #{realease_images}"
run "ln -s #{images_dir} #{realease_images}"
end
デプロイするとエラーが発生しますが、画像が表示されます!