-3
我试图找到所有的时间在两个阵列中使用&
比较相同的ID。当我输出数组时,可以看到有匹配,但是当我试图通过它们时,它会抛出错误no implicit conversion of nil into Array
。查找两个阵列中的所有ID号
> @fluent_user_ids
=> [2, 4, 5, 5, 6, 9, 8, 8, 7, 7, 12, 165, 166, 171, 174, 176, 177, 142, 206, 207, 208, 209, 214, 215, 216, 10, 229, 230, 232, 234, 236, 237, 238, 233, 233, 240, 241, 242, 243, 244, 250, 251, 252, 253, 254, 255, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 270, 273, 274, 276, 233]
> @nonfluent_user_ids
=> [2, 5, 11, 166, 142, 13, 206, 207, 208, 209, 214, 215, 216, 171, 10, 229, 230, 231, 232, 234, 236, 237, 238, 233, 239, 240, 241, 242, 243, 244, 250, 251, 252, 253, 254, 255, 256, 257, 258, 260, 261, 262, 264, 265, 266, 267, 268, 269, 270, 273, 274, 276]
> @nonfluent_user_ids & @fluent_users_ids
TypeError: no implicit conversion of nil into Array
from (irb):27:in `&'
为什么不能正常工作?提前致谢!
你有一个错字('@ fluent_user_ids' vs'@ fluent_users_ids')。 – orde
@CarySwoveland好吧 - 会更新。谢谢! – gwalshington