2014-12-12 2 views
0

OpenShift Online에 대한 git push를 수행 할 때이 번들 설치 오류 (mysql gem에서)를 수정하는 방법을 알 수 없습니다. mysql 젬에 도착하면 make를 할 때 "lmysqlclient"를 찾을 수 없다는 에러가 발생한다.확장 된 OpenShift Online 응용 프로그램의 mysql gem에서 번들 설치가 실패합니다.

간단한 퀵 스타트에서 레일 5 응용 프로그램을 MySQL5.5와 함께 OpenShift Online에서 만들었습니다. RAILS_ENV가 "개발"로 설정되어 있고 깨끗한 빌드가 필요합니다.

나는 그것이 응용 프로그램이 및 RAILS_ENV이 = '개발'의 크기를 조절할 때 발생합니다 MySQL의 보석에 도달 할 때 번들에 오류가를 설치 얻고있다.

스케일링되지 않은 (Rails 4 with MySQL 5.5) 앱을 만들고 RAILS_ENV = 'development'로 설정하면 잘 동작합니다. 그러나 나는 "스케일 된"응용 프로그램을 사용하여 DB 호스트를 노출 시켜야만 Iron.io 작업자가 사용자 및 기타 정보를 조회 할 수 있습니다.

참고 : RAILS_ENV = 'production'일 때 제대로 작동하지만 OpenShift Online에서 실행되는 여러 환경 관련 버전 (예 : app-dev, app-stg, app)을 갖게 될 것입니다. RAILS_ENV를 '개발'로 설정해야하는 이유는 무엇입니까?

.openshift/marker 아래에 force_clean_build 표시가 있습니다.

내가에있는 코드 .openshift/action_hooks/pre_build :

remote: Ruby cartridge in development mode, skipping stop... 
remote: Repairing links for 1 deployments 
remote: Syncing git content to other proxy gears 
remote: Force clean build enabled - cleaning dependencies 
remote: Building git ref 'master', commit bc3ac62 
remote: bundle install --deployment --path /var/lib/openshift/548b3d09fcf933241c0001b6/app-root/repo/vendor/bundle 
remote: Fetching gem metadata from https://rubygems.org/......... 
remote: Installing rake (0.9.6) 
remote: Installing i18n (0.6.11) 
remote: Installing json (1.8.1) 
remote: Installing minitest (5.4.3) 
remote: Installing thread_safe (0.3.4) 
remote: Installing tzinfo (1.2.2) 
remote: Installing activesupport (4.1.4) 
remote: Installing builder (3.2.2) 
remote: Installing erubis (2.7.0) 
remote: Installing actionview (4.1.4) 
remote: Installing rack (1.5.2) 
remote: Installing rack-test (0.6.2) 
remote: Installing actionpack (4.1.4) 
remote: Installing mime-types (1.25.1) 
remote: Installing polyglot (0.3.5) 
remote: Installing treetop (1.4.15) 
remote: Installing mail (2.5.4) 
remote: Installing actionmailer (4.1.4) 
remote: Installing activemodel (4.1.4) 
remote: Installing arel (5.0.1.20140414130214) 
remote: Installing activerecord (4.1.4) 
remote: Installing coffee-script-source (1.8.0) 
remote: Installing execjs (2.2.2) 
remote: Installing coffee-script (2.3.0) 
remote: Installing thor (0.19.1) 
remote: Installing railties (4.1.4) 
remote: Installing coffee-rails (4.0.1) 
remote: Installing hike (1.2.3) 
remote: Installing multi_json (1.10.1) 
remote: Installing jbuilder (2.2.5) 
remote: Installing jquery-rails (3.1.2) 
remote: Installing mysql2 (0.3.17) 
remote: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 
remote: 
remote:  /opt/rh/ruby200/root/usr/bin/ruby extconf.rb 
remote: checking for ruby/thread.h... yes 
remote: checking for rb_thread_call_without_gvl() in ruby/thread.h... yes 
remote: checking for rb_thread_blocking_region()... yes 
remote: checking for rb_wait_for_single_fd()... yes 
remote: checking for rb_hash_dup()... yes 
remote: checking for rb_intern3()... yes 
remote: ----- 
remote: Using mysql_config at /opt/rh/mysql55/root/usr/bin/mysql_config 
remote: ----- 
remote: checking for mysql.h... yes 
remote: checking for errmsg.h... yes 
remote: checking for mysqld_error.h... yes 
remote: ----- 
remote: Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load 
remote: ----- 
remote: ----- 
remote: Setting libpath to /opt/rh/mysql55/root/usr/lib64/mysql 
remote: ----- 
remote: creating Makefile 
remote: 
remote: make "DESTDIR=" 
remote: gcc -I. -I/opt/rh/ruby200/root/usr/include -I/opt/rh/ruby200/root/usr/include/ruby/backward -I/opt/rh/ruby200/root/usr/include -I. -I/opt/rh/mysql55/root/usr/include/mysql -DHAVE_RUBY_THREAD_H -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_RB_WAIT_FOR_SINGLE_FD -DHAVE_RB_HASH_DUP -DHAVE_RB_INTERN3 -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fPIC -m64 -o client.o -c client.c 
remote: gcc -I. -I/opt/rh/ruby200/root/usr/include -I/opt/rh/ruby200/root/usr/include/ruby/backward -I/opt/rh/ruby200/root/usr/include -I. -I/opt/rh/mysql55/root/usr/include/mysql -DHAVE_RUBY_THREAD_H -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_RB_WAIT_FOR_SINGLE_FD -DHAVE_RB_HASH_DUP -DHAVE_RB_INTERN3 -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fPIC -m64 -o infile.o -c infile.c 
remote: gcc -I. -I/opt/rh/ruby200/root/usr/include -I/opt/rh/ruby200/root/usr/include/ruby/backward -I/opt/rh/ruby200/root/usr/include -I. -I/opt/rh/mysql55/root/usr/include/mysql -DHAVE_RUBY_THREAD_H -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_RB_WAIT_FOR_SINGLE_FD -DHAVE_RB_HASH_DUP -DHAVE_RB_INTERN3 -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fPIC -m64 -o mysql2_ext.o -c mysql2_ext.c 
remote: gcc -I. -I/opt/rh/ruby200/root/usr/include -I/opt/rh/ruby200/root/usr/include/ruby/backward -I/opt/rh/ruby200/root/usr/include -I. -I/opt/rh/mysql55/root/usr/include/mysql -DHAVE_RUBY_THREAD_H -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_RB_WAIT_FOR_SINGLE_FD -DHAVE_RB_HASH_DUP -DHAVE_RB_INTERN3 -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mtune=generic -fPIC -m64 -o result.o -c result.c 
remote: rm -f mysql2.so 
remote: gcc -shared -o mysql2.so client.o infile.o mysql2_ext.o result.o -L. -L/opt/rh/ruby200/root/usr/lib64 -L/opt/rh/mysql55/root/usr/lib64/mysql -L. -fstack-protector -rdynamic -Wl,-export-dynamic -m64 -lruby -L/opt/rh/mysql55/root/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl -lpthread -lrt -ldl -lcrypt -lm -lc 
remote: /usr/bin/ld: cannot find -lmysqlclient 
remote: collect2: ld returned 1 exit status 
remote: make: *** [mysql2.so] Error 1 
remote: 
remote: 
remote: Gem files will remain installed in /var/lib/openshift/548b3d09fcf933241c0001b6/app-root/repo/vendor/bundle/ruby/gems/mysql2-0.3.17 for inspection. 
remote: Results logged to /var/lib/openshift/548b3d09fcf933241c0001b6/app-root/repo/vendor/bundle/ruby/gems/mysql2-0.3.17/ext/mysql2/gem_make.out 
remote: An error occurred while installing mysql2 (0.3.17), and Bundler cannot continue. 
remote: Make sure that `gem install mysql2 -v '0.3.17'` succeeds before bundling. 
remote: An error occurred executing 'gear postreceive' (exit code: 5) 
remote: Error message: CLIENT_ERROR: Failed to execute action hook 'pre_build' for 548b3d09fcf933241c0001b6 application rorscaled 
remote: 
remote: For more details about the problem, try running the command again with the '--trace' option. 
To ssh://[email protected]/~/git/rorscaled.git/ 
    3d4699e..bc3ac62 master -> master 

OpenShift 온라인 :

#!/bin/bash 
# This is a simple script and will be executed on your CI system if 
# available. Otherwise it will execute while your application is stopped 
# before the build step. This script gets executed directly, so it 
# could be python, php, ruby, etc. 

if [[ "$RUBY_VERSION" == "1.8" ]]; then 
    echo "ERROR: This quickstart is not compatible with Ruby 1.8" 
    echo "ERROR: Please use ruby-1.9 or ruby-2.0 application type." 
    exit 1 
