Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Running Bonnie in IntelliJ IDEA

Ashok Dongare edited this page Mar 18, 2021 · 20 revisions

Prerequisite: You have completed Mac installation Instructions and IntelliJ Idea ultimate edition installed.

Install Ruby plugin from marketplace

  • Go to plugins dialog: From the Menu IntelliJ IDEA -> Preferences -> Plugins (or use shortcut ⌘,).
  • Type ruby by jetbrains in pugin's searchbox.
  • Click on Install button(if it is already installed, it will show Installed button grayed out).
  • Once the installation is complete, click on okay and restart the IntelliJ IDEA.
  • For more informations follow official guide by IntelliJ.

Import project into IntelliJ

  • If IntelliJ is already opened to an existing project, From menu File -> New -> Project from Existing Sources....
    Or
  • Open Intellij and from the splash screen select Import Project.
    Then
  • Ensure Create project from existing sources is selected and press Next.
  • Modify Project Name if desired, keep remaining fields at their defaults and Press Next.
  • Make sure the project is identified as Ruby and press Next.
  • IntelliJ will search for frameworks. Make sure Ruby on Rails and routes.rb are found and checked, then press Finish.
  • Once IntelliJ opens its editor window, a pop-up will appear in the lower right requesting to Install Dependencies From package.json. Press Run 'yarn install'.

Configure project SDK & Rails framework

  • File-> Project Structure -> Project (or use short key ⌘;), and provide path to Project compiler output e.g. PATH_TO_BONNIE_PROJECT/bonnie/out.
  • Click on Apply and then OK buttons from right bottom corner of window.
  • Make sure that you have frameworks detection enabled by default: File -> Project Structure-> Facets-> Detection Check Enable framework detection checkbox.

Add Rails server configuration and Run Bonnie

  • Click on Add configuration button from toolbar menu. Run/Debug Configuration will appear.

  • Click on + and click on Rails from left pane.

  • From right pane change Unnamed to a more meaningful name, e.g. startbonnie. Ensure Environment is set to development.

  • Check Run browser checkbox.

  • Choose Ruby SDK: Check Other SDK radio button and select Ruby-2.7.2.

  • Click on Apply and OK.

  • Make sure the new configuration is selected in the dropdown and click on the green triangle icon. Bonnie rails server will start on localhost:3000.

  • For more information like running rake tasks or screenshots please refer: https://www.jetbrains.com/help/idea/opening-a-rails-project-in-intellij-idea.html