Skip to content

yuinore/whiteless_works

Repository files navigation

whiteless_works

Prerequisites

  • Ruby
  • MySQL
  • RMagick (libmagickcore-dev)
  • Bundler
  • Yarn

Installation

1. Install Ruby.

You can use rbenv to insatall Ruby.

The Ruby version is designated in Gemfile and .ruby-version.

$ cat .ruby-version
$ ruby -v

2. Install MySQL

$ mysql --version
$ mysql -u root

3. Install RMagick

$ sudo apt install libmagickcore-dev

4. Create .env file

cp .env{.sample,}
vim .env

5. Install Ruby and JavaScript dependencies

$ gem install bundler
$ bundle install
$ yarn install

6. Create databases

$ bundle exec rails db:create
$ bundle exec rails db:migrate
$ bundle exec rails db:seed

7. Start server

$ bundle exec rails server

Update seeds

Place images to public/images/.

$ ls seeds.csv
$ ls public/images/*.png
$ bundle exec rake seeder:seed

Deploy images to server

To deploy image files to the server, use rsync command:

# Direct transfer to server
rsync -avz --progress public/images/ [SSH_CONFIG_NAME]:/path/to/server/images/

# Example (replace with your actual SSH config name and server path)
rsync -avz --progress public/images/ your-server:/var/www/whiteless_works/public/images/

Note:

  • Replace [SSH_CONFIG_NAME] with your SSH configuration name
  • Replace /path/to/server/images/ with the actual server path
  • Ensure you have write permissions to the target directory on the server
  • The -a flag preserves permissions, timestamps, and directory structure
  • The -z flag compresses data during transfer
  • The --progress flag shows transfer progress

Note 1: Ruby 3.4.4 のインストール

Ruby 3.4.4 を rbenv でインストールするには libffi-devlibyaml-dev が追加で必要っぽい。

sudo apt install -y build-essential libssl-dev zlib1g-dev libffi-dev libyaml-dev

インストール時に出たエラー

pkg_config: checking for pkg-config for yaml-0.1... -------------------- not found

LD_LIBRARY_PATH=.:../.. ASAN_OPTIONS=detect_leaks=0 pkg-config --exists yaml-0.1
package configuration for yaml-0.1 is not found
--------------------

find_header: checking for yaml.h... -------------------- no
conftest.c:3:10: fatal error: yaml.h: No such file or directory
    3 | #include <yaml.h>
      |          ^~~~~~~~
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <yaml.h>
/* end */

--------------------

Note 2: MySQL に root パスワードを設定する方法

まず、パスワード無しで MySQL にログインし、

sudo mysql -u root

その後、パスワードを設定してください。今回は caching_sha2_password を指定しています。

ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'your_new_password';
FLUSH PRIVILEGES;

パスワードを設定したら、 .env ファイルを更新してください。

cp -i .env{.sample,}
vim .env

.env ファイルには以下のように記述してください:

export WHITELESS_WORKS_DATABASE_PASSWORD=your_new_password

Note 3: 初回デプロイ時

初回デプロイ時は master.key 及び config/credentials.yml.enc を作成してください。

EDITOR=vim bundle exec rails credentials:edit

License & Contributing

Important: This repository contains seed values related to creative content and visual artworks that are currently unlicensed. Therefore, I cannot accept pull requests at this time.

If you're interested in contributing or have suggestions, please contact me directly to discuss possibilities.

Contact

https://x.com/yuinore

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors