简体   繁体   中英

Rails application on shared hosting?

有没有办法在可以安装Ruby的共享主机上部署本地制作的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.

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.

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.

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.

Definitely capistrano + git (git, if you have SSH access, like fe 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. 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).

找到了一个很好的参考: REFERENCE LINK这将有助于在共享主机上部署ROR App。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM