Env: ‘ruby’: No such file or directory

I recently ran into this error when attempting to build my development dashboard (it was building fine a few days ago):

When I attempt to run bin/setup in ondemand/dev/dashboard from the code pulled from the development hpc-toolset-tutorial, I get the error “env: ‘ruby’: No such file or directory” (when I run it in the shell app located at https://localhost:3443/pun/sys/shell/ssh/default). I also attempted to run bin/setup from https://localhost:3443/pun/sys/shell/ssh/ondemand but when I attempt to install the necessary gems I get an error stating that I don’t have write permissions for the /usr/share/gems directory. I’ve pulled and repulled the code from the repo and followed the steps to build the dashboard (see below) but I consistently hit the same issue. I’ve also tried running ./hpcts destroy and ./hpcts cleanup in the Ubuntu server as well just to test everything.

Since I am on a Windows device after cloning the repository and running ./hpcts start, in the localhost shell I run:

git clone https://github.com/OSC/ondemand.git ~/ondemand-src-full
mkdir -p ~/ondemand/dev
cd ~/ondemand/dev
ln -s ../../ondemand-src-full/apps/dashboard/ dashboard
cd dashboard
git checkout release_3.0
bin/bundle config --local path vendor/bundle
bin/setup

(In the above code, the first error occurs at bin/bundle config --local path vendor/bundle)

I thought it could be an issue with something the hpc-toolset repository having been updated but I see no recent changes. As stated before, I wasn’t running into this issue a few days ago so I am unsure of what I could have changed to cause this error. If anyone’s experienced a similar issue before, please let me know how you worked to resolve it!

Thank you for any help!

First off, yea you need to be in the ondemand container to get the right Ruby version and so on. This is important because the other containers may not have ruby installed at all (as you’ve found out).

I believe the hpcadmin user does have sudo privileges inside the ondemand container, but even so, if you set and export your GEM_HOME environment variable, that should clear up the errors around trying to install into /usr/share. I generally set GEM_HOME=$HOME/.gem but you could do something else as well.

You could add it to your ~/.bashrc or add it to an /etc/profile.d file so long as the container stays running (if you bounce the container, these files will get reset).

That said - not sure why it’s happening to you all of the sudden like.

1 Like