Description

This function checks whether the server configured Ruby for the authenticated cPanel account.

 It confirms that the ruby-on-rail.db file exists in the authenticated user's cPanel directory.

Examples 




https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=RoR&cpanel_jsonapi_func=needsimport



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Was Ruby installed via cPanel?
$was_installed = $cpanel->api2(
    'RoR', 'needsimport'
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Was Ruby installed via cPanel?
my $was_installed = $cpliveapi->api2(
    'RoR', 'needsimport',
);

 




cpapi2 --user=username RoR needsimport



{
  "cpanelresult": {
    "apiversion": 2,
    "func": "needsimport",
    "data": [
      0
    ],
    "event": {
      "result": 1
    },
    "module": "RoR"
  }
}



Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
dataBooleanWhether the server configured Ruby for this cPanel account.
  • 1 — Configured.
  • 0Not configured.
0
reasonstring

A reason for failure.

This function only returns a reason value if it failed.


A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1