在最初的几个rails应用程序中,我设置了一些小应用程序来学习我使用的
RAILS_ENV=production rake db:setup并在myapp_production上创建了(mysql)表
但这一次,我不能填充开发或测试DB。它只是写到production,Mongrel服务器上运行的应用程序也写到production DB,但在启动时显示它的开发环境:
$ rails server
WARNING: This version of mysql2 (0.3.6) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1
WARNING: Please use the 0.2.x releases if you plan on using it in Rails <= 3.0.x
=> Booting WEBrick
=> Rails 3.0.9 application starting in development on http://0.0.0.0:3000我没有在这里使用rvm (在另一个机器上尝试过,我猜我喜欢它)
我不确定如何解决这个问题。并且没有错误消息。
发布于 2012-02-22 19:48:50
您使用的是旧的Rails版本。从0.3.0开始,mysql2 gem不支持rails 3.0及更早版本。因此,您需要将rails更新到3.1.x或更高版本,或者在Gemfile中使用gem "mysql2“、"~> 0.2.7”。查看mysql2 gem page,在浏览器中搜索"3.0“。
也许这就是原因。
https://stackoverflow.com/questions/7103596
复制相似问题