The RAILSNEW command is meant to be a quick and easy way to start a new RubyOnRails project on your IBM i by configuring everything from start to finish including starting the Apache and Thin servers.
Below is an example of using the RAILSNEW command to create a new RubyOnRails application.
RAILSNEW VRM(*V20) PLACE(*WWW) RAILSAPP(A2222) DBUSR(A2222) DBPASS(A2222) DBROOT(A2222) HTTPSRV(A2222) EXTPATH('') EXTPORT(2222) INTPATH('') INTPORT(2202)
VRM - The Version, Release and Modification of PowerRuby to be used. Values and descriptions:
*V20 - Ruby 2.0.x + Rails 4.0.x
Learn more about PowerRuby versions here.
PLACE- There are currently two IFS locations the RAILSNEW command can be configured to locate the Rails application folder. A value of
*WWW will place it in /www/A2222/htdocs/A2222. A value of
*HOME will place it in /home/<your user profile>/A2222.
RAILSAPP - The name of the Rails app. This is supplied on rails new command like so:
rails new <RAILSAPP>
DBUSR - A new IBM i profile will be created using CRTUSRPRF command.
DBPASS - The password used in conjunction with DBUSR.
DBROOT - The root or base name of the collection (aka library). In this example, collections A2222_D and A2222_T will be created in /QSYS.LIB. This matches up with what is declared for the development and test sections of the database.yaml file.
HTTPSRV - The name of the Apache HTTP server. This will create folder /www/A2222 and also allow you to use the name on the STRTCPSVR command (i.e. STRTCPSVR SERVER(*HTTP) HTTPSVR(A2222) ).
EXTPATH - The External Path allows for the configuration of the proxy rewrite that exists in the config/httpd.conf file. Leave this as two quotes for most purposes.
EXTPORT - The port Apache will listen on.
INTPATH - The Internal Path allows for the configuration of the proxy rewrite that exists in the config/httpd.conf file. Leave this as two quotes for most purposes.
INTPORT - The port Thin will listen on.
What does it create?
- IFS folder in the current users /home directory (i.e. /home/aaron/A2222)
- Apache www folder (i.e. /www/A2222)
- Development collection (aka library) (i.e. /QSYS.LIB/A2222_D.LIB)
- Test collection (aka library) (i.e. /QSYS.LIB/A2222_T.LIB)
How do I cleanup/delete what RAILSNEW created?
rm -R /home/aaron/A2222/
rm -R /www/A2222/