RubyMine 8.0 not connecting to a local Postgres database
I recently switched from using SQLite to Postgres as my Rails development database. My RoR app is able to access the Postgres DB without issues. However, having also re-configured the database under properities to using Postgres, Rubymine fails to connect to the development database with the following error message:
Connection to Rails JET: development failed: Exception in thread "main" java.lang.ClassNotFoundException: org.postgresql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:260)
at com.intellij.database.remote.RemoteJdbcServer.main(RemoteJdbcServer.java:15)
I have checked and I have the following driver listed for Postgres: ~/.RubyMine80/config/jdbc-drivers/postgresql-9.4.1201.jdbc4.jar
I did also try downloading the latest JDBC driver from the Postgres website and installing that instread, but I get the same error. Probably not relevant but I am using Ruby 2.2.4 with Rails 4.2.5 on Fedora 23. I am using Postgres 9.4.5. I am able to conect without issues to the DB using psql.
Help gratefully received.
请先登录再写评论。
Hello, Peter,
sorry for the delay. Could you please try to delete driver files in PostgreSQL driver settings and re-download it, also make sure that the correct class is specified in Class combo-box. If that doesn't help please attach idea.log (here or you can write me to
rubymine-support@jetbrains.com)
My bad. I should have posted a response before now. I eventually solved the problem. RubyMine uses a slightly different connection mode to connect to the database than RoR uses. I needed to allow connections by both routes in the relevant Postgress configuration file. So it wasn't really a Rubymine issue.