Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot load such file -- oxidized/script/cli #33

Open
Moonbeam4520 opened this issue Jun 3, 2019 · 5 comments
Open

cannot load such file -- oxidized/script/cli #33

Moonbeam4520 opened this issue Jun 3, 2019 · 5 comments

Comments

@Moonbeam4520
Copy link

i just installed oxs with gem install oxidized-script as root,
when I launch oxs as oxidized user, it gives this error

/usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require': cannot load such file -- oxidized/script/cli (LoadError)
	from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
	from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
	from /var/lib/gems/2.1.0/gems/oxidized-script-0.6.0/bin/oxs:4:in `<top (required)>'
	from /usr/local/bin/oxs:23:in `load'
	from /usr/local/bin/oxs:23:in `<main>'
@sorano
Copy link

sorano commented Jun 12, 2019

I am experiencing the same thing:

oxidized@nms:~/.config/oxidized$ oxs
Traceback (most recent call last):
        5: from /usr/local/bin/oxs:23:in `<main>'
        4: from /usr/local/bin/oxs:23:in `load'
        3: from /var/lib/gems/2.5.0/gems/oxidized-script-0.6.0/bin/oxs:4:in `<top (required)>'
        2: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:34:in `require'
        1: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
/usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:130:in `require': cannot load such file -- oxidized/script/cli (LoadError)

I did this as a workaround, might not be the prettiest solution but at least it works for now:
sudo visudo
oxidized ALL=(ALL) NOPASSWD: /usr/local/bin/oxs

oxidized@nms:~/.config/oxidized$ sudo oxs
no host given

@davama
Copy link

davama commented Jun 24, 2019

Same...

/usr/local/rvm/gems/ruby-2.3.8/bin/oxs -u $USER -p $loginpass -m procurve host 'sh ll i r' 
/usr/local/rvm/rubies/ruby-2.3.8/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:130:in `require': cannot load such file -- oxidized/script/cli (LoadError)
	from /usr/local/rvm/rubies/ruby-2.3.8/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
	from /usr/local/rvm/rubies/ruby-2.3.8/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:34:in `require'
	from /usr/local/rvm/gems/ruby-2.3.8/gems/oxidized-script-0.6.0/bin/oxs:4:in `<top (required)>'
	from /usr/local/rvm/gems/ruby-2.3.8/bin/oxs:23:in `load'
	from /usr/local/rvm/gems/ruby-2.3.8/bin/oxs:23:in `<main>'
	from /usr/local/rvm/gems/ruby-2.3.8/bin/ruby_executable_hooks:24:in `eval'
	from /usr/local/rvm/gems/ruby-2.3.8/bin/ruby_executable_hooks:24:in `<main>'

@DoctorHurt
Copy link

Same problem here. I found a file cli.rb that was only executable by root.
To fix, I changed it to world-executable and I can now run oxs with no problems as the oxidized user.

root@netnms01:/var/lib/gems/2.5.0/gems/oxidized-script-0.6.0/lib/oxidized/script# ll
drwxr-xr-x 3 root root 4096 Aug 14 15:51 ./
drwxr-xr-x 3 root root 4096 Aug 14 15:51 ../
-rwx------ 1 root root 6210 Aug 14 15:51 cli.rb*
-rw-r--r-- 1 root root   95 Aug 14 15:51 command.rb
drwxr-xr-x 2 root root 4096 Aug 14 15:51 commands/
-rw-r--r-- 1 root root 3783 Aug 14 15:51 script.rb
root@netnms01:/var/lib/gems/2.5.0/gems/oxidized-script-0.6.0/lib/oxidized/script# chmod 755 cli.rb

@davama
Copy link

davama commented Aug 14, 2019

Same problem here. I found a file cli.rb that was only executable by root.
To fix, I changed it to world-executable and I can now run oxs with no problems as the oxidized user.

Interesting, will have to try

@michelbragaguimaraes
Copy link

Same problem here. I found a file cli.rb that was only executable by root. To fix, I changed it to world-executable and I can now run oxs with no problems as the oxidized user.

root@netnms01:/var/lib/gems/2.5.0/gems/oxidized-script-0.6.0/lib/oxidized/script# ll
drwxr-xr-x 3 root root 4096 Aug 14 15:51 ./
drwxr-xr-x 3 root root 4096 Aug 14 15:51 ../
-rwx------ 1 root root 6210 Aug 14 15:51 cli.rb*
-rw-r--r-- 1 root root   95 Aug 14 15:51 command.rb
drwxr-xr-x 2 root root 4096 Aug 14 15:51 commands/
-rw-r--r-- 1 root root 3783 Aug 14 15:51 script.rb
root@netnms01:/var/lib/gems/2.5.0/gems/oxidized-script-0.6.0/lib/oxidized/script# chmod 755 cli.rb

That worked for me.

On my case it was under: /usr/local/rvm/gems/ruby-2.6.0/gems/oxidized-script-0.6.0/lib/oxidized/script/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants