h1. Thin redmine 서버가 정상동작하지 않을 때 h2. Error의 원인 Redmine에 Google Calender Plug-In을 설치하다가 SSL Certification 문제로 Ruby의 bundle install에서 Error가 발생하였다. 다음과 같다.
C:\Bitnami\redmine-2.6.5-0\apps\redmine\htdocs>bundle install Fetching source index from https://rubygems.org/ Retrying source fetch due to error (2/3): Bundler::Fetcher::CertificateFailureEr ror Could not verify the SSL certificate for https://rubygems.org/. There is a chance you are experiencing a man-in-the-middle attack, but most like ly your system doesn't have the CA certificates needed for verification. For inf ormation about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without usi ng SSL, edit your Gemfile sources and change 'https' to 'http'. Retrying source fetch due to error (3/3): Bundler::Fetcher::CertificateFailureEr ror Could not verify the SSL certificate for https://rubygems.org/. There is a chance you are experiencing a man-in-the-middle attack, but most like ly your system doesn't have the CA certificates needed for verification. For inf ormation about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without usi ng SSL, edit your Gemfile sources and change 'https' to 'http'. Could not verify the SSL certificate for https://rubygems.org/. There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.Redmine의 버전이 너무 오래되어 Ruby 관련 및 Git, SSL등이 업그레이드 되었는데 해당되는 SSL 정책들이 바뀌었음에도 이를 제대로 반영하지 못했기 때문이다. 해결방법은 올바른 pem 파일을 잘 등록 시켜주고 이것으로 SSL Certification이 이루어지도록 하면 된다. h2. 이것이 성공적이었음 https://gist.github.com/fnichol/867550 에서 cacert.pem 파일을 받는다. cacert.pem 파일은 SSL 관련 업데이트가 크게 이루어질 때 마다, 변화하기 때문에 가급적 최신 pem 파일을 받아야 한다. 다음과 같이 환경변수를 잡고 C:\Bitnami\redmine-2.6.5-0\apps\redmine\htdocs>SET SSL_CERT_FILE=c:\Users\root\c acert.pem 테스트 해본다.
C:\Bitnami\redmine-2.6.5-0\apps\redmine\htdocs>gem sources *** CURRENT SOURCES *** https://rubygems.org/ C:\Bitnami\redmine-2.6.5-0\apps\redmine\htdocs>gem install bundler Fetching: bundler-1.16.2.gem (100%) Successfully installed bundler-1.16.2 Parsing documentation for bundler-1.16.2 Installing ri documentation for bundler-1.16.2 1 gem installed이렇다고 해서 thin_redmine이 Stop 되는 것이 고쳐지는 것은 아니다. 단지 bundler가 Update된 것일 뿐이다. 실제로 bundle install을 수행하자. 다음과 같이 정상적으로 install 됨을 확인할 수 있다.
C:\Bitnami\redmine-2.6.5-0\apps\redmine\htdocs>bundle install The dependency activerecord-jdbc-adapter (~> 1.3.2) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby, x86-mingw3 2 but the dependency is only for java. To add those platforms to the bundle, run `bundle lock --add-platform java`. The dependency activerecord-jdbcmysql-adapter (>= 0) will be unused by any of th e platforms Bundler is installing for. Bundler is installing for ruby, x86-mingw 32 but the dependency is only for java. To add those platforms to the bundle, ru n `bundle lock --add-platform java`. Fetching gem metadata from https://rubygems.org/.......... Fetching gem metadata from https://rubygems.org/. Resolving dependencies....... RubyGems 2.0.14 is not threadsafe, so your gems will be installed one at a time. Upgrade to RubyGems 2.1.0 or higher to enable parallel gem installation. Using rake 10.4.2 Fetching insensitive_hash 0.3.3 Installing insensitive_hash 0.3.3 Installing tzinfo 0.3.44 Fetching TimezoneParser 0.2.0 Installing TimezoneParser 0.2.0 Installing i18n 0.6.11 Installing multi_json 1.11.0 Installing activesupport 3.2.21 Installing builder 3.0.4 Installing activemodel 3.2.21 Installing erubis 2.7.0 Installing journey 1.0.4 Installing rack 1.4.5 Installing rack-cache 1.2 Installing rack-test 0.6.3 Installing hike 1.2.3 Installing tilt 1.4.1 Installing sprockets 2.2.3 Installing actionpack 3.2.21 Installing mime-types 1.25.1 Installing polyglot 0.3.5 Installing treetop 1.4.15 Installing mail 2.5.4 Installing actionmailer 3.2.21 Installing arel 3.0.3 Installing activerecord 3.2.21 Installing activeresource 3.2.21 Fetching public_suffix 2.0.5 Installing public_suffix 2.0.5 Fetching addressable 2.5.2 Installing addressable 2.5.2 Using bundler 1.16.2 Installing coderay 1.1.0 Installing daemons 1.1.9 Installing eventmachine 1.0.3 (x86-mingw32) Fetching multipart-post 2.0.0 Installing multipart-post 2.0.0 Fetching faraday 0.15.2 Installing faraday 0.15.2 Installing json 1.8.2 (x86-mingw32) Fetching jwt 1.5.6 Installing jwt 1.5.6 Fetching signet 0.8.1 Installing signet 0.8.1 Fetching google_calendar 0.5.2 Installing google_calendar 0.5.2 Installing rack-ssl 1.3.4 Installing rdoc 3.12.2 Installing thor 0.19.1 Installing railties 3.2.21 Installing jquery-rails 3.1.2 Installing mysql2 0.3.18 (x86-mingw32) Installing net-ldap 0.3.1 Installing ruby-openid 2.3.0 Installing rack-openid 1.4.2 Installing rails 3.2.21 Installing rbpdf 1.18.5 Installing redcarpet 2.3.0 (x86-mingw32) Installing request_store 1.0.5 Installing rmagick 2.13.4 (x86-mingw32) Installing thin 1.6.1 (x86-mingw32) Updating files in vendor/cache * insensitive_hash-0.3.3.gem * TimezoneParser-0.2.0.gem * public_suffix-2.0.5.gem * addressable-2.5.2.gem * multipart-post-2.0.0.gem * faraday-0.15.2.gem * jwt-1.5.6.gem * signet-0.8.1.gem * google_calendar-0.5.2.gem Bundle complete! 28 Gemfile dependencies, 53 gems now installed. Gems in the groups development, test and sqlite were not installed. Use `bundle info [gemname]` to see where a bundled gem is installed. Post-install message from rdoc: Depending on your version of ruby, you may need to install ruby rdoc/ri data: <= 1.8.6 : unsupported = 1.8.7 : gem install rdoc-data; rdoc-data --install = 1.9.1 : gem install rdoc-data; rdoc-data --install >= 1.9.2 : nothing to do! Yay! Post-install message from mysql2: ================================================================================ ====================== You've installed the binary version of mysql2. It was built using MySQL Connector/C version 6.1.5. It's recommended to use the exact same version to avoid potential issues. At the time of building this gem, the necessary DLL files were retrieved from: http://cdn.mysql.com/Downloads/Connector-C/mysql-connector-c-6.1.5-win32.zip This gem *includes* vendor/libmysql.dll with redistribution notice in vendor/R EADME. ================================================================================ ====================== Post-install message from rmagick: Please report any bugs. See https://github.com/gemhome/rmagick/compare/RMagick_2 -13-2...master and https://github.com/rmagick/rmagick/issues/18 C:\Bitnami\redmine-2.6.5-0\apps\redmine\htdocs>그 다음, *rake redmine:plugins:migrate RAILS_ENV=production* 을 수행하여 plugin을 등록해 준다.
C:\Bitnami\redmine-2.6.5-0\apps\redmine\htdocs>rake redmine:plugins:migrate RAILS_ENV=production DL is deprecated, please use Fiddle rake aborted! Mysql2::Error: Can't connect to MySQL server on '127.0.0.1' (10061)이렇게 모든 절차가 완료 되어야 Thin_Redmine서버가 정상적으로 동작하기 시작한다. 정상 동작까지는 약간의 시간이 걸린다 (약 2~3 분 정도 , PHP SQL에 해당 내용이 모두 반영되는데 시간이 걸리는 것으로 보인다.) h2. 참고사이트 https://gemfury.com/help/could-not-verify-ssl-certificate