使用自定义宝石在Dreamhost / Passenger上部署Sinatra应用程序 [英] Deploying Sinatra app on Dreamhost/Passenger with custom gems
问题描述
我有一个Sinatra应用程序,我试图在Dreamhost上运行,它使用小马发送电子邮件。为了让应用程序在开始运行(在添加小马之前),我必须 我已经完成了 gem unpack rack 和
gem unpack sinatra code>放入vendor /目录,所以这是我的config.ru:
pre $ require'vendor / rack / lib / rack'
require'vendor / sinatra / lib / sinatra'
set:run,false $ b $ set:environment,:production $ b $ set:views,views
需要'public / myapp.rb'
运行Sinatra :: Application
gem install pony
和 gem unpack pony
(进入vendor /)。之后,我尝试将 require'vendor / sinatra / lib / pony'
添加到config.ru,让乘客抱怨小马的依赖关系类型,tmail)没有被发现!
是一种更好的方式,可以使用其他宝石并对那些冗长,丑陋,多余的音色进行调节。要求
。任何想法?
我建议创建自己的gem路径somewhere,然后将它添加到 config.ru
like:
ENV ['GEM_PATH'] = xxx
Gem.clear_paths
然后将宝石安装到那个
I've got a Sinatra app that I'm trying to run on Dreamhost that makes use of pony to send email. In order to get the application up and running at the very beginning (before adding pony), I had to gem unpack rack
and gem unpack sinatra
into the vendor/ directory, so this was my config.ru:
require 'vendor/rack/lib/rack'
require 'vendor/sinatra/lib/sinatra'
set :run, false
set :environment, :production
set :views, "views"
require 'public/myapp.rb'
run Sinatra::Application
I have already done gem install pony
and gem unpack pony
(into vendor/). Afterwards, I tried adding require 'vendor/sinatra/lib/pony'
to config.ru only to have Passenger complain about pony's dependencies (mime-types, tmail) not being found either!
There has to be a better way to use other gems and tone down those long, ugly, redundant requires
. Any thoughts?
I'd recommend creating your own gem path "somewhere" then adding it in your config.ru
like:
ENV['GEM_PATH'] = xxx
Gem.clear_paths
then install your gems into that
这篇关于使用自定义宝石在Dreamhost / Passenger上部署Sinatra应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!