Total Pageviews

Wednesday, 18 May 2016

church.io网站的源码,用Ruby on Rails搭建。

built with Ruby on Rails 

Development Setup Using Vagrant

If you're a developer and want to get everything running locally, this is the easiest way.
Operating System: Windows, Mac, or Linux
  1. Install VirtualBox. It's free and it runs on Windows, Mac, and Linux.
  2. Install Vagrant on your host machine.
  3. Install Git.
  4. Clone the repository to your host machine: git clone git://github.com/churchio/onebody.git (If you forked the project, clone from your own fork.)
  5. In your terminal, change to the project directory: cd onebody
  6. Run vagrant: vagrant up
Now visit the site running in development mode at http://localhost:8080.
You can use your favorite text editor to make changes inside the onebody directory. Changes should show in your browser after refreshing.
Check out Using Vagrant on the wiki for further help and tips.

Manual Development Setup on Mac or Linux

  1. Install Ruby 2.2.2 or higher (we recommend you use rbenv or RVM).
  2. Install MySQL.
  3. Install Git.
  4. Install ImageMagick.
  5. Install Node.js.
  6. git clone git://github.com/churchio/onebody.git && cd onebody
  7. mysql -uroot -e "grant all on onebody_dev.* to onebody@localhost identified by 'onebody';"
  8. mysql -uroot -e "grant all on onebody_test.* to onebody@localhost identified by 'onebody';"
  9. cp config/database.yml{.mysql-example,}
  10. gem install bundler
  11. bundle install (If you get an error installing eventmachine, you might need to do this)
  12. cp config/secrets.yml{.example,} && vim config/secrets.yml and add a random secret token to both the "development" and "test" sections (you can use rake secret to generate a new random secret).
  13. rake db:create db:schema:load db:seed
  14. rails server
Now visit the site running in development mode at http://localhost:3000.

Manual Development Setup on Windows

  1. Download the Ruby 2.2 package from http://railsinstaller.org and install.
  2. Download MariaDB stable from https://downloads.mariadb.org and install. Take note of what you enter for the root password.
  3. Download Git from https://git-scm.com/download/win and install.
  4. Download ImageMagick from http://imagemagick.org/www/binary-releases.html#windows and install.
  5. Download Node.js from https://nodejs.org/en/download/ and install.
  6. Open the "Git Bash" program, then run...
  7. git clone git://github.com/churchio/onebody.git && cd onebody
  8. mysql -uroot -pROOT_PASSWORD -e "grant all on onebody_dev.* to onebody@localhost identified by 'onebody';"
  9. mysql -uroot -pROOT_PASSWORD -e "grant all on onebody_test.* to onebody@localhost identified by 'onebody';"
  10. cp config/database.yml{.mysql-example,}
  11. gem install bundler
  12. bundle install
  13. cp config/secrets.yml{.example,} && vim config/secrets.yml and add a random secret token to both the "development" and "test" sections (you can use rake secret to generate a new random secret).
  14. rake db:create db:schema:load db:seed
  15. rails server
Now visit the site running in development mode at http://localhost:3000.

Tests

To run tests:
rspec
If you don't have a test database yet, create it like you did the dev database:
RAILS_ENV=test rake db:create db:schema:load

Get Help

from  https://github.com/churchio/onebody