Opening an existing project missing gems can't install bundler
Hi,
As per the title I recently purcahsed RubyMine and have been attempting to work with the following project:
https://github.com/OfficeForProductSafetyAndStandards/product-safety-database/tree/main
I managed to setup my local Windows 11 environment with WSL2 hosting a Debian Linux image. Everything works via Debian I am able to spin up some containers and then run the applicatoin using rails s command (my full setup instructions are here for anyone wanting to give this a go: wsl2-debian-ruby-setup.md).
I am able to use VS Code to doe remote development (see this article: https://www.hanselman.com/blog/ruby-on-rails-on-windows-is-not-just-possible-its-fabulous-using-wsl2-and-vs-code) all is well however when I open RubyMine I am confronted with lots of messages about missing gem files which I attempt to install but get an error message.
idea.log: idea.log.txt
The source code is hosted inside the WSL2 Debian Distro as well as the associated containers (its lightening fast with this setup WSL2 takes care of networking so I can access the test site from localhost:3000 address).
Also tried checking out the source code into a Windows directory and opening the solution folder in RubyMine same issues complaining about missing gems attempt install anything getting installation failures :-(
Right now I have had to stop using RubyMine as I am getting the same if not better mileage from VS Code and I am not taking advantage of RubyMine features…
Thanks in advance.
T
请先登录再写评论。
Hello,
Just to be sure, do I understand correctly that you tried placing the project in Windows FS and adding Ruby interpreter as a WSL remote one? In the setup.md you mention WSL and then Docker, but it wasn't clear for me how you start IDE and configure interpreter.
Hi,
Everything is hosted in WSL Debian the IDE is running in Windows and connecting through via WSL FS however this is not suitable for RubyMine.
I have made considerable progress since my post and I will be writing an article for the various ways of getting RubyMine working correct however in summary it is:
1. Windows Only - install Ruby, rebenv, yarnpkg for Windows; git clone the repo into the Windows FS, run the bundle commands and yarnpkg install and build steps (had to wrangle with the right version of nodejs for this repo) and then open the project in RubyMine and it starts to work better (the selecting to install the gems, run bundler etc all work correctly do note this take some time let the IDE do its thing…).
2. WSL Debian hosted - git clone the repo from inside your WSL2 Distro (in Debian I made sure the prereq's were there like bundler, yarnpkg, Debian build tools so some gems can be compiled and built on installation). Spin up the docker containers the repo uses (postgres, redis, open search etc) and then run the rails commands to create the db, migrate it and seed the data.
2.1 IDE setup - after testing the repo with rails s command all is well I can see the working app and its very responsive compared to Windows (I think Antimalware/Windows Defender cause issues) I then started RubyMine but this time from the Open Project dialog I chose the WSL connection and followed the steps to connect to the Debian distro and then set the project path to the git repo I had checked out from inside Debian.
After successfully creating the remote connection everything started to behave packages were installed that were missing the odd one getting compiled and built along the way all good - the whole IDE and features working as expected :-)
So in conclusion even though its possible to use the WSL FS to open a project hosted inside the Linux distro it doesn't work too well and/or a pain to manually setup and configure the solution in RubyMine (probably my lack of experience/skills with RubyMine at the moment) its not the best options.
Option 2 gives the best performance but you have to setup and configure the Linux distro correctly (as per my guide).
Option 1 is the easiest option for non Linux people for a Windows only dev experience and to be clear in both cases I was able to set a breakpoint, run the app through RubyMine and then step through one of the Rails controllers and as such getting a rich experience of RubyMine in action.
Hope the above helps someone.
Thanks in advance.
T
Hello,
Thank you for the detailed post. Just to be sure, do I understand it right that 1. scenario is about fully local setup, while 2. involves WSL. At some point you mentioned docker containers, and I'm wondering whether you configure them inside WSL or inside Windows itself.