2016-04-22 51 views
0

我將我的rails項目部署到AWS。我有以下我Gemfile資產未找到欄4 + Capistrano 3 + Puma

group :development do 
    gem 'capistrano' 
    gem 'capistrano3-puma' 
    gem 'capistrano-rails', '~> 1.1' 
    gem 'capistrano-bundler', require: false 
    gem 'capistrano-rvm' 
end 

在我production.rb

config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? 
    config.assets.compile = true 
    config.assets.digest = true 

然而,當我加載在Web瀏覽器我,我application-xxxxxx.cssapplication-xxxxxx.js404 not found錯誤控制檯中看到我的應用程序。另外,當我進入服務器並在public/assets /文件夾中查找文件時,application-xxxxxx.js出現在那裏。

任何人都可以幫助我嗎?

+0

任何日誌?請 –

+0

,我可以看到的唯一記錄是 ' 404未找到 <體BGCOLOR = 「白色」>

404未找到


的nginx/1.4.6(Ubuntu的)
'for application-xxxxxxx.css –

+0

您是否運行過bundle exec rake資源:precompile ??部署後 –

回答

2

問題不在於資產編譯和部署。我不得不在nginx配置文件/etc/nginx/sites-enabled/default中將路徑從root /home/deploy/portal/public;更改爲/home/deploy/portal/current/public;