2016-09-15 82 views
0

我已經安裝了redmine,設法啓動它,但UI似乎缺少它的CSS樣式。如果我按照鏈接中的應用[SomeId]的.css它告訴我包含以下消息一個空的CSS:Redmine 3.3.0(ruby on rails 4.2.6)樣式表未生成/包含在application.css中

/* 
* This is a manifest file that'll be compiled into application.css, which will include all the files 
* listed below. 
* 
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. 
* 
* You're free to add application-wide styles to this file and they'll appear at the bottom of the 
* compiled file so the styles you add here take precedence over styles defined in any styles 
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new 
* file per style scope. 
* 
*/ 

production.log似乎罰款

Processing by WelcomeController#index as HTML 
    Current user: anonymous 
    Rendered welcome/index.html.erb within layouts/base (1.0ms) 
Completed 200 OK in 18ms (Views: 9.4ms | ActiveRecord: 4.0ms) 
Started GET "/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" for ::1 at 2016-09-16 01:34:36 +0300 
Started GET "/assets/application-c2899b9307d416d19b1525a85be8085b93df756e91a5b0ee50ab1333f5ade73a.js" for ::1 at 2016-09-16 01:34:36 +0300 

的.htaccess

<IfModule mod_fastcgi.c> 
    AddHandler fastcgi-script .fcgi 
</IfModule> 
<IfModule mod_fcgid.c> 
    AddHandler fcgid-script .fcgi 
</IfModule> 
Options +FollowSymLinks +ExecCGI 

RewriteEngine On 

RewriteRule ^$ index.html [QSA] 
RewriteRule ^([^.]+)$ $1.html [QSA] 
RewriteCond %{REQUEST_FILENAME} !-f 
<IfModule mod_fastcgi.c> 
    RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] 
</IfModule> 
<IfModule mod_fcgid.c> 
    RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] 
</IfModule> 

ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly" 
  • 個管理平臺3.3.0
  • 紅寶石2.2.4
  • 軌4.2.6
  • 最新的XAMPP XAMPP-win32-7.0.9-1-VCl 4,安裝

任何想法如何解決這個問題?

回答

0

顯然我的錯誤是我沒有在開發模式下運行'Redmine'。據我瞭解,直到現在,紅寶石軌道資產管道沒有被激發產生連接application.css。我所要做的只是在開發模式下運行一次服務器。

rake assets:precompile 
rails server -e development 

也發現了一些有用的信息在這個答案:Rails assets not precompiling, css looks different in productionRails 4: assets not loading in production

這是我與回報率的第一次相遇,我盲目地遵循「管理平臺」,不包括編譯步驟的安裝教程。

編輯 該問題返回,實際上甚至沒有正確修復。必須使用mysql2適配器和登錄憑據解決一些問題才能正確填充數據庫。之後,我嘗試了很多東西,直到最後到達此步驟列表:

環境中添加/生產。RB

config.serve_static_files = true 
config.assets.compile = true 
config.assets.precompile = ['*.js', '*.css', '*.css.erb'] 
config.assets.digest = true 
  • 殺死服務器
  • 清除出TMP /緩存/資產
  • 刪除公共/資產
  • 運行rake資產:預編譯
  • 啓動服務器導軌小號-e生產
  • 重新加載頁面

運行在cmd中:

set RAILS_ENV=production 
rake generate_secret_token 

set RAILS_ENV=production 
rake db:migrate 

set RAILS_ENV=production 
rake redmine:load_default_data 

set RAILS_ENV=production 
rake tmp:cache:clear 

set RAILS_ENV=production 
rake assets:precompile 

set RAILS_ENV=production 
rails server -e development 

如果我訪問該網頁,開闢了網頁檢查,當我點擊ELINK的application.css我還有空的.css

後來我想通了,而不是在gziped版本的大小爲1kb,這很吸引人。我刪除了它和VOILA,它工作。基本上我解決了我的問題,但我仍然不知道爲什麼gzip是用空css生成的。