日星网 windows 中文论坛

 找回密码
 加入我们

QQ登录

只需一步,快速开始

查看: 1046|回复: 0

Rails Locomotive V3 (LocomotiveCMS) Engine 安装

[复制链接]
发表于 2016-2-16 04:27:22 | 显示全部楼层 |阅读模式
0. 安装环境

  • MongoDB 2.6.x or 3.x
  • Ruby 2.1 (or upper)
  • Ruby on Rails 4.2.5 (or higher)



1. 安装

Rails先建立一个app
  1. $ rails new locomotiveapp --skip-bundle --skip-active-record
  2. $ cd locomotiveapp
复制代码


修改Gemfile,追加以下内容
  1. gem 'locomotivecms', '~> 3.0.0'
复制代码


执行以下命令
  1. $ bundle install
  2. $ bundle exec rails generate locomotive:install
  3.       create  config/initializers/locomotive.rb
  4.       create  config/initializers/devise.rb
  5.       create  config/initializers/dragonfly.rb
  6.       create  config/mongoid.yml
  7. Do you want to store your assets on Amazon S3? n
  8.       create  config/initializers/carrierwave.rb
  9.        route  
  10.   # Locomotive Back-office
  11.   mount Locomotive::Engine => '/locomotive', as: 'locomotive' # you can change the value of the path, by default set to "/locomotive"

  12.   # Locomotive API
  13.   mount Locomotive::API.to_app => '/locomotive(/:site_handle)/api'

  14.   # Render site
  15.   mount Locomotive::Steam::Server.to_app => '/', anchor: false
  16.       remove  public/index.html
  17.       insert  Gemfile
  18. ===============================================================================

  19. The Locomotive Engine has been correctly installed in your Rails application.

  20.   1. Edit the main config files:

  21.     - config/initializers/carrierwave.rb
  22.     - config/initializers/devise.rb
  23.     - config/initializers/dragonfly.rb
  24.     - config/initializers/locomotive.rb
  25.     - config/devise.yml
  26.     - config/mongoid.yml
  27.     - config/routes.rb

  28.   2. Launch the server

  29.     > bundle exec rails server

  30.   3. Open your browser

  31.     > open localhost:3000

  32.   4. Enjoy !

  33. ===============================================================================
复制代码


最后使用
  1. $ bundle exec rails server
复制代码


或者是
  1. rails s
复制代码

来启动程序,并在http://127.0.0.1:3000中访问自己的app
您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

手机版|小黑屋|日星网 ( 黑ICP备07001742号 )

GMT, 2018-11-21 09:45 AM , Processed in 0.016433 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表