特殊:Badtitle/NS100:Danbooru

来自Ubuntu中文
Oneleaf留言 | 贡献2007年5月13日 (日) 11:27的版本 (New page: {{From|https://help.ubuntu.com/community/Danbooru}} {{Languages|php5}} Danbooru, from the japanese for cardboard box, is a powerful image board system with tagging. It is built on RubyOnR...)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航跳到搜索

{{#ifexist: :Danbooru/zh | | {{#ifexist: Danbooru/zh | | {{#ifeq: {{#titleparts:Danbooru|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Danbooru|1|-1|}} | zh | | }}

Danbooru, from the japanese for cardboard box, is a powerful image board system with tagging.

It is built on RubyOnRails.

This HOWTO explains how to install it on a debian-like distribution; it has been tested with ubuntu 6.06 and ubuntu feisty.

Prerequisites

Install this and more. There used to be a more complete list on the wiki, most of which I had already installed. Additions are welcome.

Note: Ensure that you have the Universe repository enabled in your /etc/sources.list. See [1].

sudo apt-get install rails postgresql-8.1 postgresql-8.1-plruby rubygems libgd2-xpm-dev
sudo gem install diff-lcs acts_as_versioned


Get the source

svn co svn://donmai.us/danbooru/trunk danbooru
cd danbooru


Tell it where rails is installed system-wide
ln -sf /usr/share/rails vendor/


Rebuild the image resizer binary.
rm -f lib/resizer/resizer
make -C lib/resizer resizer


Set up the database

Create a self-contained postgresql runtime
export PATH=$PATH:/usr/lib/postgresql/8.1/bin
export LOCAL_DB=$PWD/var-db
export PGDATA=$LOCAL_DB/data
initdb
export PGHOST=$LOCAL_DB
pg_ctl -w -l $LOCAL_DB/server.log start -o "-c listen_addresses= -c unix_socket_directory=$LOCAL_DB"
for i in dev test prod; do createdb danbooru-$i; done
createuser -sDR danbooru-dbuser


Load a schema into the DB - I had some errors, but it still worked.

For a real life example, use the schema recently published on http://mapored.net/dump.db.bz2
psql danbooru-dev danbooru-dbuser -f db/postgres.sql 


Optionally, play around with your new database
psql danbooru-dev danbooru-dbuser


Stop the database
LOCAL_DB=~+/var-db eval 'PGDATA=$LOCAL_DB/data /usr/lib/postgresql/8.1/bin/pg_ctl -w stop'


Write a DB config file for RubyOnRails
cat <<EOF > config/database.yml
common: &common
  adapter: postgresql
  host: $PGHOST
  username: danbooru-dbuser

development:
  database: danbooru-dev
  <<: *common

test:
  database: danbooru-test
  <<: *common

production:
  database: danbooru-prod
  <<: *common
EOF


Setup the website, and test it

Edit the website settings You will probably change the e-mail address and the server address, where image and previews are found.
cp config/config_local.yml{.example,}
sensible-editor config/config_local.yml


Run a few tests. Don't run just «rake» right now, you won't get meaningful error messages. First test with a specific target like test:functionals
rake test:functionals 
rake


Start a server

Start a database
LOCAL_DB=~+/var-db eval 'PGHOST=$LOCAL_DB PGDATA=$LOCAL_DB/data /usr/lib/postgresql/8.1/bin/pg_ctl -w -l $LOCAL_DB/server.log start -o "-c listen_addresses= -c unix_socket_directory=$LOCAL_DB"'


Start a local web server until you type Ctrl-C
ruby script/server


Visit it, create the first user (who automagically becomes admin)
sensible-browser http://localhost:3000


Enjoy your danbooru!