• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    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. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Ruby On Rails: how to execute through SSH rake or rails in the same way as provided CLI?

Alban Staehli

Regular Pleskian
Hi,

I have installed a Ruby on Rails app within Plesk Onyx 17.5.3 (on CentOS 7) - successful, thanks to the Plesk Ruby extension.
When I'm into Plesk admin UI, I can execute the rake task within the selected env. and version of Ruby. This works pretty well.

Nevertheless, I wish to run some commandes through SSH (for bash purpose, executed by crontab).
Therefore I went into the app folder and tried to execute rake:
Code:
 cd /path/to/AppRootFolder/
bundle exec rake -T
>> Could not find rake-12.3.2 in any of the sources
>> Run `bundle install` to install missing gems.
rake -T
>> Could not find rake-12.3.2 in any of the sources
>> Run `bundle install` to install missing gems.

So I tried to run bundle install (already done through the Plesk UI):
Code:
 bundle install
>> The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
>> Fetching gem metadata from https://rubygems.org/.........
>> i18n-1.6.0 requires ruby version >= 2.3.0, which is incompatible with the current version, ruby 2.0.0p648

Obviously, running these command from SSH shows that it is not within the same env. setup as the CLI from the UI, as the Ruby version in Plesk CLI is 2.4.4p296, and not 2.0.0p648.

So how to run command from SSH within the app root folder within the same env. setup as for the CLI available in Plesk UI? I want to execute commands directly from SSH in the same way I do it from the CLI in Plesk UI.

Thank you.
 
Back
Top