2011-02-23 3 views
1

Bundler를 Capistrano를 통해 사용하는 Rails 앱을 배포하려고합니다. MySQL과 MySQL2 gem은 호스트에서 빌드되지만 Capistrano 또는 SSH를 통해 빌드하지 않습니다.

** [out :: (my host)] Installing mysql2 (0.2.6) 
** [out :: (my host)] with native extensions 
*** [err :: (my host)] /usr/lib64/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) 
*** [err :: (my host)] 
*** [err :: (my host)] /usr/bin/ruby extconf.rb 
*** [err :: (my host)] checking for rb_thread_blocking_region()... no 
*** [err :: (my host)] checking for mysql_query() in -lmysqlclient... no 
*** [err :: (my host)] checking for main() in -lm... yes 
*** [err :: (my host)] checking for mysql_query() in -lmysqlclient... no 
*** [err :: (my host)] checking for main() in -lz... yes 
*** [err :: (my host)] checking for mysql_query() in -lmysqlclient... no 
*** [err :: (my host)] checking for main() in -lsocket... no 
*** [err :: (my host)] checking for mysql_query() in -lmysqlclient... no 
*** [err :: (my host)] checking for main() in -lnsl... yes 
*** [err :: (my host)] checking for mysql_query() in -lmysqlclient... no 
*** [err :: (my host)] checking for main() in -lmygcc... no 
*** [err :: (my host)] checking for mysql_query() in -lmysqlclient... no 
*** [err :: (my host)] *** extconf.rb failed *** 
*** [err :: (my host)] Could not create Makefile due to some reason, probably lack of 
*** [err :: (my host)] necessary libraries and/or headers. Check the mkmf.log file for more 
*** [err :: (my host)] details. You may need configuration options. 

그냥 MySQL의-DEV 패키지 또는 오른쪽으로 뭔가를 설치

: cap deploy:cold 실행

이 제공? 보석 (mysql과 mysql2)은 아무런 문제없이 Bundler로 시스템을 구축하고 다른 보석은 문제없이 설치하기 때문에.

카피 스트라 노가하는 일은 무엇이 다른가요?

+0

좋아 도움이되기를 바랍니다 :이 같은 전에 그것을 한 적이 (SSH user @ host 'cd dir; 번들 설치 --deployment --local --path gem_path'')가 작동하지 않습니다. – madh

답변

1

쉘 환경이 직접 로그인하는 것과 같은 방법으로로드되지 않아서 mysqlclient 라이브러리를 찾을 수없는 경우 일 수 있습니다.

일반적으로 정보를 제공 할 수있는 mysql_config를 찾을 수 있기를 원할 것입니다. --with-mysql-config=/path/to/mysql_config을 작성자에게 전달하는 방법을 파악할 수 있다면 도움이 될 것으로 생각됩니다. gem install mysql2 -- --with-mysql-config=/path/to/mysql_config

나는 들러가 그렇게하는 방법을 잘 모르겠어요,하지만 난 좀 더이를 바라 보 고 노력하고 있음을 깨달았다,이 정보가

+0

그게 전부 야. PATH가 다르다는 것을 알았습니다. 나는이 경로를 내 config/deploy.rb에 추가하여 기본 PATH을 모방했다. 'set : default_environment, { 'PATH'=> "path_to_mysql_bin_directory : $ PATH" }'' – madh

관련 문제