sinatra with passbook has error....
rubyon opened this issue · comments
rubyon commented
in my rails web...
in Gemfile
gem 'passbook', :git => 'git://github.com/frozon/passbook.git'
and works well!
but sinatra... ( I'm beginner in sinatra app dev)
require 'passbook'
require 'active_support/json/encoding'
has error...
no such file to load -- passbook
How can I do fix it??? plz... help me...
Thomas commented
Hello,
Made some test:
Gemfile:
source :rubygems
gem 'sinatra'
gem 'active_support'
gem 'passbook', git: 'git://github.com/frozon/passbook.git'
test.rb
require 'rubygems'
require 'sinatra'
require 'active_support'
require 'passbook'
get '/pass.pkpass' do
Passbook.wwdc_cert = 'wwdc.pem'
Passbook.p12_cert = 'cert.p12'
Passbook.p12_password = ''
json = ''
pass = Passbook::PKPass.new json
pass.addFiles ['icon.png', 'icon@2x.png', 'logo.png', 'logo@2x.png', 'strip.png', 'strip@2x.png']
response['Content-Type'] = 'application/vnd.apple.pkpass'
attachment 'pass.pkpass'
pass.stream
end
get '/' do
'<a href="/pass.pkpass">Download pass</a>'
end
This is working for me, I ran bundle
and bundle exec ruby test.rb
rubyon commented
Thanks! It is solved!!! Thanks!!!
Thomas commented
You're welcome