- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我似乎无法弄清楚如何修复当我向 OpenShift Online 进行 git 推送时遇到的这个 bundle 安装错误(在 mysql gem 上)。当它到达 mysql gem 时,我在执行 make 时收到错误“cannot find -lmysqlclient”(见下文)。
我使用 MySQL5.5 在 OpenShift Online 上创建了一个简单的(从快速入门)可扩展的 Rails 4 应用程序。我已将 RAILS_ENV 设置为“开发”,并强制进行干净的构建。
当 bundle 安装到达 mysql gem 时,我遇到一个错误,该错误仅在应用程序缩放且 RAILS_ENV = 'development' 时发生。
当我创建与未缩放相同的应用程序(带有 MySQL 5.5 的 Rails 4)并设置 RAILS_ENV = 'development' 时,它工作正常。但我必须使用“缩放”应用程序来公开我的 Iron.io 工作人员可以连接的数据库主机以查找用户和其他信息。
注意:当 RAILS_ENV = 'product' 时它工作正常,但我将在 OpenShift Online 上运行多个特定于环境的应用程序版本(例如 app-dev、app-stg、app),这就是为什么我需要将 RAILS_ENV 设置为“开发”。
我在.openshift/markers 下有一个force_clean_build 标记。
这是我在 .openshift/action_hooks/pre_build 中的代码:
#!/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
这是我执行“git Push”时发生的情况的日志:
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://548b3d09fcf933241c0001b6@rorscaled-pervasivio.rhcloud.com/~/git/rorscaled.git/
3d4699e..bc3ac62 master -> master
此缩放应用程序以及该应用程序的相同未缩放版本的 OpenShift Online 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:yVMbdWxil46k@548b3d09fcf933241c0001b7-pervasivio.rhcloud.com: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:PnvGtW7CfScB@127.4.220.2: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
最佳答案
更新:
我重新使用 MySQL 5.1 OpenShift 卡带,错误已解决。
关于mysql - 在缩放的 OpenShift Online 应用程序中, bundle 安装在 mysql gem 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27451870/
我正在通过 labrepl 工作,我看到了一些遵循此模式的代码: ;; Pattern (apply #(apply f %&) coll) ;; Concrete example user=> (a
我从未向应用商店提交过应用,但我会在不久的将来提交。 到目前为止,我对为 iPhone 而非 iPad 进行设计感到很自在。 我了解,通过将通用PAID 应用放到应用商店,客户只需支付一次就可以同时使
我有一个应用程序,它使用不同的 Facebook 应用程序(2 个不同的 AppID)在 Facebook 上发布并显示它是“通过 iPhone”/“通过 iPad”。 当 Facebook 应用程序
我有一个要求,我们必须通过将网站源文件保存在本地 iOS 应用程序中来在 iOS 应用程序 Webview 中运行网站。 Angular 需要服务器来运行应用程序,但由于我们将文件保存在本地,我们无法
所以我有一个单页客户端应用程序。 正常流程: 应用程序 -> OAuth2 服务器 -> 应用程序 我们有自己的 OAuth2 服务器,因此人们可以登录应用程序并获取与用户实体关联的 access_t
假设我有一个安装在用户设备上的 Android 应用程序 A,我的应用程序有一个 AppWidget,我们可以让其他 Android 开发人员在其中以每次安装成本为基础发布他们的应用程序推广广告。因此
Secrets of the JavaScript Ninja中有一个例子它提供了以下代码来绕过 JavaScript 的 Math.min() 函数,该函数需要一个可变长度列表。 Example:
当我分别将数组和对象传递给 function.apply() 时,我得到 NaN 的 o/p,但是当我传递对象和数组时,我得到一个数字。为什么会发生这种情况? 由于数组也被视为对象,为什么我无法使用它
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界. 这篇CFSDN的博客文章ASP转换格林威治时间函数DateDiff()应用由作者收集整理,如果你
我正在将列表传递给 map并且想要返回一个带有合并名称的 data.frame 对象。 例如: library(tidyverse) library(broom) mtcars %>% spl
我有一个非常基本的问题,但我不知道如何实现它:我有一个返回数据框,其中每个工具的返回值是按行排列的: tmp<-as.data.frame(t(data.frame(a=rnorm(250,0,1)
我正在使用我的 FB 应用创建群组并邀请用户加入我的应用群组,第一次一切正常。当我尝试创建另一个组时,出现以下错误: {"(OAuthException - #4009) (#4009) 在有更多用户
我们正在开发一款类似于“会说话的本”应用程序的 child 应用程序。它包含大量用于交互式动画的 JPEG 图像序列。 问题是动画在 iPad Air 上播放正常,但在 iPad 2 上播放缓慢或滞后
我关注 clojure 一段时间了,它的一些功能非常令人兴奋(持久数据结构、函数式方法、不可变状态)。然而,由于我仍在学习,我想了解如何在实际场景中应用,证明其好处,然后演化并应用于更复杂的问题。即,
我开发了一个仅使用挪威语的应用程序。该应用程序不使用本地化,因为它应该仅以一种语言(挪威语)显示。但是,我已在 Info.plist 文件中将“本地化 native 开发区域”设置为“no”。我还使用
读完 Anthony's response 后上a style-related parser question ,我试图说服自己编写单体解析器仍然可以相当紧凑。 所以而不是 reference ::
multicore 库中是否有类似 sapply 的东西?还是我必须 unlist(mclapply(..)) 才能实现这一点? 如果它不存在:推理是什么? 提前致谢,如果这是一个愚蠢的问题,我们深表
我喜欢在窗口中弹出结果,以便更容易查看和查找(例如,它们不会随着控制台继续滚动而丢失)。一种方法是使用 sink() 和 file.show()。例如: y <- rnorm(100); x <- r
我有一个如下所示的 spring mvc Controller @RequestMapping(value="/new", method=RequestMethod.POST) public Stri
我正在阅读 StructureMap关于依赖注入(inject),首先有两部分初始化映射,具体类类型的接口(interface),另一部分只是实例化(请求实例)。 第一部分需要配置和设置,这是在 Bo
我是一名优秀的程序员,十分优秀!