RubyMine Permissions Error – Shell Script Configuration
I am running RubyMine on a Mac with the SDK version set to the correct rbenv version. I am working on a Rails project.
If I run `bin/dev` in an external terminal or in the terminal inside RubyMine, the script executes as expected and my server is started. If I add a run configuration for a shell script pointed to the same script and leave the “Execute in Terminal Window” option unchecked (so that I can stop and restart the server) I get the following error:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
/Users/<user>/RubymineProjects/<project>/bin/dev:11: command not found: foreman
What can I do to get this script to run in the correct environment without losing the ability to terminate the process from the IDE?
Please sign in to leave a comment.
Hello,
Could you please attach a screenshot of the Run configuration you've created? In addition, are you using a system Ruby as your project interpreter?
My SDK in project settings is the latest version via rbenv, not system ruby.
Here is the run configuration (the error about the script is only because of the redacted file paths, the script is valid):
Hello,
Could you please provide the output from the Run tool window after running the run configuration in question. In addition, how does it go if you run the very same command from the Terminal?
Please reference my original post (the blockquote error in the first post is the result from the run pane):
Yes, I understand, but I was wondering what the command being run in the Run console looks like (once you start the Run configuration created). Would it be possible to copy and provide it here?
The console or the run pane output?
The run pane for this configuration outputs the error I have already posted:
If the same command (`bin/dev`) is run in the console it runs as expected and starts outputting the server logs to the console.
Could you please add the following lines to Help | Diagnostic Tools | Debug Log Settings:
#org.jetbrains.plugins.ruby.ruby.run.RubyCommandLine
#com.intellij.execution.configurations.GeneralCommandLine
then restart RubyMine, reproduce the problem and attach idea.log (Help - Show log in), which you can upload to our server.
I have run the steps requested and uploaded the log file which can be found at:
Upload id: 2024_03_10_N1VaM3Jrn1r1QH6AaLtY7k (file: idea.log)
Thank you. The command being run is the following:
could you please try running the same command from the built-in terminal (pasting the correct user's and project's names) after navigating to the project's root?
Calling it that way does run correctly in the IDE terminal pane, however it exits rather than listening like it would in a normal shell outside the IDE. It does not throw the errors seen in the run pane when the run configuration is started.
shell run configuration has nothing to do with ruby support directly. it is provided by some plugin, so it is unaware about anything configured in rubymine. It has no preselected sdk, and no any awareness of the project. It just runs the script file.
If this is some foreman standard machinery, try to create a gem run configuration.