1 ================================================================================
2 エレコマ(Elephant Commerce) http://ec.kbmj.com/
3 ================================================================================
6 エレコマは、Ruby on Railsで開発したECommerceシステムです。
7 オープンソースとして、MIT Licenseを採用しています。
9 このREADMEでは、エレコマを稼動させるまでの必要最低限の手順を記載しています。
11 ================================================================================
13 ================================================================================
14 エレコマを動かすに辺り、以下の環境を奨励します。
15 (下記環境以外でも動作する可能性はあります)
18 - DB : postgresql 8.3系
22 ================================================================================
24 ================================================================================
25 エレコマではpluginを含めて配布をしていません。
26 以下のpluginが依存しています。各自インストールをお願いします。
30 git://github.com/realityforge/rails-active-form.git
31 rev: f1e74bec3d87c23cfc05ca7df11925c08e55514f
34 git://github.com/rails/acts_as_list.git
35 rev: 8771a632dc26a7782800347993869c964133ea29
38 git://github.com/technoweenie/acts_as_paranoid.git
39 rev: b0a5d2b8ba89eae03f673e4af2e52619260fcc30
42 git://github.com/rails/acts_as_tree.git
43 rev: 20988cac158bcf7f7535a3c5dd193165797d719a
46 http://topfunky.net/svn/plugins/ar_fixtures/
50 git://github.com/jpmobile/jpmobile.git
53 jpmobile_emoticon_filter
54 http://taslam-plugins.googlecode.com/svn/trunk/jpmobile_emoticon_filter/
58 git://github.com/tmtysk/mbmail.git
59 rev: 654ce3ec2dfa10ac3b05cd9354eb84456d206a6d
62 git://github.com/jamesgolick/resource_controller.git
63 rev: 48359daa1e01c47f1d7b5f37441742123d395e11
66 git://github.com/rails/ssl_requirement.git
67 rev: 34a9a138c4093bd7d5678822f8f1e62c31d47299
70 git://github.com/mislav/will_paginate.git
71 rev: 839d821041a4cfaa4dfbcc5719ea17ff196189c7
74 git://github.com/kakutani/yaml_waml.git
75 rev: 1b292b3e0df9a7e69ed90eebdca327a0888b0a12
77 double_submit_protection
78 git://github.com/DianthuDia/double_submit_protection.git
79 rev: 7fc2e629b9fccb1736be7ea9da63e578f835a307
82 git://github.com/champierre/image_submit_tag_ext.git
83 rev: 572ce5ce5d40ee1494ddd0a121483e8791bb2184
86 git://github.com/dchelimsky/rspec.git
90 git://github.com/dchelimsky/rspec-rails.git
93 ================================================================================
95 ================================================================================
96 CentOS 5.4でのインストールを想定しています。
98 -ダウンロードページからエレコマをダウンロード済み。
101 $ sudo yum install gcc
102 $ sudo yum install zlib-devel
103 $ sudo yum install openssl-devel
104 $ sudo yum install ncurses-devel
105 $ sudo yum install readline-devel
106 $ wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz
107 $ tar zxf ruby-1.8.7-p174.tar.gz
114 $ wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
115 $ tar zxf rubygems-1.3.5.tgz
119 3. ImageMagickのインストール
120 $ sudo yum install libjpeg-devel libpng-devel gd-devel freetype-devel
121 $ wget ftp://ftp.kddlabs.co.jp/graphics/ImageMagick/ImageMagick-6.5.8-4.tar.gz
122 $ tar zxf ImageMagick-6.5.8-4.tar.gz
123 $ cd ImageMagick-6.5.8-4
129 $ alias sudo="sudo PATH=$PATH"
130 $ sudo gem install rmagick -v 2.12.2
134 $ sudo gem install rails -v 2.3.5
135 $ sudo gem install gettext -v 2.1.0
136 $ sudo gem install gruff -v 0.3.6
137 $ wget http://www.artonx.org/data/lhalib/lhalib-0.8.1.gem
138 $ sudo gem install lhalib-0.8.1.gem
139 $ sudo gem install webmock -v 1.3.4
140 $ sudo gem install thoughtbot-factory_girl -v 1.2.2 --source http://gems.github.com
141 $ sudo gem install json
142 $ sudo gem install daemons
145 $ sudo yum install postgresql-devel
146 $ sudo yum install postgresql-server
147 $ sudo gem install postgres
156 # tar zxf (DOWNLOAD_PATH)/elecoma-<version>.tar.gz
157 # mv elecoma-<version> ec
158 # chown -R ec:ec /usr/local/ec
161 # vim /var/lib/pgsql/data/pg_hba.conf
162 (password cryptを設定します)
163 # /etc/init.d/postgresql start
166 # alter user postgres with password 'xxxx';
169 Shall the new role be a superuser? (y/n) y
171 # alter user ec with password 'elephant';
173 $ createdb --owner=ec ec_dev
175 $ createdb --owner=ec ec_test
177 $ createdb --owner=ec ec
181 Name | Owner | Encoding
182 -----------+----------+----------
186 postgres | postgres | UTF8
187 template0 | postgres | UTF8
188 template1 | postgres | UTF8
195 $ cp database.example.yml database.yml
197 $ diff database.example.yml database.yml
213 $ wget http://kernel.org/pub/software/scm/git/git-1.6.5.5.tar.gz
214 $ tar zxf git-1.6.5.5.tar.gz
221 $ ruby script/plugin install git://github.com/realityforge/rails-active-form.git
222 $ ruby script/plugin install git://github.com/rails/acts_as_list.git
223 $ ruby script/plugin install git://github.com/technoweenie/acts_as_paranoid.git
224 $ ruby script/plugin install git://github.com/rails/acts_as_tree.git
225 $ ruby script/plugin install http://topfunky.net/svn/plugins/ar_fixtures/
226 $ ruby script/plugin install git://github.com/jpmobile/jpmobile.git -r 'tag 0.0.8'
227 $ ruby script/plugin install http://taslam-plugins.googlecode.com/svn/trunk/jpmobile_emoticon_filter/
229 $ git clone git://github.com/tmtysk/mbmail.git mbmail
231 $ git checkout 654ce3ec2dfa10ac3b05cd9354eb84456d206a6d
232 $ rm -fr lib/jpmobile
235 $ ruby script/plugin install git://github.com/jamesgolick/resource_controller.git
236 $ ruby script/plugin install git://github.com/mislav/will_paginate.git
237 $ ruby script/plugin install git://github.com/kakutani/yaml_waml.git
238 $ ruby script/plugin install git://github.com/rails/ssl_requirement.git
239 $ ruby script/plugin install git://github.com/DianthuDia/double_submit_protection.git
240 $ ruby script/plugin install git://github.com/champierre/image_submit_tag_ext.git
241 $ ruby script/plugin install git://github.com/dchelimsky/rspec-rails.git -r 'tag 1.2.9'
242 $ ruby script/plugin install git://github.com/dchelimsky/rspec.git -r 'tag 1.2.9'
245 $ sudo yum install gcc-c++
246 $ sudo yum install httpd-devel
247 $ sudo yum install curl-devel
248 $ sudo gem install passenger
249 $ sudo passenger-install-apache2-module
252 $ sudo vim /etc/httpd/conf.d/ec.conf
253 LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.7/ext/apache2/mod_passenger.so
254 PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.7
255 PassengerRuby /usr/local/bin/ruby
258 ServerName ec.example.com
259 DocumentRoot /usr/local/ec/public
261 <Directory /usr/local/ec/public>
269 $ rake db:migrate RAILS_ENV=production
272 $ sudo /etc/init.d/apache restart
275 $ ruby lib/daemons/mail.rb -e production start
278 $ ruby ./script/server -e production
282 ================================================================================
284 ================================================================================
285 エレコマを起動した直後は管理者ユーザーが存在しません。
286 ユーザー登録は、RAILS_ROOT/test/fixtures/admin_users.yml の5,6,8行目を任意のものに修正した後、
287 コンソールから以下のようにデータを登録します。
289 $ rake db:fixtures:load FIXTURES=admin_users RAILS_ENV=production
291 ユーザーを登録した後、管理画面:http://サイトドメイン/adminにアクセスすると、
292 ログイン画面が表示されますので、RAILS_ROOT/test/fixtures/admin_users.ymlで指定した
293 登録したログインIDとパスワードでログインしてください。
294 なお、初期状態ではSHOPマスタの情報が入っておりませんので、
295 SHOPマスタ登録にて初期情報を入力してください。
297 ================================================================================
299 ================================================================================
300 エレコマではSSLの設定をデータベースに保存しています。
301 そのため、万が一管理画面にアクセスできなくなった場合は、
304 $ script/console production
305 >> system = System.first
306 >> system.use_ssl = false
309 use_sslの値はtrueの時にSSLを利用し、falseの時にSSLを利用しなくなります。
311 ================================================================================
313 ================================================================================
314 エレコマの住所マスタは郵便事業株式会社の郵便番号マスタを利用しています。
315 登録はコンソールから以下のように行ないます。
317 $ ruby script/runner -e production Zip.import
319 郵便番号マスタは以下のサイトにて配布されているものを自動的に取り込みます。
320 http://www.post.japanpost.jp/zipcode/download.html
322 住所マスタ更新機能はLhaLibに依存しています。
323 LhaLibの詳細については以下のサイトをご確認ください。
324 http://www.artonx.org/collabo/backyard/?LhaLibEn
327 ================================================================================
329 ================================================================================
330 エレコマを起動した直後は商品が存在していません。
331 管理画面から、商品の追加を行う必要があります。
334 --------------------------------------------------------------------------------
337 --------------------------------------------------------------------------------
338 商品登録には、カテゴリ、規格が必要となります。
340 -管理画面の商品管理 -> カテゴリ管理 よりカテゴリを登録する
343 -管理画面の商品管理 -> 規格管理 より規格を登録する
347 - 管理画面の商品管理 -> 商品登録 より商品の登録を行う
350 - 管理画面の商品管理 -> 商品マスタ -> CSVアップロード から アップロードする
354 1. 商品登録完了画面もしくは商品マスタの商品一覧 -> 規格登録 から規格を選択し「表示する」ボタンを押下する
355 2. 規格リストが表示されるので、必要な規格の登録項目にチェックを入れ、商品コード、在庫数、価格を入力し、登録を行う
357 以上で、商品がフロント画面に表示されるようになります
361 ================================================================================
363 ================================================================================
364 エレコマではユニットテストにRspecを利用しています。
365 利用するには、以下を実行してRspecのインストールを行なってください。
368 --------------------------------------------------------------------------------
369 $ sudo gem install rspec
370 $ sudo gem install rspec-rails
373 --------------------------------------------------------------------------------
375 このコマンドを発行するとユニットテストが実行されます。
376 ※ $ ruby ./script/spec ./spec
380 ================================================================================
382 ================================================================================
383 本ソフトウェアはMIT Licenceを採用しています。
384 ライセンスの詳細についてはCOPYRIGHTファイルを参照してください。
386 配布物に含まれる「エレコマ」のロゴはクリエイティブ・コモンズノ表示-継承 2.1
387 日本ライセンスに従った範囲内でご利用いただけます。
390 ================================================================================
391 * 配布物に含まれる別プロジェクトのファイル
392 ================================================================================
394 配布物に含まれる以下のファイルはTypePad 絵文字アイコン画像を利用しています。
395 public/images/emoticons/*
396 TypePad 絵文字アイコンは以下のライセンスに基づきます。
398 TypePad 絵文字アイコン画像 by Six Apart Ltd is licensed
399 under a Creative Commons 表示 2.1 日本 License.
400 Permissions beyond the scope of this license may be
401 available at http://start.typepad.jp/typecast/.
404 配布物に含まれる以下のファイルはさざなみフォントを利用しています。
405 lib/sazanami-gothic.ttf
406 さざなみフォントは以下のライセンスに基づきます。
408 Copyright (c) 1990-2003
409 Wada Laboratory, the University of Tokyo. All rights reserved.
410 Copyright (c) 2003-2004
411 Electronic Font Open Laboratory (/efont/). All rights reserved.
413 Redistribution and use in source and binary forms, with or without
414 modification, are permitted provided that the following conditions
416 1. Redistributions of source code must retain the above copyright notice,
417 this list of conditions and the following disclaimer.
418 2. Redistributions in binary form must reproduce the above copyright notice,
419 this list of conditions and the following disclaimer in the documentation
420 and/or other materials provided with the distribution.
421 3. Neither the name of the Wada Laboratory, the University of Tokyo nor
422 the names of its contributors may be used to endorse or promote products
423 derived from this software without specific prior written permission.
425 THIS SOFTWARE IS PROVIDED BY WADA LABORATORY, THE UNIVERSITY OF TOKYO AND
426 CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
427 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
428 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LABORATORY OR
429 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
430 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
431 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
432 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
433 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
434 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
435 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.