简体   繁体   English

将 escpos Ruby gem 与 rails 应用程序一起使用会出现错误

[英]Using escpos Ruby gem with rails application gives out error

I'm trying to run following library inside a rails application and when I try to run their sample code inside my controller, I'm getting the following error.我试图在 rails 应用程序中运行以下库,当我尝试在我的 controller 中运行他们的示例代码时,我收到以下错误。

在此处输入图像描述

My sample code is as following,我的示例代码如下,

      @printer = Escpos::Printer.new
      @printer << "Some text"
      @printer << Escpos::Helpers.bold "help"
      @printer.cut!

This is the library I'm trying to use.这是我正在尝试使用的库。

https://github.com/escpos/escpos https://github.com/escpos/escpos

Can you try this?你能试试这个吗?

@printer << Escpos::Helpers.bold('help')

Should work!应该管用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM