腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
2
回答
Action Mailer '
undefined
method
`[]‘for
nil
:
NilClass
’
ruby-on-rails
、
ruby
、
actionmailer
我在尝试发送电子邮件时遇到错误。不知道为什么,但下面是我的控制器和邮件程序中的代码 下面是我的控制器代码 class Invitation::InvitesController < ApplicationController @patient = Patient.find_by_id(invite_params[:invitable_id]) InviteMailer.provider_invite(recipient).deliver_now
浏览 18
提问于2019-01-07
得票数 0
1
回答
字符串操作在Sinatra / ERB中不起作用
ruby
、
string
、
sinatra
、
erb
caption_str.truncate(20) %>但是仍然会收到类似的错误消息:
undefined
method
`[]' for
nil
:
NilClass
NoMethodError at /392471267473009
undefined
method
`truncate' for
ni
浏览 0
提问于2012-08-28
得票数 0
回答已采纳
2
回答
修复"
undefined
method
'xyz‘for
nil
:
nilClass
“错误
ruby-on-rails
、
ruby
:rpm_comments)end
undefined
method
'name' for
nil
:
NilClass
我知道这可能与@page_title变量有关,但是我如何解决这个问题呢?
浏览 1
提问于2012-12-20
得票数 2
回答已采纳
1
回答
这里的ex.class应该等于什么?
ruby
、
exception
、
methods
、
exception-handling
、
error-handling
def test_you_dont_get_null_pointer_errors_when_calling_methods_on_
nil
nil
.some_
method
_
nil
_doesnt_know_about # What exception has
浏览 0
提问于2012-03-11
得票数 0
3
回答
如何捕获"
undefined
method
`[]‘for
nil
:
NilClass
“错误?
ruby-on-rails
、
ruby
/
nil
?/exists?相关行如下所示:
undefined
method
`[]' for
nil
:
NilClass
我试过用"has_key“"
nil
?”“空的?”“
浏览 0
提问于2012-07-16
得票数 9
回答已采纳
2
回答
如何修复"
undefined
method
` `errors‘for
nil
:
NilClass
"?
ruby-on-rails
in Orders#new <
浏览 0
提问于2018-09-19
得票数 0
2
回答
如何禁用"
undefined
method
for
nil
:
NilClass
“错误?
ruby-on-rails
我的控制器和视图中有一堆像current_user.articles或current_user.name这样的代码。显然,当没有当前用户时,这会导致错误。我可以一直写像current_user && current_user.articles这样的东西,但那是重复的。
浏览 132
提问于2019-10-28
得票数 0
回答已采纳
2
回答
在添加数字时,如何将零值视为零?
ruby
、
monkeypatching
我有这样一种方法: hsh[:x] + hsh[:y] + hsh[:z]这需要这样的东西: {:x => 5, :y =>
nil
浏览 1
提问于2016-02-06
得票数 2
回答已采纳
1
回答
如果日期等于今天或将来的日期,则从postgres呈现事件
ruby-on-rails
、
ruby
、
postgresql
、
activerecord
if @events.start_date >= Date.today end 我一直在用'if‘语句在行中获得"
undefined
`start_date’for
nil
:
NilClass
“的错误。
浏览 4
提问于2019-11-21
得票数 1
回答已采纳
1
回答
Ruby错误:用于
nil
的未定义方法“`casecmp”:
NilClass
ruby-on-rails
、
ruby
: StringCompleted 500 Internal Server Error in 66ms 是什么引起的?
浏览 4
提问于2014-11-06
得票数 1
回答已采纳
1
回答
错误简单登录"
undefined
method
‘`key?’for
nil
:
NilClass
“
ruby-on-rails
、
ruby-on-rails-3
、
ruby-on-rails-3.1
对于
nil
:
NilClass
if request.post?
浏览 0
提问于2012-07-26
得票数 0
2
回答
Nokogiri:遇到错误"
undefined
method
‘text’for
nil
:
NilClass
“
ruby
、
nokogiri
我是程序员的新手,所以请原谅我的新鲜事。所以我用Nokogiri抓取了警方的犯罪记录。代码如下:require 'nokogiri'doc = Nokogiri::HTML(open(url))doc.css(".brief").each do |bri
浏览 0
提问于2011-08-23
得票数 5
回答已采纳
1
回答
Rails、设计、角色模型和CanCanCan -定义能力
ruby-on-rails
、
cancan
、
user-roles
、
cancancan
当我试着像上面所说的那样,我会发现一个错误,上面写着:它指的是“我的项目展示”视图中的一行,它说: <span class
浏览 1
提问于2015-08-31
得票数 0
回答已采纳
2
回答
Ruby:为什么我在使用安全导航操作符时不能得到
nil
ruby
据我所知,它会在一个对象上调用一个方法,但是如果这个对象不存在,我们就会得到
nil
。2.3.1 :001 > 123&.to_s但是当我尝试在一个不存在的对象上调用一个方法时,我得到了:NameError:
undefined
local variable or
method
`foo' for main:Object Did you mean?
浏览 0
提问于2016-10-16
得票数 1
3
回答
为什么我得到"
undefined
method
'+‘for
nil
:
NilClass
"?
ruby
+不是运算符吗?为什么不给它下定义?Class Song def initialize(name, artist, duration) @artist = artist @plays = 0 attr_reader :name, :artist, :duration, def play @@plays +
浏览 1
提问于2010-08-21
得票数 2
1
回答
在一个非常定义的实例变量上未定义的方法?Rails
ruby-on-rails
、
mongodb
、
jquery-mobile
我得到了这个典型的错误: 34:
浏览 0
提问于2013-07-12
得票数 0
回答已采纳
3
回答
rails上的ruby将小数和整数相乘
ruby-on-rails
、
ruby
precision => 7, :scale => 2invoice.quantity * invoice.unit_price
undefined
method
`*' for
nil
:
NilClass
我是否必须首先转换这些值,或者我是否遗漏了一些微不足道的东西?
浏览 0
提问于2012-10-17
得票数 1
回答已采纳
2
回答
安装java Cookbook时收到"
undefined
method
`[]“for
nil
:
NilClass
”
java
、
ruby
、
maven
、
chef-infra
、
vagrant
但每次我收到这个错误: Cookbook Trace:
浏览 0
提问于2013-07-22
得票数 2
回答已采纳
1
回答
RSpec模拟失败,并显示"
undefined
method
‘-’for
nil
:
NilClass
“
ruby
、
unit-testing
、
rspec
、
rspec2
DecreaseCapacity#apply should decrease the player's capacity by one
undefined
method
`-' for
nil
:
NilClass
# .为什么player.capacity -= 1尝试在
nil
上调用-
浏览 0
提问于2010-12-22
得票数 2
回答已采纳
1
回答
如何在ruby中调用成员变量的成员函数?
ruby
我得到了错误"
undefined
method
'new_round' for
nil
:
NilClass
",但对发生的事情一无所知。希望有人能帮帮我。非常感谢。
浏览 2
提问于2013-03-16
得票数 1
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
GitLab 发布 10.7.3 版本,修复 10.7 中众多的错误问题
Vue3.0 源码解读-响应式系统之collectionHandlers
架构整洁之道的实用指南
你应该了解的25个JS技巧
ActiveSupport:Concern 使用及源码解析
热门
标签
更多标签
云服务器
ICP备案
实时音视频
即时通信 IM
对象存储
活动推荐
运营活动
广告
关闭
领券