- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
至少有时当我导航到一个页面时,我会收到此异常
undefined method `force_encoding' for #<String:0x898922c>
最佳答案
很可能是 Mechanize 中的 1.8 不兼容错误:
http://github.com/eric/mechanize/commit/7fd877c60cbb3855652c390c980df1dedfaed820
关于Ruby Mechanize 获取 force_encoding 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1224204/
当我们安装 Rails 时,我们得到这个 rails “可执行文件”: #!/usr/bin/env ruby # # This file was generated by RubyGems. # #
至少有时当我导航到一个页面时,我会收到此异常 undefined method `force_encoding' for # 其他人见过这个问题吗? 最佳答案 很可能是 Mechanize 中的 1.
我有一个从某种输入中读取的字符串。 据我所知,它是 UTF8。好的: string.force_encoding("utf8") 但是如果这个字符串中的字节实际上不是合法的 UTF8,我想现在就知道并
我真的不明白 Ruby 中 String 类的 #encode 和 #force_encoding 之间的区别。我知道 "kam".force_encoding("UTF-8") 会强制 "kam"
是否有在 Ruby 1.8.7(或 Rails 2.x)中使用 String.force_encoding() 的解决方案,以便它像在 Ruby 1.9 中一样工作?我读了一些关于 require a
我是一名优秀的程序员,十分优秀!