我有一个Rails项目,我一直在更新到最新版本的Ruby和Rails。当我运行rake assets:precompile
时,我得到以下错误:
NoMethodError: undefined method `start_with?' for /bootstrap-editable\/.*\.(?:png|gif)$/:Regexp (NoMethodError)
str.start_with?("file://".freeze) && parse_asset_uri(str) ? true : false
^^^^^^^^^^^^
/usr/local/bundle/gems/sprockets-4.2.1/lib/sprockets/uri_utils.rb:78:in `valid_asset_uri?'
/usr/local/bundle/gems/sprockets-4.2.1/lib/sprockets/resolve.rb:27:in `resolve'
/usr/local/bundle/gems/sprockets-4.2.1/lib/sprockets/base.rb:79:in `find_asset'
/usr/local/bundle/gems/sprockets-4.2.1/lib/sprockets/base.rb:88:in `find_all_linked_assets'
/usr/local/bundle/gems/sprockets-4.2.1/lib/sprockets/manifest.rb:125:in `each'
/usr/local/bundle/gems/sprockets-4.2.1/lib/sprockets/manifest.rb:125:in `to_a'
/usr/local/bundle/gems/sprockets-4.2.1/lib/sprockets/manifest.rb:125:in `block (2 levels) in find'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `block in synchronize'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `synchronize'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in `synchronize'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:22:in `execute'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/promise.rb:564:in `block in realize'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:352:in `run_task'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:343:in `block (3 levels) in create_worker'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:in `loop'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:in `block (2 levels) in create_worker'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:333:in `catch'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:333:in `block in create_worker'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
字符串
我有最新版本的bootstrap-editable
。还有什么可能导致此问题?
1条答案
按热度按时间bgtovc5b1#
bootstrap-editable已经10年了,是时候让它去或分叉并修复它了。具体来说,这部分是问题:
字符串
你不能用Regexp来定位预编译的资源,它在 Sprockets v4 中已经被
manifest.js
取代了。.如果您以前使用的是regexp或proc值,那么它们在Sprockets 4中根本不起作用,如果您尝试,您将得到一个看起来像
NoMethodError: undefined method 'start_with?'
的异常