共享主机上的 Rails 应用程序?

发布于 2024-08-19 23:13:24 字数 49 浏览 7 评论 0原文

有没有办法可以在安装了 Ruby 的共享主机上部署本地制作的 Rails 应用程序?

Is there a way that I can deploy my locally made rails app on a shared host that has Ruby installed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

吻风 2024-08-26 23:13:24

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.

舟遥客 2024-08-26 23:13:24

就我个人而言,我会使用 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.

遮云壑 2024-08-26 23:13:24

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.

别在捏我脸啦 2024-08-26 23:13:24

我发现的最好方法是安装 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.

樱花坊 2024-08-26 23:13:24

绝对是 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

木槿暧夏七纪年 2024-08-26 23:13:24
  1. 假设您的http服务器是nginx或apache,请安装 Phusion Passenger
  2. 在 Passenger 站点上,有是使用 Rails 配置 Apache/nginx 的非常好的文档
  3. 作为第一步,只需将 Rails 应用程序复制到主机的某个位置并让 Passenger 工作
  4. 一旦工作完成,您将需要一种更好的方法来部署/更新应用程序;正如其他人所建议的,Capistrano 是一种流行的方法,您应该可以毫无问题地在网上找到一些教程来帮助您做到这一点,

我已经完成了步骤 1-3,它非常简单并且工作得很好(我只是太懒了执行步骤 4)。

  1. Assuming your http server is nginx or apache, install Phusion Passenger
  2. On the Passenger site, there are very good docs for configuring Apache/nginx with Rails
  3. As a first step, just copy your Rails app somewhere to the host and get Passenger working
  4. Once you have that working, you will need a better way to deploy/update the app; as others have suggested, Capistrano is a popular way to do it and you should have no problem finding some tutorials online to help you do it

I have done steps 1-3 and it is incredibly easy and works perfectly fine (I was just too lazy to do step 4).

暖伴 2024-08-26 23:13:24

找到了一个很好的参考:参考链接 这将有助于在共享主机上部署 ROR 应用程序。

Found a good reference : REFERENCE LINK this will help to deploy ROR App on a shared host.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文