RuntimeError(请安装 jdbcmysql 适配器:`gem install activerecord-jdbcmysql-adapter`(没有要加载的文件 - java))
我的 Rails 服务器在正常的开发脚本中运行良好,我计划使用 Netbeans for Rails。当我使用 Netbeans 启动现有项目并重新启动 Webrick 服务器时,它显示错误
RuntimeError (请安装 jdbcmysql 适配器:gem install activerecord-jdbcmysql-adapter
(没有要加载的此类文件 -- java))
我觉得这个错误与JRuby有关,但我从来没有使用过JRuby,我使用的是Ruby 1.9.2,Rails 3.0.0,我不想使用JRuby和Glassfish。我尝试删除默认的 JRuby 和 Ruby1.9.2 作为默认值,但我不能。我觉得 JRuby 可能有链接错误的原因。请帮助我纠正这个问题。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
遇到同样的错误。
查看您的 config/database.yml - netbeans 自动更改适配器。只需编写“sqlite3”作为适配器或任何适合您的内容,而不是“jdbcmysql”。
希望我能帮忙!
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!
我解决了这个问题,在 Netbeans 中,我通过
Project -> 将 Ruby 1.9.2 设置为默认值右键“我的项目”->设置配置->自定义->将 Ruby 平台从“JRuby”更改为“Ruby 1.9.2”。
现在可以正常运行,没有任何错误。这可能对其他读者有所帮助。
--
带着感谢,
帕拉尼·坎南.克,
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,
您没有安装必要的 gem,仅此而已。您需要执行以下操作:
gem install activerecord-jdbcmysql-adapter
来安装必要的附加 gem,然后您必须使用正确的 gem 编辑database.yml
,例如: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 yourdatabase.yml
with the proper gem, for example:检查您的database.yml 文件,您会发现适配器已从您之前配置的数据库更改为jdbcmysql。
你可以删除它并写回来!
例如:
如果你使用 mysql
并且它会起作用!
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:
and if you were using mysql
And it will works!