Currently this is fixed on the master branch, and most likely the fix will be available in 5.X EAP during the next couple of weeks.
A quick workaround is:
You can copy "rails" script from "bin" to "script" folder as a workaround. NOTE: if u don't have "script" folder under your project root then please create new folder and name it as "script"(For Rails 4). Then copy "rails" from "bin" folder to it.
Credit goes to community support(Dennis Ushako)