rails 4.0 中使用 cap 发布的时候,出现 LD_LIBRARY_PATH 没有设置的问题 的解决办法
来源:互联网 发布:c 并发编程实践 pdf 编辑:程序博客网 时间:2024/06/06 01:30
- 在ruby 2.2.1 和 rails 4.2.2 以及 capistrano 3.4.0 环境中 需要进行如下配置
在web_app/config/deploy/production.rb文件中 加入set :default_env,{ "LD_LIBRARY_PATH" => "/opt/oracle/instantclient_12_1" , "ORACLE_HOME" => '/opt/oracle/instantclient_12_1' , "NLS_LANG" => 'AMERICAN_AMERICA.UTF8' }
- 在 capistrano 2版本中 要进行如下处理
1.由于使用了 orcale的adapter
安装 ruby-oci8 -v '2.1.5'` 的时候会出现
** [out :: 192.168.10.188] /home/dev/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
** [out :: 192.168.10.188] checking for load library path...
** [out :: 192.168.10.188] LD_LIBRARY_PATH is not set.
** [out :: 192.168.10.188] checking ld.so.conf... no
** [out :: 192.168.10.188] checking for cc... ok
** [out :: 192.168.10.188] checking for gcc... yes
** [out :: 192.168.10.188] checking for LP64... yes
** [out :: 192.168.10.188] checking for sys/types.h... yes
** [out :: 192.168.10.188] checking for ruby header... ok
** [out :: 192.168.10.188] *** extconf.rb failed ***
** [out :: 192.168.10.188] Could not create Makefile due to some reason, probably lack of necessary
** [out :: 192.168.10.188] libraries and/or headers. Check the mkmf.log file for more details. You may
** [out :: 192.168.10.188] need configuration options.
** [out :: 192.168.10.188]
** [out :: 192.168.10.188] Provided configuration options:
** [out :: 192.168.10.188] --with-opt-dir
** [out :: 192.168.10.188] --without-opt-dir
** [out :: 192.168.10.188] --with-opt-include
** [out :: 192.168.10.188] --without-opt-include=${opt-dir}/include
** [out :: 192.168.10.188] --with-opt-lib
** [out :: 192.168.10.188] --without-opt-lib=${opt-dir}/lib
** [out :: 192.168.10.188] --with-make-prog
** [out :: 192.168.10.188] --without-make-prog
** [out :: 192.168.10.188] --srcdir=.
** [out :: 192.168.10.188] --curdir
** [out :: 192.168.10.188] --ruby=/home/dev/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
** [out :: 192.168.10.188] --with-instant-client
** [out :: 192.168.10.188] --without-instant-client
** [out :: 192.168.10.188] /home/dev/SysMaintain/shared/bundle/ruby/2.0.0/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:889:in `get_home': RuntimeError (RuntimeError)
** [out :: 192.168.10.188] from /home/dev/SysMaintain/shared/bundle/ruby/2.0.0/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:705:in `initialize'
** [out :: 192.168.10.188] from /home/dev/SysMaintain/shared/bundle/ruby/2.0.0/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:320:in `new'
** [out :: 192.168.10.188] from /home/dev/SysMaintain/shared/bundle/ruby/2.0.0/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:320:in `get'
** [out :: 192.168.10.188] from extconf.rb:18:in `<main>'
** [out :: 192.168.10.188] ---------------------------------------------------
** [out :: 192.168.10.188] Error Message:
** [out :: 192.168.10.188] Set the environment variable ORACLE_HOME if Oracle Full Client.
** [out :: 192.168.10.188] Append the path of Oracle client libraries to LD_LIBRARY_PATH if Oracle Instant Client.
** [out :: 192.168.10.188]
** [out :: 192.168.10.188] Backtrace:
** [out :: 192.168.10.188] /home/dev/SysMaintain/shared/bundle/ruby/2.0.0/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:889:in `get_home'
** [out :: 192.168.10.188] /home/dev/SysMaintain/shared/bundle/ruby/2.0.0/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:705:in `initialize'
** [out :: 192.168.10.188] /home/dev/SysMaintain/shared/bundle/ruby/2.0.0/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:320:in `new'
** [out :: 192.168.10.188] /home/dev/SysMaintain/shared/bundle/ruby/2.0.0/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:320:in `get'
** [out :: 192.168.10.188] extconf.rb:18:in `<main>'
** [out :: 192.168.10.188] ---------------------------------------------------
** [out :: 192.168.10.188] See:
** [out :: 192.168.10.188] * http://ruby-oci8.rubyforge.org/en/HowToInstall.html
** [out :: 192.168.10.188] * http://ruby-oci8.rubyforge.org/en/ReportInstallProblem.html
** [out :: 192.168.10.188]
** [out :: 192.168.10.188]
** [out :: 192.168.10.188]
** [out :: 192.168.10.188] Gem files will remain installed in /home/dev/SysMaintain/shared/bundle/ruby/2.0.0/gems/ruby-oci8-2.1.5 for inspection.
** [out :: 192.168.10.188] Results logged to /home/dev/SysMaintain/shared/bundle/ruby/2.0.0/gems/ruby-oci8-2.1.5/ext/oci8/gem_make.out
** [out :: 192.168.10.188] An error occurred while installing ruby-oci8 (2.1.5), and Bundler cannot
** [out :: 192.168.10.188] continue.
** [out :: 192.168.10.188] Make sure that `gem install ruby-oci8 -v '2.1.5'` succeeds before bundling.
错误,
解决办法 :
在 config/deploy.rb 中 设置环境变量
# -*- encoding : utf-8 -*-require "rvm/capistrano"require "bundler/capistrano"default_environment["LD_LIBRARY_PATH"] = "/opt/oracle/instantclient_12_1"default_environment["ORACLE_HOME"]= '/opt/oracle/instantclient_12_1'default_environment["NLS_LANG"] = 'AMERICAN_AMERICA.UTF8'set :application, "SysMaintain"
- rails 4.0 中使用 cap 发布的时候,出现 LD_LIBRARY_PATH 没有设置的问题 的解决办法
- tensorflow中LD_LIBRARY_PATH的问题
- LD_LIBRARY_PATH环境变量的设置
- LD_LIBRARY_PATH环境变量的设置
- LD_LIBRARY_PATH的设置
- LD_LIBRARY_PATH环境变量的设置
- LD_LIBRARY_PATH环境变量的设置
- LD_LIBRARY_PATH环境变量的设置
- LD_LIBRARY_PATH环境变量的设置
- ubuntu中LD_LIBRARY_PATH失效的问题
- ubuntu中LD_LIBRARY_PATH失效的问题
- windows下安装ruby on rails出现问题的解决办法
- LD_LIBRARY_PATH 的使用
- LD_LIBRARY_PATH的使用
- export LD_LIBRARY_PATH 的使用
- LD_LIBRARY_PATH的环境变量的设置
- IIS应用程序发布的时候出现的问题
- Alfresco在iis发布的时候出现的问题
- (转)Linux的rc.local自启动服务
- 针对 hadoop 中MapReduce 测试过程中的内存溢出的问题
- Java基本开发环境搭建
- PyGrADS使用实例入门指南
- SQL SERVER性能分析--死锁检测数据库阻塞语句
- rails 4.0 中使用 cap 发布的时候,出现 LD_LIBRARY_PATH 没有设置的问题 的解决办法
- DataDroid 刚开始接触和学习 一
- Quartz 2D编程指南(13) - PDF文档的创建、显示及转换
- OpenWRT编译报找不到 sys/soundcard.h 的解决方法
- delphi笔记1
- ASP验证码的生成
- 快速的 log2的算法。
- django handbook in chinese
- std::locale::global 的问题