Giter Site home page Giter Site logo

Comments (9)

agentzh avatar agentzh commented on August 20, 2024 2

@roadsigngit In this example, you are missing the resty command-line utility in your PATH environment, which is shipped with OpenResty or from its original github repository openresty/resty-cli.

from opm.

agentzh avatar agentzh commented on August 20, 2024

@roadsigngit opm assumes the directory layout of OpenResty. For custom setup, you'll have to either 1) copy the OpenResty directory structure or 2) add the paths of your resty, nginx, and luajit executables to your PATH environment.

from opm.

agentzh avatar agentzh commented on August 20, 2024

@roadsigngit It's generally a bad idea to use opm outside OpenResty since you are simply asking for troubles :) It could work but you need to be very careful.

from opm.

roadsigngit avatar roadsigngit commented on August 20, 2024

thanks agentzh,i act on your suggestion and it works!

from opm.

Tinywan avatar Tinywan commented on August 20, 2024

ERROR: luajit is required but is not available according to resty:

tinywan@tinywan:/opt/openresty/bin$ resty -e 'print("hello")'
hello
tinywan@tinywan:/opt/openresty/bin$ sudo ./opm get bungle/lua-resty-session
* Fetching bungle/lua-resty-session  
  Downloading https://opm.openresty.org/api/pkg/tarball/bungle/lua-resty-session-2.17.opm.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 33837  100 33837    0     0   273k      0 --:--:-- --:--:-- --:--:--  275k
* Fetching openresty/lua-resty-string  
  Downloading https://opm.openresty.org/api/pkg/tarball/openresty/lua-resty-string-0.09.opm.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6163  100  6163    0     0  50432      0 --:--:-- --:--:-- --:--:-- 50516
sh: 1: resty: not found
ERROR: luajit is required but is not available according to resty:

from opm.

agentzh avatar agentzh commented on August 20, 2024

@Tinywan You know that sudo may have a different PATH env than your default shell session? You can try sudo resty -e 'print("hello")' instead.

from opm.

Tinywan avatar Tinywan commented on August 20, 2024

@agentzh thanks ,

tinywan@tinywan:~/Lua$ sudo resty -e 'print("hello")'
sudo: resty:Can not find command

switch root install success

[root@/opt/openresty/bin]# ./opm --cwd get bungle/lua-resty-session
* Fetching bungle/lua-resty-session  
  Downloading https://opm.openresty.org/api/pkg/tarball/bungle/lua-resty-session-2.17.opm.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 33837  100 33837    0     0   261k      0 --:--:-- --:--:-- --:--:--  262k
* Fetching openresty/lua-resty-string  
  Downloading https://opm.openresty.org/api/pkg/tarball/openresty/lua-resty-string-0.09.opm.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6163  100  6163    0     0  42986      0 --:--:-- --:--:-- --:--:-- 44338
Package openresty/lua-resty-string 0.09 installed successfully under /opt/openresty/bin/resty_modules/ .
Package bungle/lua-resty-session 2.17 installed successfully under /opt/openresty/bin/resty_modules/ .

from opm.

agentzh avatar agentzh commented on August 20, 2024

@Tinywan This is Linux basics. You should either change your suders file or just pass the -E option to the sudo command.

from opm.

Tinywan avatar Tinywan commented on August 20, 2024

@agentzh thanks ,this is OK

su - root
vim /etc/sudoers
tinywan ALL=(ALL:ALL) ALL
wq!

from opm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.