Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
6
Help us understand the problem. What is going on with this article?
@y_minowa

【Mac】開発環境にRedmineをインストールして動かす

More than 5 years have passed since last update.

Redmineのプラグインを作りたいので、開発基盤としてのRedmineをローカルにインストール、セットアップを実施。GitHubミラーをfolkして利用しました。ちなみに、対象バージョンは3.0.0、Rubyは2.2.0です。

$ git clone https://github.com/yminowa/redmine redmine_dev
$ cd redmine_dev
$ git checkout -b 3.0-stable remotes/origin/3.0-stable
$ bundle install

database.ymlの設定をします。

cp database.yml.example database.yml
database.yml
...
development:
  adapter: mysql2
  database: redmine_development
  host: localhost
  username: root
  password: root
  encoding: utf8
...

その後DBの作成。

$ bundle exec rake db:create
$ bundle exec rake db:migrate

ここまでで起動しようとすると、以下のエラーが出ました。

$ bundle exec rails s
[2015-03-05 16:52:00] ERROR RuntimeError: Missing `secret_token` and `secret_key_base` for 'development' environment, set these values in `config/secrets.yml`
        /Users/yuichi/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/application.rb:520:in `validate_secret_key_config!'
        /Users/yuichi/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/application.rb:246:in `env_config'
        /Users/yuichi/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:514:in `call'
        /Users/yuichi/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/application.rb:164:in `call'
        /Users/yuichi/.rvm/gems/ruby-2.2.0/gems/rack-1.6.0/lib/rack/lock.rb:17:in `call'
        /Users/yuichi/.rvm/gems/ruby-2.2.0/gems/rack-1.6.0/lib/rack/content_length.rb:15:in `call'
        /Users/yuichi/.rvm/gems/ruby-2.2.0/gems/rack-1.6.0/lib/rack/handler/webrick.rb:89:in `service'
        /Users/yuichi/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
        /Users/yuichi/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
        /Users/yuichi/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'

どうやらRails4.1からの変更のようだ。開発環境なのでdisableにする方法もありそうだけど。とりあえずgenerateしてsecrets.ymlに記述する(本番運用のやつとかくれぐれも公開してはいけない)。

$ touch [RAILS_ROOT]/config/secrets.yml
$ bundle exec rake secret RAILS_ENV=development
83f2e8aad08ebb94e71d8b3d788391b34b6865773e68a6857e1c0c1eb9ff40f479977a9df4e37458d35ef1c003ed7d2ebb21c67cf38125ce1fcf2d976b58b604
secrets.yml
development:
  secret_key_base: 83f2e8aad08ebb94e71d8b3d788391b34b6865773e68a6857e1c0c1eb9ff40f479977a9df4e37458d35ef1c003ed7d2ebb21c67cf38125ce1fcf2d976b58b604

ここまでやって、

$ bundle exec rail s

で起動できました。ちなみに、初期のユーザはユーザ名、パスワードともにadminでログインできるようです。

Redmine.jpg

6
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
y_minowa
大学在学中より勤務し、「エンジニアの魂を持ったビジネスマンであること」をモットーとして、日々奮闘しています。一児の父。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
6
Help us understand the problem. What is going on with this article?