如何通过 cPanel 在共享主机上部署 Ruby on Rails 应用程序?
我正在学习 Ruby on Rails,一切进展顺利 - 直到我尝试将我的一个测试应用程序部署到我的共享托管帐户。
我使用 Host Gator,并能够通过 cPanel 成功创建一个新的 Ruby on Rails 应用程序并运行它。唯一的问题是,当您以这种方式创建新应用程序时,它会使用空白应用程序填充其目录 - 就像本地的 rails new app_name
一样。当我删除此目录中的文件和文件夹并将其替换为我自己的文件和文件夹,然后尝试运行该应用程序时,cPanel 表示它正在确认页面上运行,但实际上从未启动。我也没有收到任何错误消息。
主机似乎很困惑,说应该删除初始文件和文件夹并替换它们,然后运行。该应用程序在本地运行良好,因此我不认为这是代码问题。在我的研究中,我遇到了 Passenger,尽管它超出了我的理解范围,而且看起来您确实需要完全控制 Apache 才能使其一切正常工作,包括 ssh。
如果有什么区别的话,我在本地制作的应用程序是使用 Rails Installer 安装组合在一起的,并搭建了脚手架。为了进行测试,我使用了一个最低限度的应用程序,表中包含大约三个字段。
我缺少什么?任何帮助将不胜感激。
I am in the process of learning Ruby on Rails and things have been going smoothly - up until I tried to deploy one of my test applications to my shared hosting account.
I use Host Gator and was able to successfully create a new Ruby on Rails app via cPanel and run it. The only problem is that when you create a new app this way, it populates its directory with a blank application - as would rails new app_name
locally. When I delete the files and folders in this directory and replace them with my own, then attempt to run the app, cPanel says that it is running on the confirmation page but it never actually starts. I am not receiving any error messages either.
The host seemed rather stumped, stating that it should be a matter of deleting the initial files and folders and replacing them, then running. The app works fine locally so I do not think that it is a code issue. In my research I came across Passenger, although it is way over my head and it would appear that you really need to have total control over Apache to make it all work, including ssh.
If it makes any difference, the apps I made locally were put together using an installation of Rails Installer and are scaffolded. For testing I am using a bare minimum app with about three fields in the table.
What am I missing? Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
2013 年 10 月 26 日支持的最大版本为:
Ruby 1.8.7
RubyGems 1.8.25
Rails 2.3.18
任何比这更新的东西都几乎肯定会损坏,并且 cPanel 和 cPanel 都可能会损坏。 WHM 将无法以任何方式、形式或形式利用它。
我们可以帮助您删除现有的 Ruby on Rails 安装并将其恢复到 cPanel 支持和认可的版本(Ruby 1.8、RubyGems 1.8 和 Rails 2)。这是我们目前唯一能为您做的事情。
如果您想使用比这更新的任何版本,那么您将无法使用 cPanel 和 cPanel。 WHM 接口或管理工具——它们根本不起作用。然后,您必须通过命令行手动管理您的 RoR 安装。这些都不属于 cPanel 支持的范围。
Maximum supported versions on 26/10/2013 are:
Ruby 1.8.7
RubyGems 1.8.25
Rails 2.3.18
Anything newer than that is a near guaranteed breakage and cPanel & WHM will be incapable of utilizing it in any way, shape, or form.
We can assist you with removing your existing Ruby on Rails installations and reverting them back to cPanel supported and sanctioned versions (Ruby 1.8, RubyGems 1.8, and Rails 2). That is the only thing we can do for you at this time.
If you want to use any versions newer than this, then you will be unable to use the cPanel & WHM interfaces or management tools for it -- they simply will not work. You will then have to manually manage your RoR install by yourself through command line exclusively. None of it would fall under the scope of cPanel support.
您可以使用 http://ndeploy.in 这是一个第三方插件,通过 Phsuion Passenger 在 cPanel 中集成 Rails Hosting。
You can use http://ndeploy.in which is a third party plugin to integrate Rails Hosting via Phsuion Passenger in cPanel .
只是为了让其他使用 Cpanel 和 Rails 的人知道。
我能够使用 Cpanel 创建一个 Rails 应用程序,启动它,并在 Cpanel 内完成所有重定向。
没有什么需要修改或改变的。对我来说非常简单。
所以我想直接在服务器本身上进行开发工作会更容易。
尚未尝试将本地开发的 Rails 部署到共享服务器或任何本身。但我猜我们可以使用 Cpanel 创建 Rails 并替换生成的目录中的文件。
Just to let others who is using Cpanel with rails know.
I was able to use Cpanel to create a rails app, start it, and do the redirection all within Cpanel.
Nothing to modify or change. Quite straightforward for me.
So I guess it would be easier to do the development work straight on the server itself.
Have not tried to deploy a locally developed rails to shared server, or any per se. But I'm guessing we could create rails with Cpanel and replace the files in the directory generated.