Giter Site home page Giter Site logo

zhiren_vagrant's Introduction

安装步骤

What's In The Box

  • Development tools
  • Git
  • Ruby 2.3
  • Bundler
  • SQLite3, MySQL, and Postgres
  • Databases and users needed to run the Active Record test suite
  • System dependencies for nokogiri, sqlite3, mysql, mysql2, and pg
  • Memcached
  • Redis
  • RabbitMQ
  • An ExecJS runtime
  • ImageMagick
  • wkhtmltopdf
  • PhantomJS
  • Bower

1. 安装 Vagrant

brew tap caskroom/cask
brew install brew-cask
brew cask install virtualbox
brew cask install vagrant
brew cask install vagrant-manager

2. 克隆代码到本机

git clone [email protected]:wjp2013/zhiren_vagrant.git
cd zhiren_vagrant

3. 修改 Vagrantfile 中的配置

  • synced_folder 指向你本机的 知人 项目目录
  • 根据你的硬件情况修改 Vagrant 可使用的内存大小 v.memory和 cpu 数量 v.cpus

4. 启动 Vagrant

首次启动要安装各种依赖,大概需要 30 分钟

vagrant up

5. 进入 Vagrant 安装 gems 和 bower

vagrant ssh
cd /vagrant
bower install
bundle install

6. 配置知人

先去要一份 config/application.yml 的配置。

在 Vagrant 环境中执行下面命令

# Prepare configure files
bin/init_config

# Initialize the database and load the seed data
vim config/database.yml
rake db:create
rake db:migrate
rake db:seed

# Create DEMO data
./bin/spring stop
rails console
User.current = User.first
Companies::AsDemo.new(company: Company.first, user: User.first).save
Company.first.update(demo: false)

# start server
rails server -b 0.0.0.0

7. 下次开发如何启动项目

cd zhiren_vagrant
vagrant up
vagrant ssh
cd /vagrant
rails server -b 0.0.0.0

打开浏览器 http://zhiren.dev:3000/ 或者 http://localhost:3000/

提示

  • Vagrant 中的 MySQL 账户密码都是 root,需要修改下知人目录下的 config/database.yml
  • 如果本机没有使用 pow 之类占用 80 端口的软件,可以修改 config.vm.network 把端口映射到 80 上。这样打开 http://zhiren.dev/ 就是开发环境了
  • Postgres, Memcached 和 RabbitMQ 项目中用不到,所以从脚本中注释掉了

zhiren_vagrant's People

Contributors

giaogiaocat avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.