gpt4 book ai didi

ruby-on-rails - 可能发生 sprockets rails gem 问题?

转载 作者:行者123 更新时间:2023-12-04 04:33:25 25 4
gpt4 key购买 nike

我刚刚创建了一个新的Vagrant框,以便能够开发我的Rails应用程序。盒子是全新的,并且安装了Ruby,MySQL等以便进行开发。

我已经安装了所有gems等,但是当我尝试启动该应用程序时,我得到了以下信息:

vagrant@neiltongesite:/vagrant/source$ bundle exec foreman start
17:45:02 rails.1 | started with pid 5910
17:45:05 rails.1 | /home/vagrant/.gem/ruby/2.2.7/gems/sprockets-rails-3.2.0/lib/sprockets/railtie.rb:108:in `block in <class:Railtie>': undefined method `+' for false:FalseClass (NoMethodError)
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `instance_exec'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `run'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/initializable.rb:55:in `block in run_initializers'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:345:in `each'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:345:in `call'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
17:45:05 rails.1 | from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/initializable.rb:54:in `run_initializers'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/application.rb:352:in `initialize!'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `public_send'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `method_missing'
17:45:05 rails.1 | from /vagrant/source/config/environment.rb:5:in `<top (required)>'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block in require'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
17:45:05 rails.1 | from /vagrant/source/config.ru:3:in `block in <main>'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:55:in `instance_eval'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:55:in `initialize'
17:45:05 rails.1 | from /vagrant/source/config.ru:in `new'
17:45:05 rails.1 | from /vagrant/source/config.ru:in `<main>'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:49:in `eval'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:49:in `new_from_string'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:40:in `parse_file'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/server.rb:299:in `build_app_and_options_from_config'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/server.rb:208:in `app'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/server.rb:61:in `app'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/server.rb:336:in `wrapped_app'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/server.rb:139:in `log_to_stdout'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/server.rb:78:in `start'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `server'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
17:45:05 rails.1 | from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
17:45:05 rails.1 | from bin/rails:4:in `require'
17:45:05 rails.1 | from bin/rails:4:in `<main>'
17:45:05 rails.1 | => Booting Puma
17:45:05 rails.1 | => Rails 4.2.5.1 application starting in development on http://0.0.0.0:3000
17:45:05 rails.1 | => Run `rails server -h` for more startup options
17:45:05 rails.1 | => Ctrl-C to shutdown server
17:45:05 rails.1 | Exiting
17:45:05 rails.1 | exited with code 1
17:45:05 system | sending SIGTERM to all processes

我已经看过,但似乎无法弄清楚是什么原因造成的。

有人能指出我正确的方向吗?

最佳答案

this line上引发了异常,因此我猜您在配置文件中的某些位置:

config.assets.precompile = false

此配置设置应将 定义为要预编译的 Assets 数组,而不应将其设置为 false。有关更多信息,请参见 Rails guides

为了验证这个假设,我在上面的代码行中配置了一个测试Rails 5项目,并得到了相同的异常(exception):
.../gems/sprockets-rails-3.2.0/lib/sprockets/railtie.rb:108:in `block in <class:Railtie>': undefined method `+' for false:FalseClass (NoMethodError)

关于ruby-on-rails - 可能发生 sprockets rails gem 问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43744192/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com