gpt4 book ai didi

ruby-on-rails - Rails 未定义方法 "to_time_preserves_timezone"

转载 作者:数据小太阳 更新时间:2023-10-29 08:11:10 25 4
gpt4 key购买 nike

有些东西坏了,现在没有一个生成器不工作,但在我上次使用 Rails 生成器后我没有任何改变。那是我在控制台中得到的

/home/sanua/ct/config/initializers/new_framework_defaults.rb:15:in `<top (required)>': undefined method `to_time_preserves_timezone=' for ActiveSupport:Module (NoMethodError)
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:268:in `load'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:268:in `block in load'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:240:in `load_dependency'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:268:in `load'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:652:in `block in load_config_initializer'
from /usr/lib/ruby/vendor_ruby/active_support/notifications.rb:166:in `instrument'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:651:in `load_config_initializer'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:615:in `each'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:615:in `block in <class:Engine>'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `instance_exec'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `run'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:55:in `block in run_initializers'
from /usr/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /usr/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /usr/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /usr/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in `each'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in `tsort_each_child'
from /usr/lib/ruby/2.3.0/tsort.rb:415:in `call'
from /usr/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /usr/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /usr/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /usr/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /usr/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /usr/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in `run_initializers'
from /usr/lib/ruby/vendor_ruby/rails/application.rb:352:in `initialize!'
from /home/sanua/ct/config/environment.rb:5:in `<top (required)>'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:274:in `require'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:274:in `block in require'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:240:in `load_dependency'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:274:in `require'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:92:in `preload'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:143:in `serve'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:131:in `block in run'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:125:in `loop'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:125:in `run'
from /usr/lib/ruby/vendor_ruby/spring/application/boot.rb:18:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'/home/sanua/ct/config/initializers/new_framework_defaults.rb:15:in `<top (required)>': undefined method `to_time_preserves_timezone=' for ActiveSupport:Module (NoMethodError)
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:268:in `load'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:268:in `block in load'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:240:in `load_dependency'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:268:in `load'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:652:in `block in load_config_initializer'
from /usr/lib/ruby/vendor_ruby/active_support/notifications.rb:166:in `instrument'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:651:in `load_config_initializer'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:615:in `each'
from /usr/lib/ruby/vendor_ruby/rails/engine.rb:615:in `block in <class:Engine>'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `instance_exec'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `run'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:55:in `block in run_initializers'
from /usr/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from /usr/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /usr/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /usr/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in `each'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:44:in `tsort_each_child'
from /usr/lib/ruby/2.3.0/tsort.rb:415:in `call'
from /usr/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /usr/lib/ruby/2.3.0/tsort.rb:347:in `each'
from /usr/lib/ruby/2.3.0/tsort.rb:347:in `call'
from /usr/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from /usr/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from /usr/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from /usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in `run_initializers'
from /usr/lib/ruby/vendor_ruby/rails/application.rb:352:in `initialize!'
from /home/sanua/ct/config/environment.rb:5:in `<top (required)>'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:274:in `require'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:274:in `block in require'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:240:in `load_dependency'
from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:274:in `require'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:92:in `preload'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:143:in `serve'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:131:in `block in run'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:125:in `loop'
from /usr/lib/ruby/vendor_ruby/spring/application.rb:125:in `run'
from /usr/lib/ruby/vendor_ruby/spring/application/boot.rb:18:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'

无论我写什么(rails generate controller, model...),我都会经常看到这条消息

最佳答案

之后您需要删除 Gemfile.lockbundle install,因为随后将获取正确的版本。

关于ruby-on-rails - Rails 未定义方法 "to_time_preserves_timezone",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43144410/

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