ActionController :: RoutingError (маршрут не соответствует [GET] "/javascripts/myfile.js") после обновления с rails 4.2 до rails 5 - PullRequest
0 голосов
/ 08 апреля 2020

Я сейчас нахожусь в процессе обновления с rails 4.2 до rails 5, и я застрял в этой проблеме.

Обновление до rails 5 потребовало от меня также обновить кучу драгоценных камней. Я не изменил ничего, кроме этого.

В моем application.rb:

config.assets.precompile += %w[
      myfile.js]

в myfile. js:

//= require_tree ./controllers

I ' m включая myfile. js в html примерно так:

  <%= javascript_include_tag "myfile" %>

Я перепробовал все, что смог найти, но эта проблема не устранена.

Я новый Gemfile и Gemfile.lock:

source 'https://rubygems.org'
ruby '~> 2.5.0'

gem 'dotenv-rails'
gem 'active_model_serializers'
gem 'axlsx_rails'
gem 'axlsx', git: 'https://github.com/randym/axlsx.git', ref: 'c8ac844'
gem 'batch_api'
gem 'bootstrap_form'
gem 'bower-rails', '~> 0.10.0' # not longer supported
gem 'browser' # detects browser agent
gem 'bundler-audit'
gem 'coffee-rails'
gem 'activemodel-serializers-xml', git: 'https://github.com/rails/activemodel-serializers-xml'
gem 'draper', github: 'drapergem/draper'
gem 'elasticsearch', '< 2'
gem 'execjs'
gem 'font-awesome-rails'
gem 'geokit'
gem 'gibberish', '1.4.0' # breaking changes in 2.0. We need this for exchange password.
gem 'google-api-client', require: 'google/apis/calendar_v3'
gem 'haml-rails'
gem 'icalendar'
gem 'jquery-rails'
gem 'json_pure'
gem 'left_joins'
gem 'mysql2', '~> 0.3.18'
gem 'oj'
gem 'paperclip'
gem 'parallel'
gem 'rabl', '0.14.0'
gem 'rails-routes'
gem 'rails', '~> 5.0.0'
gem 'rails_env_prompt'
gem 'rake'
gem 'rb-readline'
gem 'recurrence'
gem 'redis'
gem 'redis-namespace'
gem 'redis-rails'
gem 'roo' # csv and excel sheet import
gem 'ruby_dig'
gem 'ruby-saml'
gem 'rvm-capistrano'
gem 'sass-rails'
gem 'seedbank'
gem 'sentry-raven'
gem 'sidekiq-limit_fetch'
gem 'sidekiq-scheduler'
gem 'sidekiq-unique-jobs'
gem 'sidekiq'
gem 'signet'
gem 'angular-rails-templates'
gem 'sprockets', '~> 3.7.2'
gem 'swaggard'
gem 'therubyracer'
gem 'thin'
gem 'tinymce-rails'
gem 'uglifier'
gem 'whenever'
gem 'holidays'
gem 'fcm'


group :development, :test do
  gem 'capistrano-db-tasks',
    git: 'https://github.com/bluerail/capistrano-db-tasks',
    branch: '0.2.1-maintenance',
    require: false
  gem 'capistrano-local-precompile', require: false
  gem 'capistrano'
  gem 'byebug'
  gem 'pry-rails'
  gem 'spring'
end

# OSX only, run bundle install --without=osx to ignore this group
group :osx do
  gem 'rb-fsevent', '~> 0.9'
  gem 'terminal-notifier-guard'
end

# Linux only, run bundle install --without=linux to ignore this group
group :linux do
  gem 'libnotify'
end

GIT
  remote: git://github.com/drapergem/draper.git
  revision: 3e7faa4369efd1253a338369b4c8ad8e31ba8b68
  specs:
    draper (4.0.1)
      actionpack (>= 5.0)
      activemodel (>= 5.0)
      activemodel-serializers-xml (>= 1.0)
      activesupport (>= 5.0)
      request_store (>= 1.0)

GIT
  remote: git@gitlab.officebooking.net:officebooking/Viewpoint.git
  revision: 615414438db8b815be5f658c4e1e37823e8e4d36
  branch: extended_props_updated
  specs:
    viewpoint (1.2.1)
      httpclient
      logging
      nokogiri
      rubyntlm

GIT
  remote: https://github.com/bluerail/capistrano-db-tasks
  revision: f9c6ba11bf7fe224fdc35329980806b6ccacf770
  branch: 0.2.1-maintenance
  specs:
    capistrano-db-tasks (0.2.1)

GIT
  remote: https://github.com/rails/activemodel-serializers-xml
  revision: 93689638c28525acc65afb638fce866826532641
  specs:
    activemodel-serializers-xml (1.0.2)
      activemodel (>= 5.0.0.a)
      activesupport (>= 5.0.0.a)
      builder (~> 3.1)

GIT
  remote: https://github.com/randym/axlsx.git
  revision: c8ac844572b25fda358cc01d2104720c4c42f450
  ref: c8ac844
  specs:
    axlsx (2.1.0.pre)
      htmlentities (~> 4.3.4)
      mimemagic (~> 0.3)
      nokogiri (>= 1.6.6)
      rubyzip (>= 1.2.1)

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (5.0.7.2)
      actionpack (= 5.0.7.2)
      nio4r (>= 1.2, < 3.0)
      websocket-driver (~> 0.6.1)
    actionmailer (5.0.7.2)
      actionpack (= 5.0.7.2)
      actionview (= 5.0.7.2)
      activejob (= 5.0.7.2)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.0.7.2)
      actionview (= 5.0.7.2)
      activesupport (= 5.0.7.2)
      rack (~> 2.0)
      rack-test (~> 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.0.7.2)
      activesupport (= 5.0.7.2)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    active_model_serializers (0.10.10)
      actionpack (>= 4.1, < 6.1)
      activemodel (>= 4.1, < 6.1)
      case_transform (>= 0.2)
      jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
    activejob (5.0.7.2)
      activesupport (= 5.0.7.2)
      globalid (>= 0.3.6)
    activemodel (5.0.7.2)
      activesupport (= 5.0.7.2)
    activerecord (5.0.7.2)
      activemodel (= 5.0.7.2)
      activesupport (= 5.0.7.2)
      arel (~> 7.0)
    activesupport (5.0.7.2)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    addressable (2.7.0)
      public_suffix (>= 2.0.2, < 5.0)
    angular-rails-templates (1.0.2)
      railties (>= 4.2, < 6)
      sprockets (>= 3.0, < 5)
      tilt
    arel (7.1.4)
    axlsx_rails (0.6.1)
      actionpack (>= 3.1)
      caxlsx (>= 3.0)
    batch_api (0.3.0)
      middleware
    bootstrap_form (4.4.0)
      actionpack (>= 5.0)
      activemodel (>= 5.0)
    bower-rails (0.10.0)
    browser (4.0.0)
    builder (3.2.4)
    bundler-audit (0.3.0)
      bundler (~> 1.2)
    byebug (11.1.1)
    capistrano (2.15.9)
      highline
      net-scp (>= 1.0.0)
      net-sftp (>= 2.0.0)
      net-ssh (>= 2.0.14)
      net-ssh-gateway (>= 1.1.0)
    capistrano-local-precompile (0.0.5)
      capistrano (~> 2, < 3)
    case_transform (0.2)
      activesupport
    caxlsx (3.0.1)
      htmlentities (~> 4.3, >= 4.3.4)
      mimemagic (~> 0.3)
      nokogiri (~> 1.10, >= 1.10.4)
      rubyzip (>= 1.3.0, < 3)
    chronic (0.10.2)
    climate_control (0.2.0)
    coderay (1.1.2)
    coffee-rails (4.2.2)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    concurrent-ruby (1.1.6)
    connection_pool (2.2.2)
    crass (1.0.6)
    daemons (1.3.1)
    declarative (0.0.10)
    declarative-option (0.1.0)
    dotenv (2.7.5)
    dotenv-rails (2.7.5)
      dotenv (= 2.7.5)
      railties (>= 3.2, < 6.1)
    e2mmap (0.1.0)
    elasticsearch (1.1.3)
      elasticsearch-api (= 1.1.3)
      elasticsearch-transport (= 1.1.3)
    elasticsearch-api (1.1.3)
      multi_json
    elasticsearch-transport (1.1.3)
      faraday
      multi_json
    erubis (2.7.0)
    et-orbi (1.2.4)
      tzinfo
    eventmachine (1.2.7)
    execjs (2.7.0)
    faraday (1.0.1)
      multipart-post (>= 1.2, < 3)
    fcm (0.0.6)
      httparty (~> 0.10, >= 0.10.0)
    ffi (1.12.2)
    font-awesome-rails (4.7.0.5)
      railties (>= 3.2, < 6.1)
    fugit (1.3.4)
      et-orbi (~> 1.1, >= 1.1.8)
      raabro (~> 1.1)
    geokit (1.13.1)
    gibberish (1.4.0)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    google-api-client (0.37.3)
      addressable (~> 2.5, >= 2.5.1)
      googleauth (~> 0.9)
      httpclient (>= 2.8.1, < 3.0)
      mini_mime (~> 1.0)
      representable (~> 3.0)
      retriable (>= 2.0, < 4.0)
      signet (~> 0.12)
    googleauth (0.11.0)
      faraday (>= 0.17.3, < 2.0)
      jwt (>= 1.4, < 3.0)
      memoist (~> 0.16)
      multi_json (~> 1.11)
      os (>= 0.9, < 2.0)
      signet (~> 0.12)
    haml (5.1.2)
      temple (>= 0.8.0)
      tilt
    haml-rails (1.0.0)
      actionpack (>= 4.0.1)
      activesupport (>= 4.0.1)
      haml (>= 4.0.6, < 6.0)
      html2haml (>= 1.0.1)
      railties (>= 4.0.1)
    highline (2.0.3)
    holidays (8.1.0)
    html2haml (2.2.0)
      erubis (~> 2.7.0)
      haml (>= 4.0, < 6)
      nokogiri (>= 1.6.0)
      ruby_parser (~> 3.5)
    htmlentities (4.3.4)
    httparty (0.18.0)
      mime-types (~> 3.0)
      multi_xml (>= 0.5.2)
    httpclient (2.8.3)
    i18n (1.8.2)
      concurrent-ruby (~> 1.0)
    icalendar (2.6.1)
      ice_cube (~> 0.16)
    ice_cube (0.16.3)
    jquery-rails (4.3.5)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    json_pure (2.3.0)
    jsonapi-renderer (0.2.2)
    jwt (2.2.1)
    left_joins (1.0.8)
      activerecord (>= 3)
    libv8 (3.16.14.19)
    little-plugger (1.1.4)
    logging (2.2.2)
      little-plugger (~> 1.1)
      multi_json (~> 1.10)
    loofah (2.5.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    memoist (0.16.2)
    method_source (1.0.0)
    middleware (0.1.0)
    mime-types (3.3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2019.1009)
    mimemagic (0.3.4)
    mini_mime (1.0.2)
    mini_portile2 (2.4.0)
    minitest (5.14.0)
    multi_json (1.14.1)
    multi_xml (0.6.0)
    multipart-post (2.1.1)
    mysql2 (0.3.21)
    net-scp (2.0.0)
      net-ssh (>= 2.6.5, < 6.0.0)
    net-sftp (2.1.2)
      net-ssh (>= 2.6.5)
    net-ssh (5.2.0)
    net-ssh-gateway (2.0.0)
      net-ssh (>= 4.0.0)
    nio4r (2.5.2)
    nokogiri (1.10.9)
      mini_portile2 (~> 2.4.0)
    oj (3.10.6)
    os (1.1.0)
    paperclip (6.1.0)
      activemodel (>= 4.2.0)
      activesupport (>= 4.2.0)
      mime-types
      mimemagic (~> 0.3.0)
      terrapin (~> 0.6.0)
    parallel (1.19.1)
    pry (0.13.0)
      coderay (~> 1.1)
      method_source (~> 1.0)
    pry-rails (0.3.9)
      pry (>= 0.10.4)
    public_suffix (4.0.4)
    raabro (1.1.6)
    rabl (0.14.0)
      activesupport (>= 2.3.14)
    rack (2.2.2)
    rack-protection (2.0.8.1)
      rack
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (5.0.7.2)
      actioncable (= 5.0.7.2)
      actionmailer (= 5.0.7.2)
      actionpack (= 5.0.7.2)
      actionview (= 5.0.7.2)
      activejob (= 5.0.7.2)
      activemodel (= 5.0.7.2)
      activerecord (= 5.0.7.2)
      activesupport (= 5.0.7.2)
      bundler (>= 1.3.0)
      railties (= 5.0.7.2)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.3.0)
      loofah (~> 2.3)
    rails-routes (0.1.2)
    rails_env_prompt (1.0.0)
    railties (5.0.7.2)
      actionpack (= 5.0.7.2)
      activesupport (= 5.0.7.2)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (13.0.1)
    rb-fsevent (0.10.3)
    rb-readline (0.5.5)
    recurrence (1.3.0)
      activesupport
      i18n
    redis (4.1.3)
    redis-actionpack (5.2.0)
      actionpack (>= 5, < 7)
      redis-rack (>= 2.1.0, < 3)
      redis-store (>= 1.1.0, < 2)
    redis-activesupport (5.2.0)
      activesupport (>= 3, < 7)
      redis-store (>= 1.3, < 2)
    redis-namespace (1.7.0)
      redis (>= 3.0.4)
    redis-rack (2.1.2)
      rack (>= 2.0.8, < 3)
      redis-store (>= 1.2, < 2)
    redis-rails (5.0.2)
      redis-actionpack (>= 5.0, < 6)
      redis-activesupport (>= 5.0, < 6)
      redis-store (>= 1.2, < 2)
    redis-store (1.8.2)
      redis (>= 4, < 5)
    ref (2.0.0)
    representable (3.0.4)
      declarative (< 0.1.0)
      declarative-option (< 0.2.0)
      uber (< 0.2.0)
    request_store (1.5.0)
      rack (>= 1.4)
    retriable (3.1.2)
    roo (2.8.3)
      nokogiri (~> 1)
      rubyzip (>= 1.3.0, < 3.0.0)
    ruby-saml (1.11.0)
      nokogiri (>= 1.5.10)
    ruby_dig (0.0.2)
    ruby_parser (3.14.2)
      sexp_processor (~> 4.9)
    rubyntlm (0.6.2)
    rubyzip (2.3.0)
    rufus-scheduler (3.6.0)
      fugit (~> 1.1, >= 1.1.6)
    rvm-capistrano (1.5.6)
      capistrano (~> 2.15.4)
    sass-rails (6.0.0)
      sassc-rails (~> 2.1, >= 2.1.1)
    sassc (2.2.1)
      ffi (~> 1.9)
    sassc-rails (2.1.2)
      railties (>= 4.0.0)
      sassc (>= 2.0)
      sprockets (> 3.0)
      sprockets-rails
      tilt
    seedbank (0.5.0)
      rake (>= 10.0)
    sentry-raven (3.0.0)
      faraday (>= 1.0)
    sexp_processor (4.14.1)
    sidekiq (6.0.6)
      connection_pool (>= 2.2.2)
      rack (~> 2.0)
      rack-protection (>= 2.0.0)
      redis (>= 4.1.0)
    sidekiq-limit_fetch (3.4.0)
      sidekiq (>= 4)
    sidekiq-scheduler (3.0.1)
      e2mmap
      redis (>= 3, < 5)
      rufus-scheduler (~> 3.2)
      sidekiq (>= 3)
      thwait
      tilt (>= 1.4.0)
    sidekiq-unique-jobs (5.0.2)
      sidekiq (>= 4.0)
      thor
    signet (0.14.0)
      addressable (~> 2.3)
      faraday (>= 0.17.3, < 2.0)
      jwt (>= 1.5, < 3.0)
      multi_json (~> 1.10)
    spring (2.1.0)
    sprockets (3.7.2)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    swaggard (1.1.1)
      rails (>= 4.0, < 7.0)
      sass-rails
      yard
    temple (0.8.2)
    terminal-notifier-guard (1.7.0)
    terrapin (0.6.0)
      climate_control (>= 0.0.3, < 1.0)
    therubyracer (0.12.3)
      libv8 (~> 3.16.14.15)
      ref
    thin (1.7.2)
      daemons (~> 1.0, >= 1.0.9)
      eventmachine (~> 1.0, >= 1.0.4)
      rack (>= 1, < 3)
    thor (1.0.1)
    thread_safe (0.3.6)
    thwait (0.1.0)
    tilt (2.0.10)
    tinymce-rails (5.2.1)
      railties (>= 3.1.1)
    tzinfo (1.2.7)
      thread_safe (~> 0.1)
    uber (0.1.0)
    uglifier (4.2.0)
      execjs (>= 0.3.0, < 3)
    websocket-driver (0.6.5)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.4)
    whenever (1.0.0)
      chronic (>= 0.6.3)
    yard (0.9.24)

