English 中文(简体)
为什么我获得“未界定的方法`开端'?
原标题:Why am I getting "undefined method `start_with? "?

我有一个铁路项目,我已经更新到最新版本的Ruby和铁路。 当我管理<代码>rake 资产: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)

我有最新版本的<代码>boot-editable。 怎样才能做到这一点?

问题回答

bootstrap-editable is 10 years old, it s time to let it go or fork and fix it. Specifically, this part is the issue:
https://github.com/bootstrap-ruby/bootstrap-editable-rails/blob/master/lib/bootstrap-editable-rails.rb#L12

app.config.assets.precompile << %r(bootstrap-editable/.*.(?:png|gif)$)

您可以找到预设资产,代之以<条码>。

......如果你以前使用过规范或代相传的价值观,那么他们就与《标准》4一道赢得了一定的工作,如果你尝试你,就会产生一种例外,例如<条码>NoMethodError:没有界定的方法开始使用?

https://github.com/rails/sprockets/blob/main/UPGRADING.md#manifestjs





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签