簡體   English   中英

余燼/鐵路應用程序加載在開發中無法正確加載(花費太長時間)

[英]ember/rails app loading not loading properly (takes too long) in development

我有一個帶有rails后端的新ember-cli應用程序。 加載開發大約需要30秒鍾以上的時間……顯然太長了。

我正在使用ember-cli-rails gem https://github.com/rwz/ember-cli-rails

我正在使用Rails服務器(我嘗試過webrick和Thin)。 我沒有使用余燼服務器,沒有單獨運行它們。

我沒有使用Rails資產管道。 我已經刪除了。

這是我的rails配置/路由

Rails.application.routes.draw do

  resources :rewrites, contraints: { format: :json }
  resources :users, contraints: { format: :json }
  resources :movies, contraints: { format: :json }

  root 'application#index'

  namespace :api do
    get :csrf, to: 'csrf#index'
  end

  get "/*path" => "application#index", contraints: { format: :html }

這是我的application.html.erb

<!DOCTYPE html>
<html>
  <head>
    <title>Better Films</title>
    <%= csrf_meta_tags %>
  </head>
  <body>

    <%= yield %>

  </body>
</html>

這是我的application / index.html.erb,前端是我的余燼應用程序的名稱

<%= include_ember_script_tags :frontend %>
<%= include_ember_stylesheet_tags :frontend %>

當我進入本地主機時,我的Rails服務器日志顯示了這個

Rendered application/index.html.erb within layouts/application (173.6ms)
Completed 200 OK in 203ms (Views: 202.6ms | ActiveRecord: 0.0ms)


Started GET "/assets/frontend/frontend.css?body=1" for 127.0.0.1 at 2015-01-15 23:13:28 -0600


Started GET "/assets/frontend/vendor.css?body=1" for 127.0.0.1 at 2015-01-15 23:13:39 -0600


Started GET "/assets/frontend/frontend.js?body=1" for 127.0.0.1 at 2015-01-15 23:13:49 -0600


Started GET "/assets/frontend/vendor.js?body=1" for 127.0.0.1 at 2015-01-15 23:14:00 -0600

Web檢查器網絡選項卡顯示

在此處輸入圖片說明

我不確定是否與此相關,但是當我在config/initializers/ember.rb Rails.root.join('frontend').to_s ember應用程序的路徑設置為Rails.root.join('frontend').to_s時遇到了同樣的問題。 當我刪除路徑選項時,一切正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM