Ready to deploy your Rails application to Rails Machine? Follow these steps and you’ll have it running in no time! Feel free to utilize Rails Machine’s Ask Us Anything Support and contact us with any questions you have along the way.
Update Gems
Install the latest version of the railsmachine gem:
$ sudo gem install railsmachine
Install Phusion Passenger and Ruby Enterprise Edition
If you do not have Phusion Passenger and Ruby Enterprise Edition installed on your Rails Machine yet you can run this installer on your server.
$ wget http://assets.railsmachine.com/wiki/centos_passenger_install.sh
$ sh centos_passenger_install.sh
Setup Capistrano
Capify your application:
$ capify .
Configure Capistrano for Rails Machine
The following step customizes your config/deploy.rb
with two bits of information you provide:
-
--name
: a simple name for your application. no spaces, please.
-
--domain
: the primary domain name for your application. please omit the ‘www’ – we automaticaly alias www.whateveryouprovide.com as needed.
$ railsmachine --apply-to . --name my-cool-app --domain my-cool-app.com
Please note that the domain name provided will need to be correctly pointed at your Rails Machine account. If you don’t have a DNS provider, we’ve been more than happy with DNS Made Easy.
Update Database Config
Update your applications config/database.yml
’s section with your desired MySQL datbase name, username, and password. The database and user will be created for you in a forthcoming step.
Application Setup
Rails Machine defaults to using mongrel + mod_proxy_balancer to run your Rails Application. If you’d like to switch to Phusion Passenger, edit the line in your application’s config/deploy.rb
that begins set :app_server
to reflect your choice. For example:
set :app_server, :passenger
Run the following Capistrano task to setup your MySQL databases and configure your application servers (mongrel/passenger):
$ cap servers:setup
Source Control
If you’re already using Source Control…
...edit the lines in your application’s config/deploy.rb
that begin set :repository
and set :repository
. For example:
set :scm, :git
set :repository, "git@github.com:yourname/my-cool-app.git"
Important: Although your repository should be configured to ignore the contents of the db and log directories,
make sure the directories themselves are added. The easiest way to do this is to put an empty .gitignore
in the directories- add, commit, and push.
If you’re not yet using Source Control…
...you can easily setup a Git/Subversion repository on your Rails Machine. Subversion is the default, edit the line in your application’s config/deploy.rb
that begins set :scm
if you’d like to change it to git. For example:
set :scm, :git
Next, run the following task to import your application into a Git/SVN repository on your Rails Machine:
$ cap repos:setup
Initial Deploy
That’s it! You’re ready to use Capistrano to deploy your app for the first time:
$ cap deploy:cold
Once that’s done, open your application in a web browser and test it out!
To perform a subsequent deploy with Capistrano:
$ cap deploy
or, if you need to run migrations as well:
$ cap deploy:migrations
分享到:
相关推荐
Ansible-ansible-rails-deployment.zip,使用ansiblerails部署部署项目,ansible是一个简单而强大的自动化引擎。它用于帮助配置管理、应用程序部署和任务自动化。
jquery-fileupload-rails, 用于 Rails的jQuery文件上传集成 Rails 文件上传jQuery-File-Plugin 是一个文件上传插件,由的Tschan 。 jQuery文件上传功能多文件选择。drag&拖放支持。进度栏和jQuery预览图像。 支持...
Web开发敏捷之道-应用Rails进行敏捷Web开发-第三版.rarWeb开发敏捷之道-应用Rails进行敏捷Web开发-第三版.rarWeb开发敏捷之道-应用Rails进行敏捷Web开发-第三版.rarWeb开发敏捷之道-应用Rails进行敏捷Web开发-第三版...
jquery-datatables-rails, 用于 Rails的jquery数据表 gem jquery-datatables-rails 这个 gem 为 jQuery DataTables插件提供了方便,以便与 Rails 资产pipleine结合使用。 它提供所有基本的datatable文件,以及一些...
英文新版:Agile Web Development with Rails, 4th Edition(For Rails 3.1 & 3.2) 内容简介 《Web开发敏捷之道:应用Rails进行敏捷Web开发(第3版)》主要分为两大部分。在“构建应用程序”部分中,读者将看到一个完整...
Web开发敏捷之道--应用Rails进行敏捷Web开发(第2版中文版).part15.rar
Web开发敏捷之道--应用Rails进行敏捷Web开发(第2版)中文
Web开发敏捷之道--应用Rails进行敏捷Web开发(第2版)中文
标题中的“Web开发敏捷之道--应用Rails进行敏捷Web开发 之 Depot代码”表明这是一个关于使用Ruby on Rails框架进行敏捷Web开发的示例项目,名为Depot。Ruby on Rails(简称Rails)是一个开源的Web应用程序框架,它...
Web开发敏捷之道--应用Rails进行敏捷Web开发,红色镐头书,学习ROR的精典书籍,不可不看!此为中文版,非常清晰!
Web开发敏捷之道--应用Rails进行敏捷Web开发(第2版).part1
Web开发敏捷之道--应用Rails进行敏捷Web开发(第2版).part18
Web开发敏捷之道--应用Rails进行敏捷Web开发(第2版)中文版
(新[共14])Web开发敏捷之道--应用Rails进行敏捷Web开part14
Web开发敏捷之道--应用Rails进行敏捷Web开发(第2版),红色镐头书,学习ROR的必读精典!此为高清图片扫描,绝对清晰!
Web开发敏捷之道--应用Rails进行敏捷Web开发(第2版),红色镐头书,学习ROR的必读精典!此为高清图片扫描,绝对清晰!
Web开发敏捷之道--应用Rails进行敏捷Web开发(第2版),红色镐头书,学习ROR的必读精典!此为高清图片扫描,绝对清晰!