fi 

source $OPENSHIFT_CARTRIDGE_SDK_BASH 
source ${OPENSHIFT_RUBY_DIR}/lib/ruby_context 

set -e 

pushd ${OPENSHIFT_REPO_DIR} > /dev/null 

if [[ -f .openshift/markers/force_clean_build && ("$RAILS_ENV" == "development" || "$RAILS_ENV" == "staging") ]] 
then 
    echo "bundle install --deployment --path ${OPENSHIFT_HOMEDIR}app-root/repo/vendor/bundle" 
    ruby_with_nodejs_context "bundle install --deployment --path ${OPENSHIFT_HOMEDIR}app-root/repo/vendor/bundle" 
fi 

popd > /dev/null 

(가) 나는 '자식 푸시'를 할 때 발생하는 로그입니다 이 크기 조정 된 응용 프로그램의 MYSQL 환경 변수 및 확장되지 않은 동일한 응용 프로그램 버전.

SCALED ----- 

OPENSHIFT_MYSQL_DB_GEAR_DNS=548b3d09fcf933241c0001b7-pervasivio.rhcloud.com 
OPENSHIFT_MYSQL_DB_GEAR_UUID=548b3d09fcf933241c0001b7 
OPENSHIFT_MYSQL_DB_HOST=548b3d09fcf933241c0001b7-pervasivio.rhcloud.com 
OPENSHIFT_MYSQL_DB_PORT=37891 
OPENSHIFT_MYSQL_DB_URL=mysql://adminHucinW7:[email protected]:37891/ 
OPENSHIFT_MYSQL_LD_LIBRARY_PATH_ELEMENT=/opt/rh/mysql55/root/usr/lib64 
OPENSHIFT_MYSQL_PATH_ELEMENT=/opt/rh/mysql55/root/usr/bin 

UNSCALED ----- 

OPENSHIFT_MYSQL_DB_HOST=127.4.220.2 
OPENSHIFT_MYSQL_DB_LOG_DIR=/var/lib/openshift/548b2e04e0b8cd0f2800005a/app-root/logs/ 
OPENSHIFT_MYSQL_DB_PORT=3306 
OPENSHIFT_MYSQL_DB_SOCKET=/var/lib/openshift/548b2e04e0b8cd0f2800005a/mysql//socket/mysql.sock 
OPENSHIFT_MYSQL_DB_URL=mysql://adminbZ743Ky:[email protected]:3306/ 
OPENSHIFT_MYSQL_DIR=/var/lib/openshift/548b2e04e0b8cd0f2800005a/mysql/ 
OPENSHIFT_MYSQL_IDENT=redhat:mysql:5.5:0.2.19 
OPENSHIFT_MYSQL_LD_LIBRARY_PATH_ELEMENT=/opt/rh/mysql55/root/usr/lib64 
OPENSHIFT_MYSQL_VERSION=5.5 
+0

어떤 카트리지를 사용하고 있습니까? 그리고 iron.io worker에서 rhc port-forward를 사용하고 있습니까? 그렇지 않으면 당신의 노동자는 어떻게 데이터베이스와 대화합니까? DB 장비의 FQDN은 세계에서 접근 할 수 없습니다 ... –

+0

Ruby 2.0 및 MySQL 5.5 카트리지를 사용하고 있습니다. 나는이 실수로 인해 iron.io 작업자와 연결하는 시점에 이르지 못했습니다. 나는 앱 외부에서 MySQL에 연결할 수 있도록 확장 된 앱으로 유료 계정을 가지고 있어야한다고 읽었다. DBHOST는 127.4.68.2 (또는 그와 비슷한 것)입니다. rhc port-forward를 사용하여 로컬 개발 환경에서 연결할 수 있습니다. 확장 및 크기 조정되지 않은 응용 프로그램 모두에 대해 MYSQL OpenShift 환경 변수 목록을 게시하므로 DB 호스트 및 다른 값의 차이를 확인할 수 있습니다. – lauracw100

+0

위의 정보를 너무 많이주었습니다 .-(그냥 철저히하고 싶었 습니다만, 진짜 문제는 RAILS_ENV = 개발시 MySQL 데이터베이스 (mysql gem)의 번들 설치 오류입니다. RAILS_ENV = 생산, 번들 설치에 아무런 문제가 없습니다. – lauracw100

답변

0

업데이트 : MySQL의 5.1 OpenShift 카트리지를 사용하여 다시 가서 오류가 해결 된

.

관련 문제