Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails无法使用angular.js加载静态html模板_Ruby On Rails_Ruby On Rails 4 - Fatal编程技术网

Ruby on rails Rails无法使用angular.js加载静态html模板

Ruby on rails Rails无法使用angular.js加载静态html模板,ruby-on-rails,ruby-on-rails-4,Ruby On Rails,Ruby On Rails 4,我得到了这个例外 没有与[GET]匹配的路由“/ng template/manager/index.html” 在我的本地计算机上一切正常,但在部署到临时服务器后失败 有什么想法吗 角路线 nginx.conf production.rb App.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/', { templateUrl: '/ng-template/mana

我得到了这个例外

没有与[GET]匹配的路由“/ng template/manager/index.html”

在我的本地计算机上一切正常,但在部署到临时服务器后失败

有什么想法吗

角路线 nginx.conf production.rb
App.config(['$routeProvider', function($routeProvider) {
  $routeProvider.
  when('/',
    {
      templateUrl: '/ng-template/manager/index.html',
      controller: 'indexCtrl'}
  ).
  when('/api_usage',
    {
      templateUrl: '/ng-template/manager/api_usage.html',
      controller: 'ApiUsageCtrl'
    }
    upstream myapp {
        server unix:/tmp/puma.myapp.sock fail_timeout=0;
    }

    server {
        listen      80;
        server_name www.myapp.com myapp.com;
        root /home/deploy/current/public ;

        location /assets/  {
            gzip_static on;
            expires max;
            add_header Cache-control public;
            add_header ETag "";
            break;
        }
        location ~* ^.+\.(jpg|jpeg|png|gif|ico|css|js)$ {
          expires max;
          try_files $uri @myapp;
        }
        location ~* ^.+\.(zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|flv|mpeg|avi|woff2|ttf|woff)$ {
            expires max;
            try_files $uri @myapp;
        }
        location @myapp {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_redirect off;
            proxy_pass http://myapp;
            proxy_connect_timeout 10s;
            proxy_read_timeout 30s;
            proxy_buffers 8 16k;
            proxy_buffer_size 32k;
        }
        try_files $uri/index.html $uri @myapp;
        error_page 500 502 503 504 /500.html;
        client_max_body_size 4G;
        keepalive_timeout 10;
    }
Rails.application.configure do
  config.eager_load = true
  config.serve_static_files = true
  config.assets.js_compressor = :uglifier
  config.assets.css_compressor = :sass
  config.assets.compile = true
  config.assets.digest = true
end