gpt4 book ai didi

ruby-on-rails - rails 服务器抛出 `require' : cannot load such file -- bigdecimal/util (LoadError)

转载 作者:行者123 更新时间:2023-12-01 09:29:57 26 4
gpt4 key购买 nike

在 Rails 3.2.12 中,当我运行 rails s 时它抛出

/usr/local/share/gems/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- bigdecimal/util (LoadError)

我什至在 Gemfile 中添加了 gem 'bigdecimal' 但我仍然遇到同样的错误,有什么指示吗?

最佳答案

我在一个全新的 Rails 生成的应用程序上遇到了 Rails 5.0.2 的这个问题。问题是 bigdecimal不是从我更新的 gemset 加载的,而是从 ruby​​-2.3.0 默认 gemset 加载的。这是通过添加 gem 'bigdecimal' 解决的到我的 Gemfile .

<gem-root>/gems/activesupport-5.0.2/lib/active_support/core_ext/big_decimal/conversions.rb:2:in `require': cannot load such file -- bigdecimal/util (LoadError)
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/core_ext/big_decimal/conversions.rb:2:in `<top (required)>'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/core_ext/object/json.rb:4:in `require'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/core_ext/object/json.rb:4:in `<top (required)>'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/core_ext/object.rb:11:in `require'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/core_ext/object.rb:11:in `<top (required)>'
from <gem-root>/gems/railties-5.0.2/lib/rails/configuration.rb:2:in `require'
from <gem-root>/gems/railties-5.0.2/lib/rails/configuration.rb:2:in `<top (required)>'
from <gem-root>/gems/railties-5.0.2/lib/rails/railtie/configuration.rb:1:in `require'
from <gem-root>/gems/railties-5.0.2/lib/rails/railtie/configuration.rb:1:in `<top (required)>'
from <gem-root>/gems/railties-5.0.2/lib/rails/railtie.rb:216:in `require'
from <gem-root>/gems/railties-5.0.2/lib/rails/railtie.rb:216:in `config'
from <gem-root>/gems/railties-5.0.2/lib/rails/railtie.rb:122:in `config'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/i18n_railtie.rb:7:in `<class:Railtie>'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/i18n_railtie.rb:6:in `<module:I18n>'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/i18n_railtie.rb:5:in `<top (required)>'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/railtie.rb:2:in `require'
from <gem-root>/gems/activesupport-5.0.2/lib/active_support/railtie.rb:2:in `<top (required)>'
from <gem-root>/gems/railties-5.0.2/lib/rails.rb:15:in `require'
from <gem-root>/gems/railties-5.0.2/lib/rails.rb:15:in `<top (required)>'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands/server.rb:4:in `require'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands/server.rb:4:in `<top (required)>'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:138:in `require'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:138:in `require_command!'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:83:in `server'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from <gem-root>/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
from <rails-root>/bin/rails:9:in `require'
from <rails-root>/bin/rails:9:in `<top (required)>'
from <gem-root>/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
from <gem-root>/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
from <gem-root>/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
from <gem-root>/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
from <gem-root>/gems/spring-2.0.1/bin/spring:49:in `<top (required)>'
from <gem-root>/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
from <gem-root>/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `<top (required)>'
from /Users/rpatterson/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/rpatterson/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from <rails-root>/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'

关于ruby-on-rails - rails 服务器抛出 `require' : cannot load such file -- bigdecimal/util (LoadError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16654665/

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