bcdice / BCDice

The most popular TRPG dice command engine in Japan
https://bcdice.org
BSD 3-Clause "New" or "Revised" License
140 stars 184 forks source link

won't work on rails 6.1 #369

Closed SimuraEpona closed 3 years ago

SimuraEpona commented 3 years ago

Hi.

I installed this gem through Gemfile on an Rails 6.1 app.

# my other gems
.
.
.

gem 'bcdice'

after I installed it, then i typed rails s to start local server, there was an error happened.

/Users/xxxx/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.0/lib/active_support/evented_file_update_checker.rb:74:in `initialize': no implicit conversion of Array into String (TypeError)

my ruby version is 3.0, but i tried in Ruby 2.7, and error is the same. so I think the Ruby version doesn't matter.

ysakasin commented 3 years ago
➤ bundle exec rails s
=> Booting Puma
=> Rails 6.1.1 application starting in development 
=> Run `bin/rails server --help` for more startup options
Exiting
Traceback (most recent call last):
    82: from bin/rails:2:in `<main>'
    81: from bin/rails:2:in `load'
    80: from /Users/xxxxxxxxxx/src/project-app/bin/spring:7:in `<top (required)>'
    79: from /Users/xxxxxxxxxx/src/project-app/bin/spring:7:in `tap'
    78: from /Users/xxxxxxxxxx/src/project-app/bin/spring:10:in `block in <top (required)>'
    77: from /Users/xxxxxxxxxx/src/project-app/bin/spring:10:in `require'
    76: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
    75: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'
    74: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'
    73: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
    72: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
    71: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'
    70: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'
    69: from /Users/xxxxxxxxxx/src/project-app/bin/rails:5:in `<top (required)>'
    68: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `require'
    67: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:299:in `load_dependency'
    66: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `block in require'
    65: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
    64: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
    63: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    62: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
    61: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
    60: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/commands.rb:18:in `<main>'
    59: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/command.rb:50:in `invoke'
    58: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/command/base.rb:69:in `perform'
    57: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
    56: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
    55: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
    54: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:135:in `perform'
    53: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:135:in `tap'
    52: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:144:in `block in perform'
    51: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:37:in `start'
    50: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
    49: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:422:in `wrapped_app'
    48: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:249:in `app'
    47: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:349:in `build_app_and_options_from_config'
    46: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
    45: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
    44: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
    43: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
    42: from config.ru:3:in `block in <main>'
    41: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:53:in `require_relative'
    40: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `require'
    39: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:299:in `load_dependency'
    38: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `block in require'
    37: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
    36: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
    35: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
    34: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    33: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
    32: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
    31: from /Users/xxxxxxxxxx/src/project-app/config/environment.rb:5:in `<main>'
    30: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/application.rb:384:in `initialize!'
    29: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/initializable.rb:60:in `run_initializers'
    28: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
    27: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
    26: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
    25: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/2.7.0/tsort.rb:347:in `call'
    24: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/2.7.0/tsort.rb:347:in `each'
    23: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
    22: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
    21: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    20: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
    19: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/initializable.rb:61:in `block in run_initializers'
    18: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/initializable.rb:32:in `run'
    17: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/initializable.rb:32:in `instance_exec'
    16: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/railties-6.1.1/lib/rails/application/finisher.rb:140:in `block in <module:Finisher>'
    15: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
    14: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/lazy_load_hooks.rb:51:in `each'
    13: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
    12: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/lazy_load_hooks.rb:66:in `execute_hook'
    11: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/lazy_load_hooks.rb:61:in `with_execution_control'
    10: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/lazy_load_hooks.rb:68:in `block in execute_hook'
     9: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/i18n_railtie.rb:20:in `block in <class:Railtie>'
     8: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/i18n_railtie.rb:64:in `initialize_i18n'
     7: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/i18n_railtie.rb:64:in `new'
     6: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/evented_file_update_checker.rb:44:in `initialize'
     5: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/evented_file_update_checker.rb:44:in `new'
     4: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/evented_file_update_checker.rb:74:in `initialize'
     3: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/evented_file_update_checker.rb:74:in `map'
     2: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/evented_file_update_checker.rb:74:in `block in initialize'
     1: from /Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/evented_file_update_checker.rb:74:in `Pathname'
/Users/xxxxxxxxxx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.1.1/lib/active_support/evented_file_update_checker.rb:74:in `initialize': no implicit conversion of Array into String (TypeError)
ysakasin commented 3 years ago

@SimuraEpona Thanks reporting!

It seems to be i18n problem. ActiveSupport automatically loads i18n files but loading i18n files from BCDice are failed. I don't know why failing.

To quick fix, add require: false on Gemfile and append require 'bcdice' to some file.

gem 'bcdice', '~> 3.0.0.pre.rc.2', require: false
SimuraEpona commented 3 years ago

@ysakasin

thanks for the reply!

I will try it later. 😃

ysakasin commented 3 years ago

@SimuraEpona

I guess this is a bug of ActiveSupport. I will try fix it.