Add remote Ruby SDK
Hi folks,
I have a multi app environment based on https://github.com/phusion/passenger-docker and I'm trying to add a remote Ruby SDK (docker or docker-compose) in RubyMine 2017.2.
Here is my docker-compose.yml file:
version: '2'
services:
web:
build:
context: .
ports:
- "80:80"
- "443:443"
volumes:
- ${APPLICATIONS_PATH}:/home/app/www
- rvm_gems:/usr/local/rvm/gems/ruby-2.3.3
links:
- db
db:
image: mysql:5.7
user: mysql
ports:
- "3306:3306"
volumes:
- ./db:/docker-entrypoint-initdb.d
- mysql:/var/lib/mysql
environment:
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
volumes:
mysql:
driver: "local"
rvm_gems:
driver: "local"
The problem is that gems are not found.
I tried to set GEM_HOME / GEM_PATH variables (RubyMine docker-compose setup), but it doesn't work.
Many thanks in advance for your help.
Mauro
请先登录再写评论。
Hello Mauro, could you please detail your environment? Please attach idea.log (Help | Show Log in...)?
Hello Anna,
many thanks for your reply.
I have a RubyMine Project for each each app (www directory) and I tried to add a remote Ruby SDK (docker-compose) for the auth project.
Ruby Interprether path
/usr/bin/ruby
I get the following error using /usr/bin/ruby as interprether path:
Can't create Ruby SDK
Can't find ruby by provided interprether path
Btw, /usr/bin/ruby is a script containing the following code
/usr/local/rvm/rubies/default/bin/ruby
I then tried with /usr/local/rvm/rubies/default/bin/ruby (which is a link to /usr/local/rvm/rubies/ruby-2.3.3/bin/ruby) and it works, but the downloaded gems are the system ones.
Directory structure
Log file content
Many thanks for your help.
Mauro
I have the same issue. Is there a fix?
Dominic
Is this a bug? Is there a workaround?
Many thanks!
Does RubyMine consider and mount volumes defined in docker-compose.yml when downloading gems?
RubyMine Gem Manager
Failed to run remote command: com.intellij.docker.remote.run.runtime.WrappedNotFoundException: com.github.dockerjava.api.exception.NotFoundException: {"message":"oci runtime error: container_linux.go:262: starting container process caused \"exec: \\\"ruby\\\": executable file not found in $PATH\"\n"}
Strange since I set ruby binary path equals to /usr/local/rvm/rubies/default/bin/ruby
Any update?
Many thanks,
Mauro
Hello,
could you please check again how it goes in the last RubyMine 2017.3 EAP?
Hi Olga,
it seems to work.
This is the configuration used in my passenger-docker + d4m-nfs based environment.
Many thanks,
Mauro
The Download of SDK and gems is slow and takes minutes.
During the download the IDE cannot be used.
Is there a way to define a Docker Compose RUN/Debug configuration when the Docker environment is based on nginx + passenger + vhosts?
Many thanks,
Mauro
Mauro,
in case you need some specific Docker environment you can always set it up manually (RubyMine will run the command for Ruby/Rails and Docker but environment is something that is configured via docker compose). As for downloading speed, we have a corresponding task so please vote for it in order to get notifications regarding its state:
https://youtrack.jetbrains.com/issue/RUBY-19834
Its broken again in 2018.1.3
It is broken again in 2018.2.3. Any update on this?
Gem downloaded are not those installed.
Many thanks for your help.
Mauro
Any update on this? Please...
Hello Mauro,
sorry for the delay. Could you please specify the problem you get at the moment? Do you mean that gems in external libraries aren't those that are already installed and listed in Gemfile? It'd be great if you could provide a project sample for reproduce (you can send me it to rubymine-support@jetbrains.com)
Hi Olga,
many thanks for your reply.
I already provided an example 6 months ago.
Devlopment environment with instructions:
https://gitlab.com/my-passenger-docker/mydock
Sample applications:
https://gitlab.com/my-passenger-docker/app1
https://gitlab.com/my-passenger-docker/app2
In order to be able to clone the repositories you need to authenticate to gitlab (free account).
Many thanks,
Mauro
So after our discussion in the support system we've managed to solve the problem, which was happening due to the incorrect path to the rvm version manager.