2016-02-29 31 views
1

我有一個在谷歌App Engine上運行的工作欄應用程序。谷歌應用程序引擎與Rails,靜態資產不工作

什麼都沒有我的靜態文件,js/css正在工作。

控制檯顯示錯誤:

Failed to load resource: the server responded with a status of 404 (OK) 

https://automata-tech.appspot.com/assets/application-20dae9833e60c26566d09f41137460a88163a1fc6a579d0e5db204f6e3a6bc37.css 

我預編譯我的資產:

RAILS_ENV=production 

我試圖在我的app.yaml各種目錄添加處理程序:

runtime: ruby 
vm: true 
entrypoint: bundle exec unicorn -p 8080 -E production config.ru 

resources: 
    cpu: .5 
    memory_gb: 1.3 
    disk_size_gb: 10 

automatic_scaling: 
    min_num_instances: 1 
    max_num_instances: 1 
    cool_down_period_sec: 60 
    cpu_utilization: 
    target_utilization: 0.8 

handlers: 
- url: /assets 
static_dir: /public/assets 

我已經嘗試過各種static_dir,但得到:

Error: Not Found 

The requested URL/was not found on this server. 

回答

1

解決通過在production.rb加入這一行

config.serve_static_files = true 
相關問題