• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Question Ruby and NodeJS for user space (chrooted) not working

cool_sh

Basic Pleskian
Hi,

I wanted to use the latest Ruby 2.7 and NodeJS 14 versions but didn't get them work for the user space. I installed them (before the new extension supported auto-upgrade).

First installed the latest Ruby 2.7 on Plesk Obsidian.
Code:
mkdir -p "$(rbenv root)"/plugins
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
PREFIX=/usr/local .rbenv/plugins/ruby-build/install.sh

ruby-build 2.7.4 /opt/plesk/ruby/2.7.4
/opt/plesk/ruby/2.7.4/bin/gem install bundler
/opt/plesk/ruby/2.7.4/bin/gem install bundle
#/opt/plesk/ruby/2.7.4/bin/gem install rails
plesk sbin rubymng register 2.7.4 /opt/plesk/ruby/2.7.4

After running these commands, go to Plesk > Extensions > Ruby > and press "Refresh".

Then, set Ruby Version 2.7.4-p191 for the domain.

Switched to Shell for that user and showing the ruby version works but not for gem or rails:

Code:
[/] ruby --version
ruby 2.6.8p205 (2021-07-07 revision 67951) [x86_64-linux]

[/] rails --version
bash: rails: command not found

[/] gem --version
bash: rails: command not found


Second problem seems to be within NodeJS. Installed it but have no ide how to get NPM (or YARN) for it:

Code:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"

nvm install v14.17.6

mkdir /opt/plesk/node/14
yes | cp -R ~/.nvm/versions/node/v14.17.6/* /opt/plesk/node/14/
plesk sbin nodemng register /opt/plesk/node/14/bin/node

Code:
[/] node --version
v14.17.6

[/] npm --version
TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (/opt/plesk/node/14/lib/node_modules/npm/node_modules/socks-proxy-agent/dist/agent.js:114:44)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/opt/plesk/node/14/lib/node_modules/npm/node_modules/socks-proxy-agent/dist/index.js:5:33)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/opt/plesk/node/14/lib/node_modules/npm/node_modules/make-fetch-happen/lib/agent.js:161:25)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)

Any hint would be much appreciated.
 
Back
Top