我在RubyMotion中使用Redpotion gem(推广)运行rake时出现了以下错误。
/usr/local/Cellar/ruby/2.7.1_2/lib/ruby/gems/2.7.0/gems/ProMotion-3.0.0/lib/ProMotion.rb:9: warning: deprecated Object#=~ is called on Array; it always returns nil
/usr/local/Cellar/ruby/2.7.1_2/lib/ruby/gems/2.7.0/gems/ProMotion-3.0.0/lib/ProMotion.rb:9: warning: deprecated Object#=~ is called on Array; it always returns nil
rake aborted!
NoMethodError: undefined method `new' for BigDecimal:Class
/Users/username/Documents/ruby-projects/ipu/my_new_app/Rakefile:7:in `<top (required)>'
(See full trace by running task with --trace)
Rakefile:7 Bundler.require
usrlocalCellarruby2.7.1_2librubygems2.7.0gemsProMotion-3.0.0libProMotion.rb:9 insert_point = app.files.find_index { ^(?:)?app/ } usrlocalCellarruby2.7.1_2librubygems2.7.0gemsProMotion-3.0.0libProMotion.rb:9: warning: ...
这个宝石很可能是用2.7之前的系统Ruby构建的(Mojave是2.3.7,Catalina是2.6.3)。 由于Ruby 2.7的BigDecimal类没有一个
方法
),你可以使用系统Ruby,如果使用版本管理器,可以使用与之匹配的版本。