3

My Rails server worked well through normal development scripting and I planned to use Netbeans for Rails. When I started my existing project with Netbeans and restarted my Webrick server, It shows error

RuntimeError (Please install the jdbcmysql adapter: gem install activerecord-jdbcmysql-adapter (no such file to load -- java))

I feel this error is related with JRuby, But I never using JRuby and I am using Ruby 1.9.2, Rails 3.0.0 and I dont want to use JRuby and Glassfish. I tried to remove default JRuby and Ruby1.9.2 as default, but i cant. I feel there may be a cause of linking error w.r.t JRuby. Kindly help me to rectify this issue.

Palani Kannan
  • 1,613
  • 2
  • 18
  • 29

4 Answers4

6

Got the same error. Look in your config/database.yml - netbeans changes the adapter automatically. Just write 'sqlite3' as adapter or whatever fits for you instead of 'jdbcmysql'.

Hope I could help!

Andre Schweighofer
  • 2,759
  • 1
  • 26
  • 25
1

Check your database.yml file you will find that tha adapter have been changed from your previous configured database to jdbcmysql. you can delete it and write it back!

For example:

 development:
    adapter: jdbcmysql

and if you were using mysql

 development:
    adapter: mysql2

And it will works!

Amr Hamza
  • 85
  • 2
  • 6
1

I solved this issue, In Netbeans,,, i set Ruby 1.9.2 as default by

Project -> Right Click "My project" -> Set Configuration ->Customize -> Changed Ruby Platform as "Ruby 1.9.2" from "JRuby".

Now it works without any error. This may help for some other reader.

-- With Thanks, Palani Kannan. K,

Palani Kannan
  • 1,613
  • 2
  • 18
  • 29
  • It didn't work for me yet. And I don't think that netbeans configuration may fix the error. Can you guide me more on that issue? – Nimesh Nikum Dec 03 '10 at 06:27
  • @Nimesh: For my case, it was ruby executable link problem... I dont know about your problem. May be if you post your problem exactly, the known people will help you. – Palani Kannan Dec 03 '10 at 13:55
1

You didn't install the necesary gem, that's all. You need to do this: gem install activerecord-jdbcmysql-adapter to install necesary aditional gems, and then you have to edit your database.yml with the proper gem, for example:

development:
  adapter: jdbcmysql
  encoding: utf8
  reconnect: false
  database: db_development
  pool: 5
  username: username
  password: passwrd
  socket: /var/run/mysqld/mysqld.sock
Pops
  • 30,199
  • 37
  • 136
  • 151
Sandra
  • 11
  • 1