Rails ExecJS :: Pages错误在页面#home?

Rails ExecJS :: Pages错误在页面#home?

启动一个新的应用程序,当我创建一个控制器页面回家并尝试转到本地主机:3000 / pages / home时,我收到以下错误:


Showing c:/Users/Doesha/desktop/pinplug/app/views/layouts/application.html.erb where line #6 raised:


TypeError: Object doesn't support this property or method

  (in c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee)

application.html.erb文件:


<!DOCTYPE html>

<html>

<head>

  <title>Pinplug</title>

  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>

  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>

  <%= csrf_meta_tags %>

</head>

<body>


<%= yield %>


</body>

</html>

application_controller.rb文件:


class ApplicationController < ActionController::Base

  # Prevent CSRF attacks by raising an exception.

  # For APIs, you may want to use :null_session instead.

  protect_from_forgery with: :exception

end

pages_controller.rb文件:


class PagesController < ApplicationController

  def home

  end

end

routes.rb文件:


Rails.application.routes.draw do

  get 'pages/home'


  # The priority is based upon order of creation: first created -> highest priority.

  # See how all your routes lay out with "rake routes".


  # You can have the root of your site routed with "root"

  # root 'welcome#index'


  # Example of regular route:

  #   get 'products/:id' => 'catalog#view'


  # Example of named route that can be invoked with purchase_url(id: product.id)

  #   get 'products/:id/purchase' => 'catalog#purchase', as: :purchase


  # Example resource route (maps HTTP verbs to controller actions automatically):

  #   resources :products


  # Example resource route with options:

  #   resources :products do

  #     member do

  #       get 'short'

  #       post 'toggle'

  #     end

  #

  #     collection do

  #       get 'sold'

  #     end

  #   end


  # Example resource route with sub-resources:

  #   resources :products do

  #     resources :comments, :sales

  #     resource :seller

  #   end

梵蒂冈之花
浏览 533回答 3
3回答

Cats萌萌

如果您在WIndows中运行,那么coffee-script-source 1.9.0在Windows上不起作用。将其更改为以前版本将此行添加到您的Gemfile:gem&nbsp;'coffee-script-source',&nbsp;'1.8.0'然后重新安装捆绑包,调整新Gem版本的依赖关系:bundle&nbsp;update&nbsp;coffee-script-source
打开App,查看更多内容
随时随地看视频慕课网APP