1

On Ubuntu 18.04 using the instructions here I've installed OpenLiteSpeed via the CyberPanel install, and then installed Ruby using the following commands in the terminal/console:

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
apt install rbenv libreadline-dev ruby-dev -y
export TMPDIR=/mytmp/
rbenv install 2.5.0
rbenv global 2.5.0
gem install rack -v 1.6.11
gem install ruby-lsapi

But now I'm confused about the paths and where to "setup context". The instructions above show the default ruby location different to the instructions for Litespeed and different to where I've found ruby on the server and the ENV values. The locations on the server for 'ruby' are:

/root/.rbenv/versions/2.5.0/bin/ruby
/root/.rbenv/shims/ruby
/etc/apparmor.d/abstractions/ruby

The command gem env shows the following:

Installation directory: /var/lib/gems/2.5.0
User installation directory: /root/.gem/ruby/2.5.0
Ruby executable: /usr/bin/ruby2.5
Executable directory: /usr/local/bin/

In the OpenLiteSpeed admin panel under Server Configuration > App Server I've found Rack/Rails Default Settings. What should I add here for Ruby Path and what other configuration would I need to do please?

I have limited knowledge of Ubuntu/Linux and OpenLiteSpeed, and almost zero knowledge about Ruby.

EDIT: I'm installing Ruby only because I want to install and test ShareTribe which requires Ruby.

EDIT: I've removed Ruby 2.5 and installed 2.6 with the following commands:

sudo apt-get purge ruby
wget http://ftp.ruby-lang.org/pub/ruby/2.6/ruby-2.6.6.tar.gz
tar -xzvf ruby-2.6.6.tar.gz
cd ruby-2.6.6/
./configure
make ...SLOW
sudo make install

All looked good so far, but then the next command gem install bundler gave the error /usr/bin/gem: no such file or directory. So another path error.

Nick W
  • 877
  • 2
  • 15
  • 30
  • Do you really need to use a ruby version manager for your setup? Will you be running multiple versions of Ruby on your server? – lacostenycoder Apr 10 '20 at 14:44
  • @lacostenycoder I've always steered clear of Ruby in the past working on the KISS principle. Now I want to test ShareTribe which requires it (I've just added a note about it in my question). I don't yet understand the architecture of Ruby but I think we can assume only the one version for ShareTribe will be required. – Nick W Apr 10 '20 at 15:16
  • where are you hosting this? [docs you linked to on sharetribe](https://github.com/sharetribe/sharetribe#requirements) say Heroku, Ruby 2.65 etc – lacostenycoder Apr 10 '20 at 15:55
  • Digitalocean droplet. I saw today that the ShareTribe docs say Ruby 2.6.5, I don't know why I chose 2.5. – Nick W Apr 10 '20 at 16:15
  • but what about docs which say Heroku which is a cloud hosting platform? – lacostenycoder Apr 10 '20 at 16:23
  • If I understand correctly Heroku is just different cloud hosting infrastructure. Infact there's a question on DO's community forum about installing ShareTribe https://www.digitalocean.com/community/questions/install-sharetribe-tutorial which links to an article on how to install on Ubuntu, https://freedif.org/how-to-install-sharetribe-for-ubuntu-16-04 And there are people on the ShareTribe community forum running ST on DO eg: https://www.sharetribe.com/community/t/sharetribe-version-7-3-0-is-now-available/995/6 – Nick W Apr 10 '20 at 17:17

1 Answers1

1

From the docs you've linked to it seems you have a few issues, some are not related at all to ruby. However it seems that the documentation for using Ruby on Rails in OpenLiteSpeed are instructing you to use a older version of Ruby than what is required in the documentation for ShareTribe requirements which seem to require you use Heroku for hosting your application. There may be ways to get all of this work on other platforms, but you are traversing the waters of DevOps Hell in which case you may want to post some questions on https://devops.stackexchange.com/

From what I can see you'll need to follow instructions to install ruby 2.65 in place of 2.5.0 but you may want to check with OpenLiteSpeed support to make sure it is supported.

As for SharTribe you'll also want to find out if they will support running on your Digital Ocean droplet.

lacostenycoder
  • 10,623
  • 4
  • 31
  • 48
  • Thanks for your advice @lacostenycoder I've updated Ruby to 2.6 but then got a path error when I tried to install bundler. – Nick W Apr 16 '20 at 15:05
  • I need to re-configure the gem path reference from /usr/bin/gem to /usr/local/bin/gem but struggling to find a suitable instructions for a ruby novice. – Nick W Apr 16 '20 at 15:38