代码之家  ›  专栏  ›  技术社区  ›  Salman

ActionView::模板::错误(找不到文件)

  •  0
  • Salman  · 技术社区  · 7 年前

    我已将我的应用程序更新为 rails 5.1 狂欢 spree 3.5 这给最新的生物带来了几个问题。

      ActionView::Template::Error (couldn't find file 'jquery.validate/jquery.validate.min' with type 'application/javascript'
    

    我试过安装宝石 gem 'jquery-rails' gem 'rails-ujs,'~> 0.1.0' gem "jquery-ui-rails" gem 'jquery-validation-rails' 甚至将这些文件添加到我的javascript文件夹中。

    仍然没有成功。

    有人知道问题的原因和解决方法吗?

    电子文件

    source 'https://rubygems.org'
    
    
    # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
    gem 'rails'
    # Use sqlite3 as the database for Active Record
    # gem 'sqlite3'
    gem 'pg', '< 1'
    # Use SCSS for stylesheets
    gem 'sass-rails'
    # Use Uglifier as compressor for JavaScript assets
    gem 'uglifier'
    # Use CoffeeScript for .coffee assets and views
    gem 'coffee-rails'
    # See https://github.com/rails/execjs#readme for more supported runtimes
    gem 'therubyracer', platforms: :ruby
    gem 'truncate_html', '~> 0.9.3'
    # Use jquery as the JavaScript library
    gem 'jquery-rails'
    gem 'rails-ujs', '~> 0.1.0'
    gem "jquery-ui-rails"
    gem 'jquery-validation-rails'
    # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
    gem 'turbolinks'
    # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
    gem 'jbuilder'
    # bundle exec rake doc:rails generates the API under doc/api.
    gem 'sdoc', group: :doc
    
    gem 'rake'
    gem 'rspec'
    gem 'kramdown'
    gem 'thor', '0.19.1'
    gem 'spree_braintree_vzero', github: 'spree-contrib/spree_braintree_vzero'
    # Use ActiveModel has_secure_password
    # gem 'bcrypt', '~> 3.1.7'
    
    # Use Unicorn as the app server
    # gem 'unicorn'
    
    # Use Capistrano for deployment
    # gem 'capistrano-rails', group: :development
    
    
    group :development, :test do
      # Call 'byebug' anywhere in the code to stop execution and get a debugger console
      gem 'byebug'
      gem 'capistrano-passenger'
      gem 'capistrano-rails'
      gem 'capistrano-rvm'
    
    end
    
    group :development do
    
      # Access an IRB console on exception pages or by using <%= console %> in views
      gem 'web-console', '~> 2.0'
    
      # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
      gem 'spring'
    end
    
    gem 'spree', '~> 3.5.0.rc2'
    gem 'spree_auth_devise', '~> 3.3'
    gem 'spree_gateway', '~> 3.3'
    gem 'devise'
    gem 'materialize-sass'
    gem 'active_link_to'
    #gem 'mollie-api-ruby', '< 3.2'
    # gem 'spree_mollie', github: 'salman15/mollie_spree_2017', branch: 'stable'
    #gem 'spree_mollie', github: 'ttcremers/spree_mollie', branch: 'stable'
    gem 'spree_mail_settings', github: 'spree-contrib/spree_mail_settings'
    # gem 'spree_i18n', github: 'spree-contrib/spree_i18n'
    # gem 'spree_globalize', github: 'spree-contrib/spree_globalize', branch: 'master'
    gem "mini_magick"
    gem 'spree_mollie_gateway'
    # gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-4-x' # For 4.x
    # gem 'globalize', '~> 5.1.0'
    

    所有.js/application.js

        // This is a manifest file that'll be compiled into including all the files listed below.
    // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
    // be included in the compiled file accessible from http://example.com/assets/application.js
    // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
    // the compiled file.
    //
    //= require jquery
    //= require jquery_ujs
    //= require jquery.validate
    //= require spree/frontend
    
    //= require_tree .
    //= require spree/frontend/spree_auth
    //= require spree/frontend/spree_braintree_vzero
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Nemo    7 年前

    这解决了我的问题:我刚把线移走了

    //= require jquery.validate/jquery.validate.min
    

    来自frontend.js