共享主机上的 Rails 应用程序?
有没有办法可以在安装了 Ruby 的共享主机上部署本地制作的 Rails 应用程序?
Is there a way that I can deploy my locally made rails app on a shared host that has Ruby installed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Capistrano 部署并(Mongrel 或 Passenger...最好是后者...或者如果必须的话,FastCGI,尽管 FastCGI 对于 Rails 来说相当慢)来提供服务。
如果您有共享主机,则必须提供 Rails 版本和所有 gem,因为您可能无权安装 gem。即使您这样做了,您也不希望 Rails 选择旧版本的东西。
Capistrano to deploy and (Mongrel or Passenger... preferably the latter... or if you HAVE to, FastCGI although FastCGI is pretty slow with Rails) to serve.
If you have a shared host you'll have to vendor your Rails version and all your gems, as you probably won't have access to install gems. Even if you did, you won't want Rails picking old versions of things.
就我个人而言,我会使用 Capistrano。有大量书籍和教程可以告诉您如何使用它来部署 Rails 应用程序。配置非常简单。
Personally, I would use Capistrano. There are plenty of books and tutorials around that will tell you how to use it to deploy Rails applications. It is very easy to configure.
Dreamhost 支持 Rails,许多其他人可能也支持。
至于应用程序的安装:这在一定程度上取决于共享主机上已有的可用内容,以及允许您在那里执行/安装/配置的操作。对于 Dreamhost,这是他们的文档。其他共享托管解决方案可能相似也可能不相似,具体取决于其政策。
Dreamhost supports Rails, many others probably do also.
As for installation of your app: it depends a bit on what's already available on your shared host, and what you're allow to do / install / configure there. For Dreamhost, here's their documentation. Other shared hosting solutions may or may not be similar depending on their policy.
我发现的最好方法是安装
passenger
gem。将应用程序上传到帐户后,您只需向.htaccess
文件添加几行即可。The best way I've found is to install the
passenger
gem. Once you've uploaded your app to your account all you need to do is add a few lines to your.htaccess
file and you should be off.绝对是 capistrano + git (git,如果你有 SSH 访问权限,就像 HostingRails 共享主机中的 fe 一样),没有什么比这更容易的了。
简洁的 Capistrano 指南:http://www.linuxjournal.com/article/10100
如何配置Capistrano + git:http://github.com/guides/deploying-with-capistrano
一些不错的 Capistrano 食谱:http://github.com/josh/slicehost
Definitely capistrano + git (git, if you have SSH access, like f.e. in HostingRails shared host), nothing can be easier.
Neat Capistrano guide: http://www.linuxjournal.com/article/10100
How to config Capistrano + git: http://github.com/guides/deploying-with-capistrano
Some nice Capistrano recipes: http://github.com/josh/slicehost
我已经完成了步骤 1-3,它非常简单并且工作得很好(我只是太懒了执行步骤 4)。
I have done steps 1-3 and it is incredibly easy and works perfectly fine (I was just too lazy to do step 4).
找到了一个很好的参考:参考链接 这将有助于在共享主机上部署 ROR 应用程序。
Found a good reference : REFERENCE LINK this will help to deploy ROR App on a shared host.