heroku rake db:migrate ERROR" gem install activerecord-mysql-adapter" [英] heroku rake db:migrate ERROR "gem install activerecord-mysql-adapter"
问题描述
使用Rails 3.2.6试图运行
heroku运行rake db:migrate
我得到了相应的错误耙子中止了!
请安装mysql适配器:`gem install activerecord-mysql-adapter`(mysql不是该软件包的一部分,将它添加到Gemfile中)
在我的 database.yml 中,我将开发,生产和测试集设置为:
adapter:mysql2
这是我的 gem env
➜my_app git:(master)gem env
RubyGems环境:
- RUBYGEMS版本:1.8.24
- RUBY版本:1.9.3(2012-11-10 patchlevel 327)[x86_64-darwin11.4.2]
- 安装目录:/Users/jcollyer/.rvm/gems/ ruby-1.9.3-p327
- RUBY EXECUTABLE:/Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
- 可执行目录:/ Users / jcollyer /。 rvm / gems / ruby-1.9.3-p327 / bin
- RUBYGEMS平台:
- ruby
- x86_64-darwin-11
- 创业板路径:
- /Users/jcollyer/.rvm/gems/ruby-1.9.3-p327
- /Users/jcollyer/.rvm/gems/ruby-1.9.3-p327@gl obal
- 创业板配置:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- 远程来源:
- http://rubygems.org/
我已经尝试了几件事,我发现谷歌搜索,没有运气。任何帮助感激!谢谢!
解决方案在Heroku上,数据库的最佳选择是postgresql。有几个原因可以归结为:这就是Heroku的设计原理。
如果您只是使用rails orm,则可以使用mysql2psql gem你的开发环境和更改你的配置文件在生产中使用postgresql。
如果你真的嫁给了mysql,你需要安装一个heroku插件让您的应用程序启动并运行。有几个选项,但这里有一个: https://addons.heroku.com/cleardb
但是真的,最好的选择是将您的应用程序迁移到postgresql,这是值得的。
更多信息:
https://devcenter.heroku.com/articles/heroku-mysqlim using Rails 3.2.6 trying to run
heroku run rake db:migrate
i get the adaptar ERROR
rake aborted! Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.)
in my database.yml i have development, production, and test set to:
adapter: mysql2
this is my gem env
➜ my_app git:(master) gem env RubyGems Environment: - RUBYGEMS VERSION: 1.8.24 - RUBY VERSION: 1.9.3 (2012-11-10 patchlevel 327) [x86_64-darwin11.4.2] - INSTALLATION DIRECTORY: /Users/jcollyer/.rvm/gems/ruby-1.9.3-p327 - RUBY EXECUTABLE: /Users/jcollyer/.rvm/rubies/ruby-1.9.3-p327/bin/ruby - EXECUTABLE DIRECTORY: /Users/jcollyer/.rvm/gems/ruby-1.9.3-p327/bin - RUBYGEMS PLATFORMS: - ruby - x86_64-darwin-11 - GEM PATHS: - /Users/jcollyer/.rvm/gems/ruby-1.9.3-p327 - /Users/jcollyer/.rvm/gems/ruby-1.9.3-p327@global - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://rubygems.org/
i have tried a few things i found googling, no luck. any help appreciated! thanks!
解决方案On Heroku, your best option for a database is postgresql, hands down. There are a handful of reasons that boil down to: that's how Heroku was designed to work.
If you're simply using the rails orm you can use the mysql2psql gem in your development environment and change your config files to use postgresql in production.
If you're really married to mysql for whatever reason, you'll need to install a heroku addon to get your app up and running. There are a couple options but here's one: https://addons.heroku.com/cleardb
But really, your best bet is to migrate your app to postgresql, it's worth it.
More info here: https://devcenter.heroku.com/articles/heroku-mysql
这篇关于heroku rake db:migrate ERROR" gem install activerecord-mysql-adapter"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!