Encoding Ruby on Rails |
Top Previous Next |
It's very easy to encode Ruby on Rails application with RubyEncoder. And to keep this process simple we don't cover any advanced options here. After trying to encode your Rails application and running it, you may review other options of RubyEncoder starting from the Project section in this manual.
1. Start from making a full copy of your RoR application in the new folder. That new folder will be the destination folder for your encoded application.
You need to copy the application to the new folder because RoR application contains many other files beside those you encode. These files include non-Ruby files which you cannot encode with RubyEncoder, standard RoR Ruby files which you technically may encode but there is no reason for encoding standard RoR files as they are open source, configuration Ruby files from /config subfolder (which technically you may encode later if necessary, see below).
2. Run RubyEncoder and add your source /app folder to the project. Add source, not copied folders. Select target versions of PHP according to your version or versions of Ruby that runs your Rails application.
When adding the files, navigate using the tree view on the left hand side panel in the popup window, select folders using the right hand side panel.
Please see the result on the screenshot below. Screenshots were taken on Mac (sorry Windows and Linux users) but it works and looks exactly the same on any platforms where you run RubyEncoder. File types will be automatically set as 'Ruby Script' for your *.rb files in the /app folder.
3. Select the destination folder by clicking 'Choose' button. Select the target folder you copied your original source to during the first stage above.
4. Click 'Encode'. Files you added to the project will be copied form the source to the destination folder (overwriting old files) and then will be encoded in the target folder, to keep your source intact. Results of encoding are shown in the popup window.
Note, you cannot encode any non-Ruby files with RubyEncoder. E.g. *.erb will not be encoded but will be copied to the destination.
5. The loaders installation windows appears with the destination folder selected. Choose the target platform or platforms to copy the loaders, click 'Install'.
Loaders for selected platforms will be copied to the /rgloader folder within your target encoded application folder. Select the platforms that will run your encoded RoR application. Also you may add or update the loaders later.
6) Open your favourite terminal and start the encoded Rails application from the destination folder selected in the above steps.
cd /path/to/your-encoded-application bin/rails server
Check results in your web browser as usual. If you have any questions, please don't hesitate to contact us support@rubyencoder.com
If you also need to encode your RoR application configuration files, those stored in /config subfolder, please read below. Note, you may encode only Ruby files, you can't encode say YAML database config (as it's not Ruby).
1) Select the root element in the project tree and click 'Add', select /config folder in your source RoR directory, add it to the project.
2) Open Advanced settings and select 'Rails compatibility mode'.
You may find more information about this option in this topic.
3) Click 'Encode', install loaders if not installed yet, run the encoded application. Done.
|