Я просто хочу сгенерировать QR-код, используя драгоценный камень rqrcode. Когда я создаю свой новый экземпляр rqrcode:
qr = RQRCode::QRCode.new('test')
Я получаю следующий ввод:
xxxxxxx x x x xxxxxx x xxxxxxx
x x xx xxxxx xx x x
x xxx x x x xxxx xx x xxx x
x xxx x x x x x x x xx x xxx x
x xxx x x xxx xxx x x xxx x
x x xxx x xx x x
xxxxxxx x x x x x x x x x xxxxxxx
x x xx x x
xxxx xxxxx xxxx x xx x
x xx xxxx xxxx xxxx x xxx
xx x xx x x xxxx xx
x x x xxx xxxxxxx x xx xxx x
x xxxxxxx x x x xxxx xx xx xx
x x x xx xxx x x xxxx
xx xxx xxx xxx x xxxxx xxx
xx x xx xxx xx x x
x xxxx xx xxxx x x x x x
x xxx x x x xx x xx xx x
xxx xx xx x x xx xx
x x x x xx xx xx x
x xxxx xx xx x x x xxxx xx
x x x xxx x xx xxx xxx
x xx x xxx x x x xx
xx x xxx xxxx x x x x x
xx x xxxx xx x x xxxxxxxxx
x xx xx x x xx xx x
xxxxxxx xx x xxxxx x xxx
x x xx xx x xxxx xx x xx
x xxx x xx x xxx xxxxx xxx
x xxx x xx x xxxxxxxx xxx
x xxx x x xx xx x
x x xxxxxxxxx x xx xx xx
xxxxxxx x xx x xx x x x xx x
Для печати моего qr_code я использую CairoOutputter of Barby, но когда я пытаюсь преобразовать свой вывод в svg, png,..., я получаю следующее сообщение об ошибке:
NoMethodError (undefined method `two_dimensional?' for #<RQRCode::QRCode:0x0000000794bd88>)
У вас есть идеи, что я могу сделать, чтобы исправить эту ошибку?
Gemfile:
gem 'rqrcode','~> 0.4.2'
gem 'barby'
gem 'cairo'
В моей модели:
require 'barby'
require 'barby/outputter/cairo_outputter'
require 'rqrcode'
qr = RQRCode::QRCode.new('test')
puts qr
outputter = Barby::CairoOutputter.new(qr).to_svg
Barby::CairoOutputter.new(qr.to_s).to_svg
- person Md. Farhan Memon   schedule 07.06.2017require
? Пожалуйста, отредактируйте свой вопрос, чтобы предоставить достаточно информации, чтобы кто-то, кто еще не знаком с этим инструментом, мог легко воспроизвести проблему. - person Tom Lord   schedule 07.06.2017gem install barby
,gem install cairo
,require 'barby/outputter/cairo_outputter'
, ...... Сколько еще шагов? Я не знаю. Пожалуйста, предоставьте всю информацию. - person Tom Lord   schedule 07.06.2017