I’m trying to set up PDFKit but I can’t even run my application to start with. I keep getting this error:
`require': cannot load such file -- pdfkit (LoadError)
Here is my entire application.rb file.
require File.expand_path('../boot', __FILE__)
require 'rails/all'
require 'pdfkit'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
#Bundler.require(:default, :assets, Rails.env)
end
module Form
class Application < Rails::Application
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
config.middleware.use PDFKit::Middleware
end
end
I’ve followed the instructions on the wiki page for pdfkit but I’m bogged with this error. I think it can’t find the pdfkit gem but it seems to be installed. Please do help.
Remove
require 'pdfkit'from application.rbAdd to your
GemfileAnd then run
bundlecommand from your rails root dir.