Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad setup_gama path directory #28

Open
RoiArthurB opened this issue Jan 20, 2020 · 1 comment
Open

Bad setup_gama path directory #28

RoiArthurB opened this issue Jan 20, 2020 · 1 comment

Comments

@RoiArthurB
Copy link
Contributor

Hi !

Bug

I tried to install gamar on R-Studio and the initialisation failed.. I'm using Ubuntu 18.04 LTS and the gamar's function setup_gama isn't working properly :

> setup_gama("/home/gama/.local/bin/GAMA1.8.0")
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open file '/home/gama/.local/bin/GAMA1.8.0/Contents/Eclipse/Configuration/config.ini': No such file or directory

The problem is that the auto-path used to find the config.ini file is that MacOS path and not the linux one, the correct path on Linux is /home/gama/.local/bin/GAMA1.8.0/configuration/config.ini

Desktop (please complete the following information):

  • OS: Ubuntu 18.04 LTS
  • GAMAR version: git autoinstall
  • GAMA version: 1.8.0

Workaround
A quick solution is to create a symlink to the correct location :

$ cd /path/to/gama
$ # Create folders for path
$ mkdir -p ./Contents/Eclipse/Configuration
$ # Create symlink
$ ln -s /full/path/to/gama/configuration/config.ini ./Contents/Eclipse/Configuration/config.ini
@virgile-baudrot
Copy link

It seems to be the path in function gama_version within zzz.R

So change from this:

gama_version <- function(path) {
  v_info <- readLines(
    paste0(path, "/Contents/Eclipse/Configuration/config.ini'"))
  v_info <- v_info[10]
  v_info <- gsub("[[:alpha:]]|=", "", v_info)
  v_info <- as.numeric(v_info)
} 

to:

gama_version <- function(path) {
  os <- paste0(get_os())
  subpath <- ifelse(os == "Darwin", "/Contents/Eclipse", "")
  v_info <- readLines(
    paste0(path,  "/configuration/config.ini"))
  v_info <- v_info[10]
  v_info <- gsub("[[:alpha:]]|=", "", v_info)
  v_info <- as.numeric(v_info)
}

should solve it.
I'm also curious it's working for MacOS since it's a lowercase "C" in "configuration" folder name (no case sensitive?).

Also, the function .onAttach cannot check version > 1.8. The change I proposed in  gama_version() does not solve it. The path returned by pehaps_path <- gama_local_distrib_path() is not the good path for gama_version().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants