Answer the question
In order to leave comments, you need to log in
Gems devise and backup don't understand Cyrillic?
The problem started after I tied the site address (it is Cyrillic) to my ip. Problems arise when sending mail when performing a backup and when registering a user (well, and other actions in which devise sends a letter). I did not fully understand the nature of the error, but there is a strong suspicion that this is due to my domain name. Other letters which I send from controllers are sent normally. Here's the error I'm getting:
An ActionView::Template::Error occurred in background at 2016-05-22 16:43:50 +0300 :
incompatible character encodings: UTF-8 and ASCII-8BIT
/var/www/4e4o/releases/20160522085506/app/views/devise/mailer/confirmation_instructions.html.haml:2:in `_app_views_devise_mailer_confirmation_instructions_html_haml___1275780348649185615_74784040'
-------------------------------
Backtrace:
-------------------------------
/var/www/4e4o/releases/20160522085506/app/views/devise/mailer/confirmation_instructions.html.haml:2:in `_app_views_devise_mailer_confirmation_instructions_html_haml___1275780348649185615_74784040'
/var/www/4e4o/shared/bundle/ruby/2.1.0/gems/actionview-4.2.5/lib/action_view/template.rb:145:in `block in render'
/var/www/4e4o/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.5/lib/active_support/notifications.rb:166:in `instrument'
/var/www/4e4o/shared/bundle/ruby/2.1.0/gems/actionview-4.2.5/lib/action_view/template.rb:333:in `instrument'
/var/www/4e4o/shared/bundle/ruby/2.1.0/gems/actionview-4.2.5/lib/action_view/template.rb:143:in `render'
/var/www/4e4o/shared/bundle/ruby/2.1.0/gems/actionview-4.2.5/lib/action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
/var/www/4e4o/shared/bundle/ruby/2.1.0/gems/actionview-4.2.5/lib/action_view/renderer/abstract_renderer.rb:39:in `block in instrument'
/var/www/4e4o/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.5/lib/active_support/notifications.rb:164:in `block in instrument'
и т.д.
config.encoding = 'utf-8'
config.action_mailer.default :charset => 'utf-8'
# Load the Rails application.
require File.expand_path('../application', __FILE__)
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
# Initialize the Rails application.
Rails.application.initialize!
notify_by Mail do |mail|
mail.on_success = true
mail.on_failure = true
mail.from = smtp_config['default_mail']
mail.to = smtp_config['default_mail']
mail.address = smtp_config['smtp_server']
mail.port = smtp_config['smtp_port']
mail.domain = <b>вот здесь</b>
mail.user_name = smtp_config['smtp_user']
mail.password = smtp_config['smtp_password']
mail.authentication = smtp_config['smtp_authentication']
mail.encryption = :starttls
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question