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.2
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
143 $ sudo yum install postgresql-devel
144 $ sudo yum install postgresql-server
145 $ sudo gem install postgres
154 # tar zxf (DOWNLOAD_PATH)/elecoma-<version>.tar.gz
155 # mv elecoma-<version> ec
156 # chown -R ec:ec /usr/local/ec
159 # vim /var/lib/pgsql/data/pg_hba.conf
160 (password cryptを設定します)
161 # /etc/init.d/postgresql start
164 # alter user postgres with password 'xxxx';
167 Shall the new role be a superuser? (y/n) y
169 # alter user ec with password 'elephant';
171 $ createdb --owner=ec ec_dev
173 $ createdb --owner=ec ec_test
175 $ createdb --owner=ec ec
179 Name | Owner | Encoding
180 -----------+----------+----------
184 postgres | postgres | UTF8
185 template0 | postgres | UTF8
186 template1 | postgres | UTF8
193 $ cp database.example.yml database.yml
195 $ diff database.example.yml database.yml
211 $ wget http://kernel.org/pub/software/scm/git/git-1.6.5.5.tar.gz
212 $ tar zxf git-1.6.5.5.tar.gz
219 $ ruby script/plugin install git://github.com/realityforge/rails-active-form.git
220 $ ruby script/plugin install git://github.com/rails/acts_as_list.git
221 $ ruby script/plugin install git://github.com/technoweenie/acts_as_paranoid.git
222 $ ruby script/plugin install git://github.com/rails/acts_as_tree.git
223 $ ruby script/plugin install http://topfunky.net/svn/plugins/ar_fixtures/
224 $ ruby script/plugin install git://github.com/jpmobile/jpmobile.git -r 'tag 0.0.8'
225 $ ruby script/plugin install http://taslam-plugins.googlecode.com/svn/trunk/jpmobile_emoticon_filter/
227 $ git clone git://github.com/tmtysk/mbmail.git mbmail
229 $ git checkout 654ce3ec2dfa10ac3b05cd9354eb84456d206a6d
230 $ rm -fr lib/jpmobile
233 $ ruby script/plugin install git://github.com/jamesgolick/resource_controller.git
234 $ ruby script/plugin install git://github.com/mislav/will_paginate.git
235 $ ruby script/plugin install git://github.com/kakutani/yaml_waml.git
236 $ ruby script/plugin install git://github.com/rails/ssl_requirement.git
237 $ ruby script/plugin install git://github.com/DianthuDia/double_submit_protection.git
238 $ ruby script/plugin install git://github.com/champierre/image_submit_tag_ext.git
239 $ ruby script/plugin install git://github.com/dchelimsky/rspec-rails.git -r 'tag 1.2.9'
240 $ ruby script/plugin install git://github.com/dchelimsky/rspec.git -r 'tag 1.2.9'
243 $ sudo yum install gcc-c++
244 $ sudo yum install httpd-devel
245 $ sudo gem install passenger
246 $ sudo passenger-install-apache2-module
249 $ sudo vim /etc/httpd/conf.d/ec.conf
250 LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.7/ext/apache2/mod_passenger.so
251 PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.7
252 PassengerRuby /usr/local/bin/ruby
255 ServerName ec.example.com
256 DocumentRoot /usr/local/ec/public
258 <Directory /usr/local/ec/public>
266 $ rake db:migrate RAILS_ENV=production
269 $ sudo /etc/init.d/apache restart
272 $ ./script/mail_restart.sh -e production
273 (メールマガジン送信用のプロセスを立ち上げます)
276 $ ruby ./script/server -e production
280 ================================================================================
282 ================================================================================
283 エレコマを起動した直後は管理者ユーザーが存在しません。
284 ユーザー登録は、RAILS_ROOT/test/fixtures/admin_users.yml の5,6,8行目を任意のものに修正した後、
285 コンソールから以下のようにデータを登録します。
287 $ rake db:fixtures:load FIXTURES=admin_users RAILS_ENV=production
289 ユーザーを登録した後、管理画面:http://サイトドメイン/adminにアクセスすると、
290 ログイン画面が表示されますので、RAILS_ROOT/test/fixtures/admin_users.ymlで指定した
291 登録したログインIDとパスワードでログインしてください。
292 なお、初期状態ではSHOPマスタの情報が入っておりませんので、
293 SHOPマスタ登録にて初期情報を入力してください。
295 ================================================================================
297 ================================================================================
298 エレコマではSSLの設定をデータベースに保存しています。
299 そのため、万が一管理画面にアクセスできなくなった場合は、
302 $ script/console production
303 >> system = System.first
304 >> system.use_ssl = false
307 use_sslの値はtrueの時にSSLを利用し、falseの時にSSLを利用しなくなります。
309 ================================================================================
311 ================================================================================
312 エレコマの住所マスタは郵便事業株式会社の郵便番号マスタを利用しています。
313 登録はコンソールから以下のように行ないます。
315 $ ruby script/runner -e production Zip.import
317 郵便番号マスタは以下のサイトにて配布されているものを自動的に取り込みます。
318 http://www.post.japanpost.jp/zipcode/download.html
320 住所マスタ更新機能はLhaLibに依存しています。
321 LhaLibの詳細については以下のサイトをご確認ください。
322 http://www.artonx.org/collabo/backyard/?LhaLibEn
325 ================================================================================
327 ================================================================================
328 エレコマを起動した直後は商品が存在していません。
329 管理画面から、商品の追加を行う必要があります。
332 --------------------------------------------------------------------------------
335 --------------------------------------------------------------------------------
336 商品登録には、カテゴリ、規格が必要となります。
338 -管理画面の商品管理 -> カテゴリ管理 よりカテゴリを登録する
341 -管理画面の商品管理 -> 規格管理 より規格を登録する
345 - 管理画面の商品管理 -> 商品登録 より商品の登録を行う
348 - 管理画面の商品管理 -> 商品マスタ -> CSVアップロード から アップロードする
352 1. 商品登録完了画面もしくは商品マスタの商品一覧 -> 規格登録 から規格を選択し「表示する」ボタンを押下する
353 2. 規格リストが表示されるので、必要な規格の登録項目にチェックを入れ、商品コード、在庫数、価格を入力し、登録を行う
355 以上で、商品がフロント画面に表示されるようになります
359 ================================================================================
361 ================================================================================
362 エレコマではユニットテストにRspecを利用しています。
363 利用するには、以下を実行してRspecのインストールを行なってください。
366 --------------------------------------------------------------------------------
367 $ sudo gem install rspec
368 $ sudo gem install rspec-rails
371 --------------------------------------------------------------------------------
373 このコマンドを発行するとユニットテストが実行されます。
374 ※ $ ruby ./script/spec ./spec
378 ================================================================================
380 ================================================================================
381 本ソフトウェアはMIT Licenceを採用しています。
382 ライセンスの詳細についてはCOPYRIGHTファイルを参照してください。
384 配布物に含まれる「エレコマ」のロゴはクリエイティブ・コモンズノ表示-継承 2.1
385 日本ライセンスに従った範囲内でご利用いただけます。
388 ================================================================================
389 * 配布物に含まれる別プロジェクトのファイル
390 ================================================================================
392 配布物に含まれる以下のファイルはTypePad 絵文字アイコン画像を利用しています。
393 public/images/emoticons/*
394 TypePad 絵文字アイコンは以下のライセンスに基づきます。
396 TypePad 絵文字アイコン画像 by Six Apart Ltd is licensed
397 under a Creative Commons 表示 2.1 日本 License.
398 Permissions beyond the scope of this license may be
399 available at http://start.typepad.jp/typecast/.
402 配布物に含まれる以下のファイルはさざなみフォントを利用しています。
403 lib/sazanami-gothic.ttf
404 さざなみフォントは以下のライセンスに基づきます。
406 Copyright (c) 1990-2003
407 Wada Laboratory, the University of Tokyo. All rights reserved.
408 Copyright (c) 2003-2004
409 Electronic Font Open Laboratory (/efont/). All rights reserved.
411 Redistribution and use in source and binary forms, with or without
412 modification, are permitted provided that the following conditions
414 1. Redistributions of source code must retain the above copyright notice,
415 this list of conditions and the following disclaimer.
416 2. Redistributions in binary form must reproduce the above copyright notice,
417 this list of conditions and the following disclaimer in the documentation
418 and/or other materials provided with the distribution.
419 3. Neither the name of the Wada Laboratory, the University of Tokyo nor
420 the names of its contributors may be used to endorse or promote products
421 derived from this software without specific prior written permission.
423 THIS SOFTWARE IS PROVIDED BY WADA LABORATORY, THE UNIVERSITY OF TOKYO AND
424 CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
425 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
426 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LABORATORY OR
427 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
428 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
429 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
430 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
431 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
432 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
433 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.