Create a new Rails application

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

To create a new Rails project, load the Bitnami console, change to the installdir directory and initialize a new project as below. Remember to replace the APPNAME placeholder with the actual name of your project.

$ cd installdir
$ ./rubyconsole
$ rails new APPNAME

Next, start the Rails server by running the following command:

$ cd installdir/APPNAME
$ bundle exec rails s

This will start the Rails server for your application on port 3000. Find more information about how to access the application using your Web browser.

If you see an error on Linux stating “Could not find a JavaScript runtime”, you must add the rubyracer gem (already included in the Bitnami Ruby Stack) into the Gemfile, as below:

gem 'sqlite3'
gem 'therubyracer'
Last modification September 5, 2018