1

My question is same as this one, but still cannot be solved. My code is:

library(DBI)
library(RMySQL)
con <- dbConnect(RSQLite::SQLite(), dbname = "myDB.db")

No matter myDB.db exists or not, I got the same error message. The error message I got:

Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': .onLoad failed in loadNamespace() for 'RSQLite', details:
  call: NULL
  error: 'hash' is not an exported object from 'namespace:rlang'

Any thoughts on how to fix it?

H42
  • 725
  • 2
  • 9
  • 28
  • 1
    I would pay attention to the second error: `error: 'hash' is not an exported object from 'namespace:rlang'` Maybe restart the R session and update it. – Bloxx Oct 31 '21 at 23:43
  • @Bloxx Thanks for your reply. If I run `sessionInfo()` I can see that I have `rlang_0.4.9`. If I run `rlang::hash` I have `Error: 'hash' is not an exported object from 'namespace:rlang' `. I tried to restart RStudio and it doesn't work. Any ideas? – H42 Nov 01 '21 at 00:00
  • 2
    you should still update rlang. see https://stackoverflow.com/questions/66308294/object-rlang-hash-not-found-when-using-modistools-functions-in-r – dww Nov 01 '21 at 00:05
  • 1
    yes, as @dww wrote, update your rlang. The latest version is `rlang_0.4.12`. If you will have problems updating rlang, check your version of R (not Rstudio). Updating R to the latest version will help updating rlang. Sorry, if I complicated too much :) – Bloxx Nov 01 '21 at 00:07
  • 1
    @Bloxx I updated both R and RStudio and now it works! Thanks! – H42 Nov 01 '21 at 14:03
  • Nice to hear that. :) – Bloxx Nov 01 '21 at 15:15

0 Answers0