Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using TS in rails 6 #1137

Closed
alexdbondoc17 opened this issue Jun 19, 2019 · 4 comments
Closed

Problem using TS in rails 6 #1137

alexdbondoc17 opened this issue Jun 19, 2019 · 4 comments

Comments

@alexdbondoc17
Copy link

alexdbondoc17 commented Jun 19, 2019

Hello Pat,

I'm currently experiencing a FrozenError: can't modify frozen Array error when I execute rake ts:rebuild in the development environment.

This is my Gemfile.lock

GIT
  remote: /~https://github.com/CanCanCommunity/cancancan.git
  revision: 61bfbc15eeb6303029e00b44e1f7e5bbb9ddad42
  branch: master
  specs:
    cancancan (3.0.1)

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (6.0.0.rc1)
      actionpack (= 6.0.0.rc1)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailbox (6.0.0.rc1)
      actionpack (= 6.0.0.rc1)
      activejob (= 6.0.0.rc1)
      activerecord (= 6.0.0.rc1)
      activestorage (= 6.0.0.rc1)
      activesupport (= 6.0.0.rc1)
      mail (>= 2.7.1)
    actionmailer (6.0.0.rc1)
      actionpack (= 6.0.0.rc1)
      actionview (= 6.0.0.rc1)
      activejob (= 6.0.0.rc1)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (6.0.0.rc1)
      actionview (= 6.0.0.rc1)
      activesupport (= 6.0.0.rc1)
      rack (~> 2.0)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actiontext (6.0.0.rc1)
      actionpack (= 6.0.0.rc1)
      activerecord (= 6.0.0.rc1)
      activestorage (= 6.0.0.rc1)
      activesupport (= 6.0.0.rc1)
      nokogiri (>= 1.8.5)
    actionview (6.0.0.rc1)
      activesupport (= 6.0.0.rc1)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    activejob (6.0.0.rc1)
      activesupport (= 6.0.0.rc1)
      globalid (>= 0.3.6)
    activemodel (6.0.0.rc1)
      activesupport (= 6.0.0.rc1)
    activerecord (6.0.0.rc1)
      activemodel (= 6.0.0.rc1)
      activesupport (= 6.0.0.rc1)
    activestorage (6.0.0.rc1)
      actionpack (= 6.0.0.rc1)
      activejob (= 6.0.0.rc1)
      activerecord (= 6.0.0.rc1)
      marcel (~> 0.3.1)
    activesupport (6.0.0.rc1)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
      zeitwerk (~> 2.1, >= 2.1.4)
    addressable (2.6.0)
      public_suffix (>= 2.0.2, < 4.0)
    archive-zip (0.12.0)
      io-like (~> 0.3.0)
    ast (2.4.0)
    autoprefixer-rails (9.6.0)
      execjs
    bcrypt (3.1.13)
    better_html (1.0.13)
      actionview (>= 4.0)
      activesupport (>= 4.0)
      ast (~> 2.0)
      erubi (~> 1.4)
      html_tokenizer (~> 0.0.6)
      parser (>= 2.4)
      smart_properties
    bindex (0.7.0)
    bootsnap (1.4.4)
      msgpack (~> 1.0)
    bootstrap (4.3.1)
      autoprefixer-rails (>= 9.1.0)
      popper_js (>= 1.14.3, < 2)
      sassc-rails (>= 2.0.0)
    brakeman (4.5.1)
    builder (3.2.3)
    bundler-audit (0.6.1)
      bundler (>= 1.2.0, < 3)
      thor (~> 0.18)
    byebug (11.0.1)
    capybara (3.24.0)
      addressable
      mini_mime (>= 0.1.3)
      nokogiri (~> 1.8)
      rack (>= 1.6.0)
      rack-test (>= 0.6.3)
      regexp_parser (~> 1.5)
      xpath (~> 3.2)
    childprocess (1.0.1)
      rake (< 13.0)
    chromedriver-helper (2.1.1)
      archive-zip (~> 0.10)
      nokogiri (~> 1.8)
    coderay (1.1.2)
    concurrent-ruby (1.1.5)
    crass (1.0.4)
    declarative (0.0.10)
    declarative-option (0.1.0)
    devise (4.6.2)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0, < 6.0)
      responders
      warden (~> 1.2.3)
    diff-lcs (1.3)
    digest-crc (0.4.1)
    docile (1.3.2)
    domain_name (0.5.20180417)
      unf (>= 0.0.5, < 1.0.0)
    erb_lint (0.0.28)
      activesupport
      better_html (~> 1.0.7)
      html_tokenizer
      rainbow
      rubocop (~> 0.51)
      smart_properties
    erubi (1.8.0)
    execjs (2.7.0)
    faker (1.9.3)
      i18n (>= 0.7)
    faraday (0.15.4)
      multipart-post (>= 1.2, < 3)
    ffaker (2.11.0)
    ffi (1.11.1)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    google-api-client (0.30.2)
      addressable (~> 2.5, >= 2.5.1)
      googleauth (>= 0.5, < 0.10.0)
      httpclient (>= 2.8.1, < 3.0)
      mini_mime (~> 1.0)
      representable (~> 3.0)
      retriable (>= 2.0, < 4.0)
      signet (~> 0.10)
    google-cloud-core (1.3.0)
      google-cloud-env (~> 1.0)
    google-cloud-env (1.1.0)
      faraday (~> 0.11)
    google-cloud-storage (1.18.2)
      addressable (~> 2.5)
      digest-crc (~> 0.4)
      google-api-client (~> 0.26)
      google-cloud-core (~> 1.2)
      googleauth (>= 0.6.2, < 0.10.0)
      mime-types (~> 3.0)
    googleauth (0.8.1)
      faraday (~> 0.12)
      jwt (>= 1.4, < 3.0)
      memoist (~> 0.16)
      multi_json (~> 1.11)
      os (>= 0.9, < 2.0)
      signet (~> 0.7)
    html_tokenizer (0.0.7)
    http-cookie (1.0.3)
      domain_name (~> 0.5)
    httpclient (2.8.3)
    i18n (1.6.0)
      concurrent-ruby (~> 1.0)
    innertube (1.1.0)
    io-like (0.3.0)
    jaro_winkler (1.5.3)
    jbuilder (2.9.1)
      activesupport (>= 4.2.0)
    joiner (0.4.2)
      activerecord (>= 5.2.beta1)
    json (2.2.0)
    json-schema (2.8.1)
      addressable (>= 2.4)
    jwt (2.2.1)
    launchy (2.4.3)
      addressable (~> 2.3)
    letter_opener (1.7.0)
      launchy (~> 2.2)
    letter_opener_web (1.3.4)
      actionmailer (>= 3.2)
      letter_opener (~> 1.0)
      railties (>= 3.2)
    listen (3.1.5)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
      ruby_dep (~> 1.2)
    loofah (2.2.3)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    mailgun-ruby (1.1.11)
      rest-client (~> 2.0.2)
    marcel (0.3.3)
      mimemagic (~> 0.3.2)
    marginalia (1.8.0)
      actionpack (>= 2.3)
      activerecord (>= 2.3)
    memoist (0.16.0)
    method_source (0.9.2)
    middleware (0.1.0)
    mime-types (3.2.2)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2019.0331)
    mimemagic (0.3.3)
    mini_mime (1.0.1)
    mini_portile2 (2.4.0)
    minitest (5.11.3)
    msgpack (1.2.10)
    multi_json (1.13.1)
    multi_xml (0.6.0)
    multipart-post (2.1.1)
    mysql2 (0.5.2)
    netrc (0.11.0)
    nio4r (2.3.1)
    nokogiri (1.10.3)
      mini_portile2 (~> 2.4.0)
    oauth2 (1.4.1)
      faraday (>= 0.8, < 0.16.0)
      jwt (>= 1.0, < 3.0)
      multi_json (~> 1.3)
      multi_xml (~> 0.5)
      rack (>= 1.2, < 3)
    orm_adapter (0.5.0)
    os (1.0.1)
    paper_trail (10.3.0)
      activerecord (>= 4.2, < 6.1)
      request_store (~> 1.1)
    parallel (1.17.0)
    parser (2.6.3.0)
      ast (~> 2.4.0)
    pg (0.21.0)
    popper_js (1.14.5)
    pry (0.12.2)
      coderay (~> 1.1.0)
      method_source (~> 0.9.0)
    pry-byebug (3.7.0)
      byebug (~> 11.0)
      pry (~> 0.10)
    public_suffix (3.1.0)
    puma (3.12.1)
    rack (2.0.7)
    rack-proxy (0.6.5)
      rack
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rails (6.0.0.rc1)
      actioncable (= 6.0.0.rc1)
      actionmailbox (= 6.0.0.rc1)
      actionmailer (= 6.0.0.rc1)
      actionpack (= 6.0.0.rc1)
      actiontext (= 6.0.0.rc1)
      actionview (= 6.0.0.rc1)
      activejob (= 6.0.0.rc1)
      activemodel (= 6.0.0.rc1)
      activerecord (= 6.0.0.rc1)
      activestorage (= 6.0.0.rc1)
      activesupport (= 6.0.0.rc1)
      bundler (>= 1.3.0)
      railties (= 6.0.0.rc1)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.0.4)
      loofah (~> 2.2, >= 2.2.2)
    rails-i18n (5.1.3)
      i18n (>= 0.7, < 2)
      railties (>= 5.0, < 6)
    railties (6.0.0.rc1)
      actionpack (= 6.0.0.rc1)
      activesupport (= 6.0.0.rc1)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.20.3, < 2.0)
    rainbow (3.0.0)
    rake (12.3.2)
    rb-fsevent (0.10.3)
    rb-inotify (0.10.0)
      ffi (~> 1.0)
    regexp_parser (1.5.1)
    representable (3.0.4)
      declarative (< 0.1.0)
      declarative-option (< 0.2.0)
      uber (< 0.2.0)
    request_store (1.4.1)
      rack (>= 1.4)
    responders (2.4.1)
      actionpack (>= 4.2.0, < 6.0)
      railties (>= 4.2.0, < 6.0)
    rest-client (2.0.2)
      http-cookie (>= 1.0.2, < 2.0)
      mime-types (>= 1.16, < 4.0)
      netrc (~> 0.8)
    retriable (3.1.2)
    riddle (2.3.2)
    rspec (3.8.0)
      rspec-core (~> 3.8.0)
      rspec-expectations (~> 3.8.0)
      rspec-mocks (~> 3.8.0)
    rspec-core (3.8.1)
      rspec-support (~> 3.8.0)
    rspec-expectations (3.8.4)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.8.0)
    rspec-mocks (3.8.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.8.0)
    rspec-rails (3.8.2)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 3.8.0)
      rspec-expectations (~> 3.8.0)
      rspec-mocks (~> 3.8.0)
      rspec-support (~> 3.8.0)
    rspec-support (3.8.2)
    rubocop (0.71.0)
      jaro_winkler (~> 1.5.1)
      parallel (~> 1.10)
      parser (>= 2.6)
      rainbow (>= 2.2.2, < 4.0)
      ruby-progressbar (~> 1.7)
      unicode-display_width (>= 1.4.0, < 1.7)
    rubocop-junit_formatter (0.2)
      rubocop (~> 0.49)
    rubocop-performance (1.3.0)
      rubocop (>= 0.68.0)
    rubocop-rails (2.0.1)
      rack (>= 1.1)
      rubocop (>= 0.70.0)
    rubocop-rspec (1.33.0)
      rubocop (>= 0.60.0)
    ruby-progressbar (1.10.1)
    ruby_dep (1.5.0)
    rubyzip (1.2.3)
    sass (3.7.4)
      sass-listen (~> 4.0.0)
    sass-listen (4.0.0)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    sass-rails (5.0.7)
      railties (>= 4.0.0, < 6)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    sassc (2.0.1)
      ffi (~> 1.9)
      rake
    sassc-rails (2.1.2)
      railties (>= 4.0.0)
      sassc (>= 2.0)
      sprockets (> 3.0)
      sprockets-rails
      tilt
    selenium-webdriver (3.142.3)
      childprocess (>= 0.5, < 2.0)
      rubyzip (~> 1.2, >= 1.2.2)
    signet (0.11.0)
      addressable (~> 2.3)
      faraday (~> 0.9)
      jwt (>= 1.5, < 3.0)
      multi_json (~> 1.10)
    simplecov (0.16.1)
      docile (~> 1.1)
      json (>= 1.8, < 3)
      simplecov-html (~> 0.10.0)
    simplecov-html (0.10.2)
    smart_properties (1.14.0)
    spring (2.1.0)
    spring-watcher-listen (2.0.1)
      listen (>= 2.7, < 4.0)
      spring (>= 1.2, < 3.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)
    sqlite3 (1.4.1)
    thinking-sphinx (4.3.0)
      activerecord (>= 3.1.0)
      builder (>= 2.1.2)
      innertube (>= 1.0.2)
      joiner (>= 0.2.0)
      middleware (>= 0.1.0)
      riddle (~> 2.3)
    thor (0.20.3)
    thread_safe (0.3.6)
    tilt (2.0.9)
    timecop (0.9.1)
    turbolinks (5.2.0)
      turbolinks-source (~> 5.2)
    turbolinks-source (5.2.0)
    tzinfo (1.2.5)
      thread_safe (~> 0.1)
    uber (0.1.0)
    uglifier (4.1.20)
      execjs (>= 0.3.0, < 3)
    unf (0.1.4)
      unf_ext
    unf_ext (0.0.7.6)
    unicode-display_width (1.6.0)
    warden (1.2.8)
      rack (>= 2.0.6)
    web-console (4.0.0)
      actionview (>= 6.0.0.a)
      activemodel (>= 6.0.0.a)
      bindex (>= 0.4.0)
      railties (>= 6.0.0.a)
    webpacker (4.0.7)
      activesupport (>= 4.2)
      rack-proxy (>= 0.6.1)
      railties (>= 4.2)
    websocket-driver (0.7.1)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.4)
    wicked_pdf (1.4.0)
      activesupport
    xpath (3.2.0)
      nokogiri (~> 1.8)
    zeitwerk (2.1.6)

PLATFORMS
  ruby

DEPENDENCIES
  autoprefixer-rails
  bootsnap
  bootstrap
  brakeman
  bundler-audit
  byebug
  cancancan!
  capybara (>= 2.15)
  chromedriver-helper
  devise
  erb_lint
  faker (>= 1.8.7)
  ffaker (>= 2.8.0)
  google-cloud-storage (~> 1.11)
  jbuilder (~> 2.5)
  jdbc-mysql (~> 5.1.35)
  json-schema
  letter_opener_web
  listen (>= 3.0.5, < 3.2)
  mailgun-ruby
  marginalia
  mysql2
  oauth2 (~> 1.4)
  paper_trail
  pg (~> 0.21)
  pry-byebug
  puma (~> 3.11)
  rails (~> 6.0.0.beta1)
  rails-i18n
  rspec
  rspec-rails
  rubocop
  rubocop-junit_formatter
  rubocop-performance
  rubocop-rails
  rubocop-rspec
  sass-rails (~> 5.0.6)
  selenium-webdriver
  simplecov
  spring
  spring-watcher-listen (~> 2.0.0)
  sqlite3
  thinking-sphinx (~> 4.3)
  timecop
  turbolinks (~> 5)
  uglifier (>= 1.3.0)
  web-console (>= 3.3.0)
  webpacker (>= 4.0.0.rc.3)
  wicked_pdf

