我想使用byebug来调试我的应用程序,但应用程序永远不会停止,尽管我已经放入byebug我的代码中.这是我的Gemfile.
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', '~> 5.0.0'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
end
Run Code Online (Sandbox Code Playgroud)
我放入byebug了我的一个控制器.
def edit
byebug
present Ingredient::Update
end
Run Code Online (Sandbox Code Playgroud)
我已经在我的所有地方提出了我的要求development.rb.我已经重启服务器几次了.
config.consider_all_requests_local = true
Run Code Online (Sandbox Code Playgroud)
下面是示例堆栈跟踪,byebug仅打印第一个跟踪,然后应用程序继续执行下一行.
web_1 | [43, 52] in /recipe/app/controllers/ingredients_controller.rb
web_1 | 43: def update
web_1 | 44: run …Run Code Online (Sandbox Code Playgroud) 所以,我有这样的情况.
class A(object):
def foo(self, call_from):
print "foo from A, call from %s" % call_from
class B(object):
def foo(self, call_from):
print "foo from B, call from %s" % call_from
class C(object):
def foo(self, call_from):
print "foo from C, call from %s" % call_from
class D(A, B, C):
def foo(self):
print "foo from D"
super(D, self).foo("D")
d = D()
d.foo()
Run Code Online (Sandbox Code Playgroud)
代码的结果是
foo from D
foo from A, call from D
Run Code Online (Sandbox Code Playgroud)
我想调用所有父方法,在这种情况下,foo方法,从D类中不使用超类在父类A.我只是想从D班上打电话给超级.的A,B和 …
因此,我的一个项目有一个SMTP服务器,该服务器已配置为在没有任何形式的身份验证的情况下使用.这是我的SMTP设置config/environments/production.rb.
config.action_mailer.asset_host = 'http://example.com'
config.action_mailer.default_url_options = { host: 'example.com' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
address: 'mail.example.com',
port: 587,
domain: 'info.example.com',
user_name: 'no-reply@example.com',
password: '',
openssl_verify_mode: 'none',
authentication: nil,
tls: false,
enable_starttls_auto: false
}
Run Code Online (Sandbox Code Playgroud)
我虽然authentication需要设置模式nil但是,当我尝试发送电子邮件时,它给了我这个错误.
2.0.0-p481 :001 > CustomerMailer.test.deliver
Net::SMTPAuthenticationError: 503 5.5.1 Error: authentication not enabled
Run Code Online (Sandbox Code Playgroud)
伙计们?