Redmineをgit pullしてUpdate

redmine_update前の記事でRedmineをgit pullして最新に更新できるようにしたけど、実際やってみたらエラーになったときの覚書

環境: CentOS 6.7, Ruby 2.2.4p230




# rbenv install -l
# rbenv install 2.2.4
# rbenv global 2.2.4

# gem update --system

# gem install bundler

# gem list



実はエラーになってからRuby 2.2.4に上げたので、エラーになった時はRuby 2.2.2。

Redmineのリポジトリに移動してgit pull
# cd /opt/redmine
# git pull

# bundle update

エラー(下記エラーはRuby 2.2.2でbundle updateしたとき)

Warning: this Gemfile contains multiple primary sources. Using `source` more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run `bundle config disable_multisource true`.
Fetching gem metadata from
Fetching gem metadata from
Fetching version metadata from
Fetching version metadata from
Fetching dependency metadata from
Fetching dependency metadata from
Resolving dependencies....
Using rake 11.1.2 (was 10.4.2)
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.4 (was 5.8.3)
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport (was 4.2.5)
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.0.0

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /root/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20160420-22231-ima0g.rb extconf.rb --use-system-libraries
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
/root/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /root/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:571:in `block in try_compile'
        from /root/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:522:in `with_werror'
        from /root/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:571:in `try_compile'
        from extconf.rb:80:in `nokogiri_try_compile'
        from extconf.rb:87:in `block in add_cflags'
        from /root/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:619:in `with_cflags'
        from extconf.rb:86:in `add_cflags'
        from extconf.rb:336:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /opt/redmine/vendor/bundle/ruby/2.2.0/gems/nokogiri- for inspection.
Results logged to /opt/redmine/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/nokogiri-
An error occurred while installing nokogiri (, and Bundler cannot continue.
Make sure that `gem install nokogiri -v ''` succeeds before bundling



# bundle install --without development test --path vendor/bundle


make "DESTDIR="
compiling houdini_href_e.c
make: gcc: コマンドが見つかりませんでした
make: *** [houdini_href_e.o] エラー 127

# yum install gcc

# bundle install --without development test --path vendor/bundle


# bundle exec rake db:migrate RAILS_ENV=production
# bundle exec rake redmine:plugins:migrate RAILS_ENV=production
# bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production

# /etc/rc.d/init.d/redmine restart


< Related Posts >