无法修改冻结的数组(运行时错误)尝试升级到Rails 5.1

4

我正在将我的rails应用从5.0版本升级到5.1版本,但是当我启动应用程序时,它会抛出以下错误:

 ~/workspace/productswatcher  rails s
/files/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/react_on_rails-5.2.0/lib/react_on_rails/version.rb:3: warning: already initialized constant ReactOnRails::VERSION
/home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/react_on_rails-5.2.0/lib/react_on_rails/version.rb:3: warning: previous definition of VERSION was here
DEPRECATION WARNING: ActionView::Template::Handlers::Erubis is deprecated and will be removed from Rails 5.2. Switch to ActionView::Template::Handlers::ERB::Erubi instead. (called from <module:Haml> at /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/haml-4.0.7/lib/haml/helpers/safe_erubis_template.rb:3)
=> Booting Puma
=> Rails 5.1.3 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Exiting
bin/rails:6: warning: already initialized constant APP_PATH
/files/alter/workspace/productswatcher/bin/rails:6: warning: previous definition of APP_PATH was here
The most common rails commands are:
 generate     Generate new code (short-cut alias: "g")
 console      Start the Rails console (short-cut alias: "c")
 server       Start the Rails server (short-cut alias: "s")
 test         Run tests except system tests (short-cut alias: "t")
 test:system  Run system tests
 dbconsole    Start a console for the database specified in config/database.yml
              (short-cut alias: "db")

 new          Create a new Rails application. "rails new my_app" creates a
              new application called MyApp in "./my_app"


All commands can be run with -h (or --help) for more information.
In addition to those commands, there are:

/files/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/command.rb:18: warning: already initialized constant Rails::Command::HELP_MAPPINGS
/home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/command.rb:18: warning: previous definition of HELP_MAPPINGS was here
/home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/actionpack-5.1.3/lib/action_dispatch/middleware/stack.rb:74:in `insert': can't modify frozen Array (RuntimeError)
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/actionpack-5.1.3/lib/action_dispatch/middleware/stack.rb:74:in `insert'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/dragonfly-1.0.12/lib/dragonfly/railtie.rb:7:in `block in <class:Railtie>'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/initializable.rb:30:in `instance_exec'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/initializable.rb:30:in `run'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/initializable.rb:59:in `block in run_initializers'
        from /files/alter/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
        from /files/alter/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
        from /files/alter/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
        from /files/alter/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
        from /files/alter/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:345:in `each'
        from /files/alter/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:345:in `call'
        from /files/alter/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
        from /files/alter/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
        from /files/alter/.rvm/rubies/ruby-2.2.5/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/initializable.rb:58:in `run_initializers'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/application.rb:353:in `initialize!'
        from /files/alter/workspace/productswatcher/config/environment.rb:5:in `<top (required)>'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in `require'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in `block in require'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:258:in `load_dependency'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in `require'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/application.rb:329:in `require_environment!'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/command/actions.rb:16:in `require_application_and_environment!'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/commands/rake/rake_command.rb:31:in `rake_tasks'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/commands/rake/rake_command.rb:40:in `formatted_rake_tasks'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/commands/rake/rake_command.rb:10:in `printing_commands'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/command.rb:91:in `each'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/command.rb:91:in `flat_map'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/command.rb:91:in `block in sorted_groups'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/activesupport-5.1.3/lib/active_support/core_ext/hash/transform_values.rb:26:in `block in transform_values!'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/activesupport-5.1.3/lib/active_support/core_ext/hash/transform_values.rb:25:in `each'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/activesupport-5.1.3/lib/active_support/core_ext/hash/transform_values.rb:25:in `transform_values!'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/command.rb:91:in `sorted_groups'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/command.rb:84:in `print_commands'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/commands/help/help_command.rb:9:in `help'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/command/base.rb:63:in `perform'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/command.rb:44:in `invoke'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/railties-5.1.3/lib/rails/commands.rb:16:in `<top (required)>'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in `require'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in `block in require'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:258:in `load_dependency'
        from /home/alter/.rvm/gems/ruby-2.2.5@productwatcher/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in `require'
        from bin/rails:8:in `<main>'

可能存在什么问题?

面对相同的问题。Rails 5.1.4 Ruby 2.3.1。 - DannyB
1个回答

0

看起来我的bullet版本(5.1.0)不兼容,我通过更新到最新版本(5.6.1)来修复它:

bundle update bullet

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接