0

I'm trying to set up a production ubuntu 24.04 system with redmine 5.1.9 running in a user account. We have no intention of doing any ruby development whatsoever.

I've installed apache, mysql, build-essential, using sudo apt install <pkg-name>

I need to run redmine from a user account. I've installed rvm in "Mixed Mode", with a system-wide ruby. /usr/local/rvm/gems/ruby-3.2.3/gems has the following gems: bundler-2.7.1 passenger-6.0.27 rack-3.1.16 rackup-2.2.1

In the user account, I've done "rvm user gemsets".

Passenger complains about not being able to find the gems for redmine; it appears to be looking at the system gems:

Raw Bundler exception: Could not find rails-6.1.7.10, rouge-4.2.1, request_store-1.5.1,... 

Those gems are in the user account, at

/home/my-user/.rvm/gems/ruby-3.2.3/gems/ 

Apache config:

 PassengerRuby /usr/local/rvm/gems/ruby-3.2.3/wrappers/ruby PassengerAppRoot /home/my-user/redmine_test/ PassengerAppEnv redmine_test PassengerAppGroupName redmine_test RailsBaseURI /my-redmine-test PassengerUser my-user PassengerGroup my-user PassengerFriendlyErrorPages on 

There is no ruby installed in the user account, so I can't set PassengerRuby to point there; I thought that was the whole point of mixed mode with rvm.

Passenger reports the following:

1. You may not have installed all the gems that this application needs. 2. If the necessary gems are installed, but Bundler may not have permissions to access them. Bundler tried to load the gems from #<struct Bundler::Settings::Path explicit_path=nil, system_path=false>. 3. The application may be run under the wrong user account or execution environment. It is currently running as my-user. 4. The application may be run under the wrong Ruby interpreter. It is currently being run under /usr/local/rvm/gems/ruby-3.2.3/wrappers/ruby. 5. The application may be run under the wrong RVM gemset. It is currently running under the ruby-3.2.3 gemset. 6. You are using a system-wide-installed RVM Ruby installation. It is possible that, at the same time, your gems are installed to the home directory (/home/my-user/.rvm/gems). If this is the case then RVM will not be able to use those gems. You are currently using this Ruby interpreter: /usr/local/rvm/gems/ruby-3.2.3/wrappers/ruby 

#6 appears to be the problem. Does this mean rvm "mixed-mode" does not work with Passenger, and I need to install a complete ruby in each user account?

5
  • RVM is literally made for what you attempt to do. Use it. Commented Jul 25 at 22:08
  • @vidarlo I've reworded the question based on an rvm install, but still problems. Thanks. Commented Jul 29 at 3:20
  • Install gems system-wide into the 'global' gemset. Commented Jul 29 at 5:41
  • @AlexD that would defeat the purpose of running from a user account, and disrupt other apps running under different users. I tried adding "SetEnv GEM_PATH /home/my-user/.rvm/gems/ruby-3.2.3:/usr/local/rvm/gems/default" but it appears not to be used. Does bundler under passenger ignore this? Commented Jul 29 at 16:18
  • If you plan to use this ruby with other applications, then you can create a separate gemset for redmine and use an appropriate wrapper, e.g. /usr/local/rvm/gems/ruby-3.2.3@redmine/wrappers/ruby for gemset 'redmine'. Commented Jul 29 at 17:22

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.