環境
- macOSX HighSierra
- Redmine 3.4
- ruby 2.4.5
- rails 4.2.0
今回の目標
redmineをmacOS上に表示させる。
方法
基本的に http://guide.redmine.jp/RedmineInstall/ を参考になります。
エラーと解決
その1
上記サイトに従って作業を勧めていくと、いくつかエラーにあたった。
$ bundle install --without development test
(略)
An error occurred while installing rmagick (2.16.0), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.16.0' --source 'https://rubygems.org/'` succeeds before bundling.
こんな感じでエラーメッセージが出てくるので、素直に$ gem install rmagick -v '2.16.0' --source 'https://rubygems.org/'
する。
$ sudo gem install rmagick -v '2.16.0' --source 'https://rubygems.org/'
(略)
checking for outdated ImageMagick version (<= 6.4.9)... no
checking for presence of MagickWand API (ImageMagick version >= 6.9.0)... no
(略)
extconf failed, exit code 1
なんだかちゃんとできていない。ImageMagickのバージョンがあっていないようなので https://qiita.com/sho012b/items/362abe993248c686fcf4 を参考に入れ直す。
再度、$ bundle install --without development test
を試すと成功。一安心。
その2
$ RAILS_ENV=production bundle exec rake db:migrate
rake aborted!
Mysql2::Error: Access denied for user 'root'@'localhost' (using password: YES)
(略)
こんなエラーがでてきた。'root'ではなく'redmine'で設定した気が。。
database.yml
を開く。
production:
adapter: mysql2
database: redmine
host: localhost
username: root
password: "パスワード"
encoding: utf8
やはりusername: root
なので'redmine'に変更する。
$ mysql.server restart
してから$ RAILS_ENV=production bundle exec rake db:migrate
した。解決。
その3
$ sudo chown -R redmine:redmine files log tmp public/plugin_assets
chown: redmine: illegal group name
よくわからないので無視。←
結果
redmineのガイドに沿って進めると、bundle exec rails server webrick -e production
でサーバーを起動し http://localhost:3000/ にアクセスするとredmineが表示されるようになる。
今回はここまで。