RUBY VERSION
   ruby 2.6.2p47

BUNDLED WITH
   1.17.3

This is the error

searchd is not currently running.
rails aborted!
FrozenError: can't modify frozen Array
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:491:in `concat'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:491:in `load_file'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:384:in `block in require_or_load'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:37:in `block in load_interlock'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies/interlock.rb:13:in `loading'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:37:in `load_interlock'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:367:in `require_or_load'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:48:in `block in require_or_load'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/active_support.rb:47:in `require_or_load'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/thinking-sphinx-4.3.0/lib/thinking_sphinx/configuration.rb:91:in `block (3 levels) in preload_indices'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/thinking-sphinx-4.3.0/lib/thinking_sphinx/configuration.rb:90:in `each'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/thinking-sphinx-4.3.0/lib/thinking_sphinx/configuration.rb:90:in `block (2 levels) in preload_indices'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/thinking-sphinx-4.3.0/lib/thinking_sphinx/configuration.rb:89:in `each'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/thinking-sphinx-4.3.0/lib/thinking_sphinx/configuration.rb:89:in `block in preload_indices'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/thinking-sphinx-4.3.0/lib/thinking_sphinx/configuration.rb:86:in `preload_indices'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/thinking-sphinx-4.3.0/lib/thinking_sphinx/interfaces/sql.rb:7:in `initialize'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/thinking-sphinx-4.3.0/lib/thinking_sphinx/rake_interface.rb:24:in `new'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/thinking-sphinx-4.3.0/lib/thinking_sphinx/rake_interface.rb:24:in `sql'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/thinking-sphinx-4.3.0/lib/thinking_sphinx/tasks.rb:44:in `block (3 levels) in <main>'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/railties-6.0.0.rc1/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/railties-6.0.0.rc1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/railties-6.0.0.rc1/lib/rails/command.rb:48:in `invoke'
/Users/alexdbondoc/.rvm/gems/ruby-2.6.2/gems/railties-6.0.0.rc1/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:3:in `<main>'

Caused by:
LoadError: cannot load such file -- rails/commands
bin/rails:3:in `<main>'
Tasks: TOP => ts:rebuild => ts:clear => ts:sql:clear
(See full trace by running task with --trace)
@pat
Copy link
Owner

pat commented Jun 19, 2019

Looking into this now… seems it's something that's crept in after 6.0.0.beta1, possibly related to the new dependency zeitwerk. 🤔

pat added a commit that referenced this issue Jun 25, 2019
It seems `ActiveSupport::Dependencies.require_or_load` was never a public API as such, and it doesn’t work well (at least, for what I’m doing here) in Rails 6.

See fxn/zeitwerk#56 for more discussion, and #1137 for the original bug report.
@pat
Copy link
Owner

pat commented Jun 25, 2019

I've just pushed a fix for this to the develop branch - if you'd like to try it out and confirm it's working in your app, use the following in your Gemfile:

gem "thinking-sphinx",
  :git    => "/~https://github.com/pat/thinking-sphinx.git",
  :branch => "develop",
  :ref    => "d1e3603c9e"

@alexdbondoc17
Copy link
Author

alexdbondoc17 commented Jun 26, 2019

Awesome! The error was gone. I'm looking forward to the new release of this gem. Thanks Pat.

@pat
Copy link
Owner

pat commented Jun 27, 2019

Just published v4.3.1 which includes this fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants