Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix errors with unmatched encoding.

  • Loading branch information...
commit 5db9781aea79b38f38ff6bd89836c86d63e8ed4b 1 parent 094b602
@kentaro authored
Showing with 6 additions and 3 deletions.
  1. +4 −1 app/models/deployment.rb
  2. +2 −2 lib/webistrano/logger.rb
View
5 app/models/deployment.rb
@@ -121,7 +121,10 @@ def deploy_in_background!
unless Rails.env.test?
Rails.logger.info "Calling other ruby process in the background in order to deploy deployment #{self.id} (stage #{self.stage.id}/#{self.stage.name})"
- system("sh -c \"cd #{Rails.root} && rails runner -e #{Rails.env} ' deployment = Deployment.find(#{self.id}); deployment.prompt_config = #{self.prompt_config.inspect.gsub('"', '\"')} ; Webistrano::Deployer.new(deployment).invoke_task! ' >> #{Rails.root}/log/#{Rails.env}.log 2>&1\" &")
+ system <<"EOS"
+sh -c "cd #{Rails.root} && rails runner -e #{Rails.env} 'deployment = Deployment.find(#{self.id}); deployment.prompt_config = #{self.prompt_config.inspect.gsub('"', '\"')} ; Webistrano::Deployer.new(deployment).invoke_task! ' >> #{Rails.root}/log/#{Rails.env}.log 2>&1" &
+}
+EOS
end
end
View
4 lib/webistrano/logger.rb
@@ -57,7 +57,7 @@ def close
def write_msg(msg)
@deployment.reload
@deployment.transaction do
- @deployment.log = (@deployment.log || '') + msg
+ @deployment.log = (@deployment.log || '') + msg.force_encoding('UTF-8')
@deployment.save!
end
end
@@ -80,4 +80,4 @@ def hide_passwords(message)
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.