Question: After importing an existing project into RubyMine, I encountered "Rails server launcher wasn't found in the project" when I Run/Edit Configuration. 

I've checked this [Cannot start the debugger in Rubymine. Rails server launcher wasn't found in project](https://stackoverflow.com/questions/27883244/cannot-start-the-debugger-in-rubymine-rails-server-launcher-wasnt-found-in-pro), but deleting the .idea directory and re-open is not helpful. 

I can `rails server` in the Terminal successfully and the rails server runs. So I guess it's likely a RubyMine related thing.

Thanks,
Allen

Answer: 
Ok, this RubyMine has some serious issues. My day started out peaceful and then ended as a nightmare, courtesy of RubyMine. All I did was git checkout to a certain version of my repo. Well, when I did that, suddenly the folders in RubyMine disappeared. Yes, that is the first bug. I `git checkout 8d4fbd1b5dfce0a3daa16896a603903a` And then I open RubyMine and folders are gone! I closed and reopened. Still no folders. I restarted computer and still no folders.

I had to go to Project > File Structure and delete the Module. And then create a new Module. Now the project folders appear. But then I get this obscure error `Rails server launcher wasn't found in the project`. I have no idea what it means. I go online and they say delete `.idea` directory in your project. So I do that. And now again I have to delete and recreate the module.

This time it says "overwrite directory" since I have an existing project. I select "Yes" and then I open project and my `secrets.yml` is gone! Now I had to use secrets.yml I had backed up. And then finally it works.

Seriously, all this just because I wanted to checkout out a specific git commit? Come on. 

UPDATE
After further investigation, I understand what is going on. There are three critical Intellij Idea files with regards to the Ruby plugin:

```
/.idea/
MyProject.iml
/MyProjectGemset/

```

These three files should not be checked into git and should be consistent across the different branches of your project. You might have another \*.iml in the project. Delete that and make sure you are using the same .iml throughout the branches. 

These two files pertain to your SDK:

```
 MyProject.iml
/MyProjectGemset/

```

This file pertains to general configuration:

```
/.idea/

```
if you follow the solution from Artyom Blagoda on the Windows with ruby installed on the WSL (Ubuntu) you'll get into situation when wsl path (\wsl$\Ubuntu) of ruby script (rails) could not be found by remote (Ubuntu) ruby interpreter. to make it work you need to add path mapping on:

**Settings -> Ruby SDK and Gems** -> Your remote ruby or RVM -> then click the folder icon above, you'll find a new window where you put:

Local Path: //wsl$/Ubuntu/PATH\_TO\_YOUR\_RAILS\_BIN

---

Remote Path: PATH\_TO\_YOUR\_RAILS\_BIN

hope it helps ;)