forked from manossim/foodsoft
-
Notifications
You must be signed in to change notification settings - Fork 2
/
README_DEVEL
91 lines (57 loc) · 2.9 KB
/
README_DEVEL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Things to do to install foodsoft:
README for DEVELopment Project Setup
====================================
Gratulations, you have successfully cloned the foodsoft project
from the git repository. Now you are only a few steps away from
trying it out and then jumping into development. (This manual presumes
you have ruby and rails setup.)
(0) Set up ruby and rails
-------------------------
$ sudo apt-get install ruby1.8 rubygems build-essential
$ sudo gem install -v=2.3.2 rails
(1) Configure datebase
----------------------
Create the database configuration from the default:
cp config/database.yml.SAMPLE config/database.yml
If you are fine with using a file-based sqlite database you are all set.
The sqlite files (development/test/production) will reside in the "db" directory.
You might still need to install sqlite and the respective gem, i.e. on Ubuntu do:
sudo aptitude install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby
Otherwise you would want to edit database.yml to suit your needs (MySQL whatever).
(2) Configure development environment
-------------------------------------
Again, you need to create your own copy of the default configuration:
cp config/environments/development.rb.SAMPLE config/environments/development.rb
Edit development.rb to specify your settings (at least the ActionMailer SMTP settings).
If you just leave the file as is, emails will not work but everything else should be okay.
(3) Foodsoft settings
---------------------
You need to create your own copy of the foodsoft configuration settings:
cp config/app_config.yml.SAMPLE config/app_config.yml
Edit app_config.yml to suit your needs or just keep the defaults for now.
(4) Required ruby and gems
-------------------
We reccomend the using of rvm (https://rvm.beginrescueend.com/). Install rvm and get the lates ruby (1.8.7).
If installed you only need to install the gem bundler:
gem install bundler
After that you get the other gems easily with (from project root):
bundle install
For Debian/Ubuntu the bundle program may not be in the path, but you can do:
/var/lib/gems/1.8/bin/bundle install
(4a) Add secret to config/environment.rb
----------------------------------------
One line from the bottom, find the text:
config.action_controller.session = { :key => "_myapp_session", :secret => "biglongstring...." }
and change it to be a unique key for you.
(5) Create database (schema) and load defaults
--------------------------
rake db:create
With this, you also get a ready to go user with username 'admin' and password 'secret'.
(6) Try it out!
---------------
Start the WEBrick server to try it out. You need to be in the root directory of foodsoft.
script/server
Now go to your web browser and open http://localhost:3000/ and you should have foodsoft up
and running. The admin user has username 'admin' and password 'secret'. Obviously you
should change this on a live site.