`
sillycat
  • 浏览: 2489300 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Rails Deployment(1)modrails

阅读更多
Rails Deployment(1)modrails

1. Install Passenger
>sudo gem install passenger

>sudo passenger-install-apache2-module

This is the console output of the command:
checking for required software...
GNU C++ compiler... found at /usr/bin/g++
Curl development headers with SSL support... not found
OpenSSL development headers ... not found
Zlib development headers ... found
Ruby development headers...found
OpenSSL support for Ruby...found
RubyGems... found
rake... found at /usr/bin/rake
Apache 2... found at /usr/sbin/apache2
Apache 2 development headers... not found
Apache Portable Runtime (APR) development headers... not found
Apache Portable Runtime Utility (APU) development headers ... not found

I need to install all the related softwares.

>sudo apt-get install libcurl4-openssl-dev  or >sudo apt-get install libcurl4-gnutls-dev
>sudo apt-get install libssl-dev
>sudo apt-get install apache2-prefork-dev
>sudo apt-get install libapr1-dev
>sudo apt-get install libaprutil1-dev

For the standalone version, we can use this command:
>cd /home/luohua/work/projectname/
>passenger start

That is ok, we can visit http://localhost:3000 to test the websites now.

2. Configure and run with apache2
And we can also put the server on apache together.
Please edit the apache configuration file:

>vi httpd.conf

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.8/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.8
PassengerRuby /usr/bin/ruby1.8

Deploying a Ruby on Rails application: an example

Suppose the rails application in /somewhere.
Add a virtual host to my apache configuration file and set its DocumentRoot
to /somewhere/public:

>cd /etc/apache2/sites-available
>vi projectname

<VirtualHost *:81>
ServerName www.yourhost.com
DocumentRoot /somewhere/public #be sure to point to public
<Directory /somewhere/public>
  AllowOverride all
  Options -MultiViews
</Directory>
</VirtualHost>

>cd /etc/apache2/sites-enabled
>ln -s ../sites-available/projectname

when I visit the URL http://localhost:81, I got these error messages:
syntax error, unexpected ':', expecting '}' format.json { render json: @accounts }

After I change the syntax from render json: @accounts to render json => @accounts. That is fine then.

references:
http://www.modrails.com/install.html

分享到:
评论

相关推荐

    Ansible-ansible-rails-deployment.zip

    Ansible-ansible-rails-deployment.zip,使用ansiblerails部署部署项目,ansible是一个简单而强大的自动化引擎。它用于帮助配置管理、应用程序部署和任务自动化。

    Deploying.Rails.with.Docker.Kubernetes.and.ECS

    Every concept is clearly explained alongside a full Ruby on Rails application deployment. You’ll also learn how to deploy via Docker using Amazon EC2 Container Service. What You Will Learn How to ...

    rails 2.3.2离线安装rails 2.3.2离线安装

    rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails 2.3.2离线安装rails ...

    [Rails] Crafting Rails Applications (英文版)

    [Pragmatic Bookshelf] Crafting Rails Applications Expert Practices for Everyday Rails Development (E-Book) ☆ 图书概要:☆ Rails 3 is a huge step forward. You can now easily extend the framework, ...

    Bootstrap for Rails (2015)

    Chapter 1: Introducing Web Application Development in Rails 7 Why Bootstrap with Rails? 8 Setting up a Todo application in Rails 8 Analyzing folder structure of a Rails application 10 Creating views ...

    Ruby on Rails Guides v2 - Ruby on Rails 4.2.5

    Ruby on Rails Guides v2 - Ruby on Rails 4.2.5

    Rails.Angular.Postgres.and.Bootstrap.2nd.Edition

    Chapter 1. Set Up the Environment Chapter 2. Create a Great-Looking Login with Bootstrap and Devise Chapter 3. Secure the User Database with Postgres Constraints Chapter 4. Perform Fast Queries with ...

    Ruby on Rails Tutorial

    《Ruby on Rails Tutorial》中文版(原书第2版,涵盖 Rails 4) Ruby 是一门很美的计算机语言,其设计原则就是“让编程人员快乐”。David Heinemeier Hansson 就是看重了这一点,才在开发 Rails 框架时选择了 Ruby...

    Rails之道,完整扫描版

    《Rails之道》按照Rails的各个子系统进行组织编排,分别介绍了Rails的环境、初始过程、配置和日志记录,Rails的分配器、控制器、页面生成和路由,REST、资源和Rails,ActiveRecord的基础、关联、验证和高级技巧,...

    rails敏捷开发的购物车系统

    本资源是参照rails敏捷开发第四版书中的例子,rails的版本是rails3.2.6

    Rails项目源代码

    一个用Ruby on Rails搭建的图片分享的网站项目.完整源代码

    Rails 4 in Action(Manning,2015)

    You'll find no substitute for the guru's-eye-view of design, testing, deployment, and other real-world concerns that this book provides. Rails 4 in Action is a hands-on guide to the subject. In this...

    adminlte-rails, AdminLTE Rails gem 将AdminLTE主题与 Rails 资产管道集成.zip

    adminlte-rails, AdminLTE Rails gem 将AdminLTE主题与 Rails 资产管道集成 AdminLTE Rails gem AdminLTE 是后端的高级 Bootstrap 主题。英镑 AdminLTE Rails gem 与 Rails 资产管道集成了英镑AdminLTE主题。安装将...

    Agile Web Development with Rails 4

    Ruby on Rails helps you produce high-quality, beautiful-looking web applications quickly. You concentrate on creating the application, and Rails takes care of the details., Tens of thousands of ...

    提升Ruby on Rails性能的几个解决方案

    Ruby On Rails 框架自它提出之日起就受到广泛关注,在“不要重复自己”,“约定优于配置”等思想的指导下,Rails 带给 Web 开发者的是极高的开发效率。 ActiveRecord 的灵活让你再也不用配置繁琐的 Hibernate 即可...

    Addison.Wesley.RailsSpace.Building.a.Social.Networking.Website.with.Ruby.on.Rails

    RailsSpace teaches you Ruby on Rails by developing a real-world application: Rails...designed to show how to use Rails to make a web application suitable for deployment into a production environment.

    使用Aptana+Rails开发Rails Web应用(中文)

    使用Aptana+Rails开发Rails Web应用 有Aptana的安装配置等等,中文

    (Unity源码)街机外星风格射击游戏源码On Rails Shooter Template 1.20.rar

    2-94街机外星风格射击游戏源码On Rails Shooter Template 1.202-94街机外星风格射击游戏源码On Rails Shooter Template 1.202-94街机外星风格射击游戏源码On Rails Shooter Template 1.202-94街机外星风格射击游戏...

Global site tag (gtag.js) - Google Analytics