So, you can create, enable, and disable rbenv gemsets in two ways: If you have rbenv-gemset enabled in your project, RubyMine synchronizes the gemsets enabled in the Ruby SDK and Gems page with the ones specified in the. You can also create a gemset when you generate a new project. To create an RVM gemset, go to the Language & Frameworks | Ruby SDK and Gems page, right-click the required version of Ruby, and select New RVM gemset. You can learn more from the Configure a Ruby interpreter section of the documentation. Press Ctrl twice and execute the required RVM/rbenv command in the Run Anything popup, for example, rvm use or rbenv shell 2.6.3. Open the Settings/Preferences dialog, go to the Languages & Frameworks | Ruby SDK and Gems page, and select the desired Ruby version and, optionally, a gemset. RubyMine detects installed interpreters automatically and enables you to select the desired version in the following ways: Ruby version managers allow you to switch between several versions of Ruby in a terminal. You can learn more from the IRB console section of the documentation. As for running Ruby scripts, additional options will be passed to a newly created IRB run configuration. You can also run a console with additional options, such as passing the -r option to load a script: irb -r. Press Ctrl twice and execute the irb command in a popup. To use the IRB console from inside the IDE, choose one of the following courses of action:įrom the main menu, select Tools | Run IRB. Learn more from the Run Ruby scripts topic in the documentation. You can customize these parameters, add new ones, and save the configuration to quickly run a script in the future. In this case, you can specify the required command-line options and script arguments right in the popup, for example, ruby -v script.rb.Īll of the above actions create the Ruby run configuration, which stores all the passed parameters. Press Ctrl twice to invoke the Run Anything popup and execute the ruby script.rb command. Right-click a script in the editor or Project view and select Run ‘script’ from the context menu. Open a script in the editor and press ⌃⇧R / Ctrl+Shift+F10. There are multiple ways to run Ruby scripts in RubyMine: We’ve divided the commands into several groups to allow you to quickly find a corresponding RubyMine feature: In this blog post, we’ll discuss the RubyMine features that can be used instead of running specific terminal commands and the benefits that working with the IDE provides. We found that most participants ran Bundler commands and tests from the IDE terminal. We also noticed this ourselves when we did some RubyMine usability testing among developers at RailsConf 2019. These tasks include running scripts, tests, Rails generators, Git and Docker commands, and many other things. In the Ruby/Rails community, using a terminal is the most popular way to perform various commands and tasks.
0 Comments
Leave a Reply. |