PLATFORMS
  ruby

DEPENDENCIES
  active_model_serializers
  activemodel-serializers-xml!
  angular-rails-templates
  axlsx!
  axlsx_rails
  batch_api
  bootstrap_form
  bower-rails (~> 0.10.0)
  browser
  bundler-audit
  byebug
  capistrano
  capistrano-db-tasks!
  capistrano-local-precompile
  coffee-rails
  dotenv-rails
  draper!
  elasticsearch (< 2)
  execjs
  fcm
  font-awesome-rails
  geokit
  gibberish (= 1.4.0)
  google-api-client
  haml-rails
  holidays
  icalendar
  jquery-rails
  json_pure
  left_joins
  mysql2 (~> 0.3.18)
  oj
  paperclip
  parallel
  pry-rails
  rabl (= 0.14.0)
  rails (~> 5.0.0)
  rails-routes
  rails_env_prompt
  rake
  rb-fsevent (~> 0.9)
  rb-readline
  recurrence
  redis
  redis-namespace
  redis-rails
  roo
  ruby-saml
  ruby_dig
  rvm-capistrano
  sass-rails
  seedbank
  sentry-raven
  sidekiq
  sidekiq-limit_fetch
  sidekiq-scheduler
  sidekiq-unique-jobs
  signet
  spring
  sprockets (~> 3.7.2)
  swaggard
  terminal-notifier-guard
  therubyracer
  thin
  tinymce-rails
  uglifier
  whenever

RUBY VERSION
   ruby 2.5.0p0

BUNDLED WITH
   1.17.3

config / manifest. js:

// JS and CSS bundles
//
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css

// Images and fonts so that views can link to them
//
//= link_tree ../fonts
//= link_tree ../images

1 Ответ

0 голосов
/ 08 апреля 2020

Я полагаю, что вы также обновили звездочки, и теперь вам необходимо сохранить файл app/assets/config/manifest.js.

Подробнее о манифесте см. Здесь. js.

...