Issue #11592 has been updated by Nobuyoshi Nakada.

Description updated
Status changed from Open to Third Party's Issue

Use the ruby embedded in chef.

----------------------------------------
Bug #11592: Chef-client returned 'cannot load such file -- OpEN'
https://bugs.ruby-lang.org/issues/11592#change-54449

* Author: Ally Kuo
* Status: Third Party's Issue
* Priority: Normal
* Assignee: 
* ruby -v: 1.8.7
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
i execute ruby(1.8.7) test.rb returned the correct value without error, 
but once i execute it by chef-client it will return as below error: 
can anyone help me for the issue? 
-------sys info-------- 

~~~
 root@localhost:/usr/bin# ruby -v 
 ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] 
 root@localhost:/usr/bin# uname -a 
 Linux switch1 3.5.0-23-generic #35~precise1 SMP Thu Apr 23 19:34:58 PDT 2015 x86_64 x86_64 x86_64 GNU/Linux 
root@localhost:/usr/bin# which ruby 
/usr/bin/ruby 
root@localhost:/usr/bin# lsb_release -a 
No LSB modules are available. 
Distributor ID: Ubuntu 
Description: Ubuntu 12.04 LTS 
Release: 12.04 
Codename: precise 
root@localhost:/usr/bin# chef-client -v 
Chef: 11.4.0 
~~~
------------------------------------------------

------------error---------------------- 

~~~
root@localhost:/usr/bin# chef-client 
Starting Chef Client, version 11.4.0 
resolving cookbooks for run list: ["apt"] 
Synchronizing Cookbooks: 
 - apt 
Compiling Cookbooks...

================================================================================ 
Recipe Compile Error in /var/chef/cache/cookbooks/apt/recipes/default.rb 
================================================================================

LoadError 
--------- 
cannot load such file -- OpEN

Cookbook Trace: 
--------------- 
 /var/chef/cache/cookbooks/apt/recipes/default.rb:11:in `from_file'

Relevant File Content: 
---------------------- 
/var/chef/cache/cookbooks/apt/recipes/default.rb:

4: # 
 5: # Copyright 2015, YOUR_COMPANY_NAME 
 6: # 
 7: # All rights reserved - Do Not Redistribute 
 8: # 
 9: 
 10: 
 11>> require "OpEN" 
 12: require "OpENUtil" 
 13: 
 14: open = OpENUtil.new() 
 15: conn_ret = open.connect("boa-vlan") 
 16: exists = false 
 17: if conn_ret == OpEN::OPEN_E_NONE 
 18: client = open.client 
 19: ret = OpEN::openapiVlanCreatedCheck(client,1) 
 20: if ret == OpEN::OPEN_E_NONE

[2015-10-14T01:44:54+00:00] ERROR: Running exception handlers 
[2015-10-14T01:44:55+00:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json 
[2015-10-14T01:44:55+00:00] ERROR: Exception handlers complete 
Chef Client failed. 0 resources updated 
[2015-10-14T01:44:55+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out 
[2015-10-14T01:44:55+00:00] FATAL: LoadError: cannot load such file -- OpEN 
~~~
--------------------------------------------


---Files--------------------------------
test.rb (494 Bytes)
OpENUtil.rb (2.78 KB)
OpEN.so (1.63 MB)


-- 
https://bugs.ruby-lang.org/