Ruby on rails NoMethodError-未定义的方法'present'和#x27;对于零:零类:
免责声明-我是一个没有Ruby经验的Java开发人员 我正在尝试更新一个遗留公司应用程序的Ruby版本,这样我就可以利用一个更好的遥测客户端库,它与我们的旧Ruby版本不兼容。在更新Gemfile以消除一些限制,并将Ruby版本从2.3.1升级到2.7.3,Bundler版本从1.7.13升级到2.2.17之后。在此之后,我们的网站将返回错误,即无法识别以前识别的“blank”和“present”方法。我的理解是,这些都是Rails扩展的一部分,而不是原生Ruby,但是如果我们在这里没有这个框架,那么这些框架以前是如何工作的呢 我甚至不确定Ruby用户在这些情况下需要什么信息,但我没有修改任何源代码,因此Gemfile.lock文件似乎是合适的。对不起,我在这里的无知程度,已经挣扎了一天左右,谷歌还没有让我渡过难关。希望这对Ruby社区的人来说是一件容易的事 旧的Gemfile.lock:Ruby on rails NoMethodError-未定义的方法'present'和#x27;对于零:零类:,ruby-on-rails,ruby,Ruby On Rails,Ruby,免责声明-我是一个没有Ruby经验的Java开发人员 我正在尝试更新一个遗留公司应用程序的Ruby版本,这样我就可以利用一个更好的遥测客户端库,它与我们的旧Ruby版本不兼容。在更新Gemfile以消除一些限制,并将Ruby版本从2.3.1升级到2.7.3,Bundler版本从1.7.13升级到2.2.17之后。在此之后,我们的网站将返回错误,即无法识别以前识别的“blank”和“present”方法。我的理解是,这些都是Rails扩展的一部分,而不是原生Ruby,但是如果我们在这里没有这个框架
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.5)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
backports (3.16.0)
bcrypt (3.1.10)
colorize (0.7.7)
erubis (2.7.0)
ethon (0.9.1)
ffi (>= 1.3.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.10)
hashie (3.4.3)
i18n (0.7.0)
json (1.8.3)
jwt (1.5.4)
listen (3.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
macaddr (1.7.1)
systemu (~> 2.6.2)
mail (2.6.3)
mime-types (>= 1.16, < 3)
metaclass (0.0.4)
mime-types (2.99)
mini_portile2 (2.0.0)
minitest (5.2.3)
mocha (1.1.0)
metaclass (~> 0.0.1)
multi_json (1.14.1)
multipart-post (2.0.0)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
nokogiri (1.6.7.1)
mini_portile2 (~> 2.0.0.rc2)
omniauth (1.3.1)
hashie (>= 1.2, < 4)
rack (>= 1.0, < 3)
omniauth-saml (1.4.1)
omniauth (~> 1.1)
ruby-saml (~> 1.0.0)
pg (0.18.4)
pony (1.11)
mail (>= 2.0)
power_assert (0.2.6)
puma (2.15.3)
rack (2.1.0)
rack-mobile-detect (0.4.0)
rack
rack-protection (2.0.8.1)
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (10.4.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
redis (3.2.2)
rerun (0.11.0)
listen (~> 3.0)
ruby-saml (1.0.0)
nokogiri (>= 1.5.10)
uuid (~> 2.3)
ruby-saml-idp (0.3.2)
uuid
ruby2_keywords (0.0.2)
sequel (4.29.0)
sequel_pg (1.6.13)
pg (>= 0.8.0)
sequel (>= 3.39.0)
shoulda (3.5.0)
shoulda-context (~> 1.0, >= 1.0.1)
shoulda-matchers (>= 1.4.1, < 3.0)
shoulda-context (1.2.1)
shoulda-matchers (2.8.0)
activesupport (>= 3.0.0)
sinatra (2.0.8.1)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.8.1)
tilt (~> 2.0)
sinatra-contrib (2.0.8.1)
backports (>= 2.8.2)
multi_json
mustermann (~> 1.0)
rack-protection (= 2.0.8.1)
sinatra (= 2.0.8.1)
tilt (~> 2.0)
systemu (2.6.5)
test-unit (3.1.5)
power_assert
thread_safe (0.3.5)
tilt (2.0.10)
typhoeus (1.1.0)
ethon (>= 0.9.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uuid (2.3.8)
macaddr (~> 1.0)
PLATFORMS
ruby
DEPENDENCIES
bcrypt
colorize
erubis
faraday
jwt
minitest (~> 5.2.0)
mocha
omniauth-saml
pg
pony
puma (= 2.15.3)
rack (= 2.1.0)
rack-mobile-detect
rack-test
rake
redis
rerun
ruby-saml
ruby-saml-idp
sequel
sequel_pg
shoulda
sinatra (= 2.0.8.1)
sinatra-contrib (= 2.0.8.1)
test-unit
typhoeus
BUNDLED WITH
1.17.3
GEM
remote: https://rubygems.org/
specs:
activesupport (6.1.3.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
bcrypt (3.1.16)
colorize (0.8.1)
concurrent-ruby (1.1.8)
erubis (2.7.0)
ethon (0.14.0)
ffi (>= 1.15.0)
faraday (1.4.1)
faraday-excon (~> 1.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
multipart-post (>= 1.2, < 3)
ruby2_keywords (>= 0.0.4)
faraday-excon (1.1.0)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.1.0)
ffi (1.15.0)
hashie (4.1.0)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
jwt (2.2.3)
listen (3.5.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mail (2.7.1)
mini_mime (>= 0.1.1)
mini_mime (1.1.0)
mini_portile2 (2.5.1)
minitest (5.14.4)
mocha (1.12.0)
multi_json (1.15.0)
multipart-post (2.1.1)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
newrelic_rpm (7.0.0)
nio4r (2.5.7)
nokogiri (1.11.5)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
omniauth (2.0.4)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
rack-protection
omniauth-saml (2.0.0)
omniauth (~> 2.0)
ruby-saml (~> 1.9)
pg (1.2.3)
pony (1.13.1)
mail (>= 2.0)
power_assert (2.0.0)
puma (5.3.2)
nio4r (~> 2.0)
racc (1.5.2)
rack (2.2.3)
rack-mobile-detect (0.4.0)
rack
rack-protection (2.1.0)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rake (13.0.3)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (4.2.5)
rerun (0.13.1)
listen (~> 3.0)
rexml (3.2.5)
ruby-saml (1.12.2)
nokogiri (>= 1.10.5)
rexml
ruby-saml-idp (0.3.5)
ruby2_keywords (0.0.4)
sequel (5.44.0)
sequel_pg (1.14.0)
pg (>= 0.18.0, != 1.2.0)
sequel (>= 4.38.0)
shoulda (4.0.0)
shoulda-context (~> 2.0)
shoulda-matchers (~> 4.0)
shoulda-context (2.0.0)
shoulda-matchers (4.5.1)
activesupport (>= 4.2.0)
sinatra (2.1.0)
mustermann (~> 1.0)
rack (~> 2.2)
rack-protection (= 2.1.0)
tilt (~> 2.0)
sinatra-contrib (2.1.0)
multi_json
mustermann (~> 1.0)
rack-protection (= 2.1.0)
sinatra (= 2.1.0)
tilt (~> 2.0)
test-unit (3.4.1)
power_assert
tilt (2.0.10)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
zeitwerk (2.4.2)
PLATFORMS
ruby
DEPENDENCIES
bcrypt
colorize
erubis
faraday
jwt
minitest
mocha
newrelic_rpm
omniauth-saml
pg
pony
puma
rack
rack-mobile-detect
rack-test
rake
redis
rerun
ruby-saml
ruby-saml-idp
sequel
sequel_pg
shoulda
sinatra
sinatra-contrib
test-unit
typhoeus
BUNDLED WITH
2.1.4
GEM
远程:https://rubygems.org/
规格:
activesupport(4.2.5)
i18n(~>0.7)
json(~>1.7,>=1.7.7)
小型试验(~>5.1)
螺纹安全(~>0.3,>=0.3.4)
tzinfo(~>1.1)
后端口(3.16.0)
bcrypt(3.1.10)
着色(0.7.7)
erubis(2.7.0)
乙二醇(0.9.1)
外国金融机构(>=1.3.0)
法拉第(0.9.2)
多部分post(>=1.2,<3)
外国金融机构(1.9.10)
哈西(3.4.3)
i18n(0.7.0)
json(1.8.3)
jwt(1.5.4)
听(3.0.5)
rb fsevent(>=0.9.3)
rb inotify(>=0.9)
macaddr(1.7.1)
systemu(~>2.6.2)
邮件(2.6.3)
mime类型(>=1.16,<3)
元类(0.0.4)
mime类型(2.99)
迷你端口2(2.0.0)
小型试验(5.2.3)
摩卡咖啡(1.1.0)
元类(~>0.0.1)
多线程json(1.14.1)
多部分post(2.0.0)
穆斯特曼(1.1.1)
ruby2_关键字(~>0.0.1)
nokogiri(1.6.7.1)
迷你端口2(~>2.0.0.rc2)
omniauth(1.3.1)
hashie(>=1.2,<4)
机架(>=1.0,<3)
omniauth saml(1.4.1)
omniauth(~>1.1)
ruby saml(~>1.0.0)
pg(0.18.4)
小马(1.11)
邮件(>=2.0)
电源断言(0.2.6)
美洲狮(2.15.3)
机架(2.1.0)
机架移动检测(0.4.0)
支架
机架保护(2.0.8.1)
支架
机架测试(0.6.3)
机架(>=1.0)
耙(10.4.2)
rb fsevent(0.9.7)
rb inotify(0.9.5)
外国金融机构(>=0.5.0)
redis(3.2.2)
重新运行(0.11.0)
收听(~>3.0)
ruby saml(1.0.0)
nokogiri(>=1.5.10)
uuid(~>2.3)
ruby saml idp(0.3.2)
uuid
ruby2_关键词(0.0.2)
续集(4.29.0)
续集第页(1.6.13)
pg(>=0.8.0)
续集(>=3.39.0)
shoulda(3.5.0)
shoulda上下文(~>1.0,>=1.0.1)
shoulda匹配器(>=1.4.1,<3.0)
shoulda上下文(1.2.1)
shoulda matchers(2.8.0)
activesupport(>=3.0.0)
西纳特拉(2.0.8.1)
马斯特曼(~>1.0)
机架(~>2.0)
机架保护(=2.0.8.1)
倾斜(~>2.0)
sinatra contrib(2.0.8.1)
后端口(>=2.8.2)
多线程json
马斯特曼(~>1.0)
机架保护(=2.0.8.1)
西纳特拉(=2.0.8.1)
倾斜(~>2.0)
systemu(2.6.5)
试验装置(3.1.5)
权力主张
螺纹安全(0.3.5)
倾斜(2.0.10)
台风(1.1.0)
乙醇(>=0.9.0)
tzinfo(1.2.2)
线程安全(~>0.1)
uuid(2.3.8)
macaddr(~>1.0)
平台
红宝石
依赖关系
bcrypt
着色
埃鲁比斯
法拉第
jwt
小型测试(~>5.2.0)
摩卡
omniauth saml
pg
小马
美洲狮(=2.15.3)
机架(=2.1.0)
机架移动检测
机架试验
耙
雷迪斯
重播
ruby saml
ruby-saml-idp
续集
续集
应该
西纳特拉(=2.0.8.1)
sinatra contrib(=2.0.8.1)
测试单元
伤寒
捆绑
1.17.3
新建Gemfile.lock:
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.5)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
backports (3.16.0)
bcrypt (3.1.10)
colorize (0.7.7)
erubis (2.7.0)
ethon (0.9.1)
ffi (>= 1.3.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.10)
hashie (3.4.3)
i18n (0.7.0)
json (1.8.3)
jwt (1.5.4)
listen (3.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
macaddr (1.7.1)
systemu (~> 2.6.2)
mail (2.6.3)
mime-types (>= 1.16, < 3)
metaclass (0.0.4)
mime-types (2.99)
mini_portile2 (2.0.0)
minitest (5.2.3)
mocha (1.1.0)
metaclass (~> 0.0.1)
multi_json (1.14.1)
multipart-post (2.0.0)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
nokogiri (1.6.7.1)
mini_portile2 (~> 2.0.0.rc2)
omniauth (1.3.1)
hashie (>= 1.2, < 4)
rack (>= 1.0, < 3)
omniauth-saml (1.4.1)
omniauth (~> 1.1)
ruby-saml (~> 1.0.0)
pg (0.18.4)
pony (1.11)
mail (>= 2.0)
power_assert (0.2.6)
puma (2.15.3)
rack (2.1.0)
rack-mobile-detect (0.4.0)
rack
rack-protection (2.0.8.1)
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (10.4.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
redis (3.2.2)
rerun (0.11.0)
listen (~> 3.0)
ruby-saml (1.0.0)
nokogiri (>= 1.5.10)
uuid (~> 2.3)
ruby-saml-idp (0.3.2)
uuid
ruby2_keywords (0.0.2)
sequel (4.29.0)
sequel_pg (1.6.13)
pg (>= 0.8.0)
sequel (>= 3.39.0)
shoulda (3.5.0)
shoulda-context (~> 1.0, >= 1.0.1)
shoulda-matchers (>= 1.4.1, < 3.0)
shoulda-context (1.2.1)
shoulda-matchers (2.8.0)
activesupport (>= 3.0.0)
sinatra (2.0.8.1)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.8.1)
tilt (~> 2.0)
sinatra-contrib (2.0.8.1)
backports (>= 2.8.2)
multi_json
mustermann (~> 1.0)
rack-protection (= 2.0.8.1)
sinatra (= 2.0.8.1)
tilt (~> 2.0)
systemu (2.6.5)
test-unit (3.1.5)
power_assert
thread_safe (0.3.5)
tilt (2.0.10)
typhoeus (1.1.0)
ethon (>= 0.9.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uuid (2.3.8)
macaddr (~> 1.0)
PLATFORMS
ruby
DEPENDENCIES
bcrypt
colorize
erubis
faraday
jwt
minitest (~> 5.2.0)
mocha
omniauth-saml
pg
pony
puma (= 2.15.3)
rack (= 2.1.0)
rack-mobile-detect
rack-test
rake
redis
rerun
ruby-saml
ruby-saml-idp
sequel
sequel_pg
shoulda
sinatra (= 2.0.8.1)
sinatra-contrib (= 2.0.8.1)
test-unit
typhoeus
BUNDLED WITH
1.17.3
GEM
remote: https://rubygems.org/
specs:
activesupport (6.1.3.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
bcrypt (3.1.16)
colorize (0.8.1)
concurrent-ruby (1.1.8)
erubis (2.7.0)
ethon (0.14.0)
ffi (>= 1.15.0)
faraday (1.4.1)
faraday-excon (~> 1.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
multipart-post (>= 1.2, < 3)
ruby2_keywords (>= 0.0.4)
faraday-excon (1.1.0)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.1.0)
ffi (1.15.0)
hashie (4.1.0)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
jwt (2.2.3)
listen (3.5.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mail (2.7.1)
mini_mime (>= 0.1.1)
mini_mime (1.1.0)
mini_portile2 (2.5.1)
minitest (5.14.4)
mocha (1.12.0)
multi_json (1.15.0)
multipart-post (2.1.1)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
newrelic_rpm (7.0.0)
nio4r (2.5.7)
nokogiri (1.11.5)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
omniauth (2.0.4)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
rack-protection
omniauth-saml (2.0.0)
omniauth (~> 2.0)
ruby-saml (~> 1.9)
pg (1.2.3)
pony (1.13.1)
mail (>= 2.0)
power_assert (2.0.0)
puma (5.3.2)
nio4r (~> 2.0)
racc (1.5.2)
rack (2.2.3)
rack-mobile-detect (0.4.0)
rack
rack-protection (2.1.0)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rake (13.0.3)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (4.2.5)
rerun (0.13.1)
listen (~> 3.0)
rexml (3.2.5)
ruby-saml (1.12.2)
nokogiri (>= 1.10.5)
rexml
ruby-saml-idp (0.3.5)
ruby2_keywords (0.0.4)
sequel (5.44.0)
sequel_pg (1.14.0)
pg (>= 0.18.0, != 1.2.0)
sequel (>= 4.38.0)
shoulda (4.0.0)
shoulda-context (~> 2.0)
shoulda-matchers (~> 4.0)
shoulda-context (2.0.0)
shoulda-matchers (4.5.1)
activesupport (>= 4.2.0)
sinatra (2.1.0)
mustermann (~> 1.0)
rack (~> 2.2)
rack-protection (= 2.1.0)
tilt (~> 2.0)
sinatra-contrib (2.1.0)
multi_json
mustermann (~> 1.0)
rack-protection (= 2.1.0)
sinatra (= 2.1.0)
tilt (~> 2.0)
test-unit (3.4.1)
power_assert
tilt (2.0.10)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
zeitwerk (2.4.2)
PLATFORMS
ruby
DEPENDENCIES
bcrypt
colorize
erubis
faraday
jwt
minitest
mocha
newrelic_rpm
omniauth-saml
pg
pony
puma
rack
rack-mobile-detect
rack-test
rake
redis
rerun
ruby-saml
ruby-saml-idp
sequel
sequel_pg
shoulda
sinatra
sinatra-contrib
test-unit
typhoeus
BUNDLED WITH
2.1.4
GEM
远程:https://rubygems.org/
规格:
activesupport(6.1.3.2)
并发ruby(~>1.0,>=1.0.2)
i18n(>=1.6,<2)
小型试验(>=5.1)
tzinfo(~>2.0)
zeitwerk(~>2.3)
bcrypt(3.1.16)
着色(0.8.1)
并发ruby(1.1.8)
erubis(2.7.0)
乙二醇(0.14.0)
外国金融机构(>=1.15.0)
法拉第(1.4.1)
法拉第excon(~>1.1)
法拉第网络http(~>1.0)
法拉第网络http持久化(~>1.1)
多部分post(>=1.2,<3)
ruby2_关键字(>=0.0.4)
法拉第执行官(1.1.0)
法拉第网http(1.0.1)
法拉第网络http持久化(1.1.0)
外国金融机构(1.15.0)
哈西(4.1.0)
i18n(1.8.10)
并发ruby(~>1.0)
jwt(2.2.3)
听(3.5.1)
rb fsevent(~>0.10,>=0.10.3)
rb inotify(~>0.9,>=0.9.10)
邮件(2.7.1)
迷你mime(>=0.1.1)
迷你mime(1.1.0)
迷你端口2(2.5.1)
小型试验(5.14.4)
摩卡咖啡(1.12.0)
multi_json(1.15.0)
多部分post(2.1.1)
穆斯特曼(1.1.1)
ruby2_关键字(~>0.0.1)
newrelic_rpm(7.0.0)
nio4r(2.5.7)
nokogiri(1.11.5)
迷你端口2(~>2.5.0)
racc(~>1.4)
omniauth(2.0.4)
hashie(>=3.4.6)
机架(>=1.6.2,<3)
机架保护
omniauth saml(2.0.0)
omniauth(~>2.0)
ruby saml(~>1.9)
pg(1.2.3)
小马(1.13.1)
邮件(>=2.0)
电源断言(2.0.0)
美洲狮(5.3.2)
nio4r(~>2.0)
racc(1.5.2)
机架(2.2.3)
机架移动检测(0.4.0)
支架
机架保护(2.1.0)
支架
机架测试(1.1.0)
机架(>=1.0,<3)
耙(13.0.3)
rb fsevent(0.11.0)
rb inotify(0.10.1)
外国金融机构(~>1.0)
redis(4.2.5)
重新运行(0.13.1)
收听(~>3.0)
rexml(3.2.5)
ruby saml(1.12.2)
nokogiri(>=1.10.5)
雷克斯米尔
ruby saml idp(0.3.5)
ruby2_关键词(0.0.4)
续集(5.44.0)
续集(1.14.0)
pg(>=0.18.0,!=1.2.0)
续集(>=4.38.0)
shoulda(4.0.0)
应该是上下文(~>2)