简体   繁体   English

如何在黄瓜导轨中将 mysql2 转换为 psql

[英]How to convert mysql2 to psql in cucumber rails

I am trying to convert mysql2 to postgres.我正在尝试将 mysql2 转换为 postgres。 When i run rake db:create I am getting the following error.当我运行 rake db:create 时,出现以下错误。

rake aborted!
Gem::LoadError: You have already activated rake 12.3.0, but your Gemfile requires rake 10.4.2. Prepending bundle exec to your command may solve this.
/home/supranimbus12/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.16.1/lib/bundler/runtime.rb:313:in check_for_activated_spec!' /home/supranimbus12/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.16.1/lib/bundler/runtime.rb:31:inblock in setup'
/home/supranimbus12/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.16.1/lib/bundler/runtime.rb:26:in map' /home/supranimbus12/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.16.1/lib/bundler/runtime.rb:26:insetup'
/home/supranimbus12/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.16.1/lib/bundler.rb:107:in setup' /home/supranimbus12/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.16.1/lib/bundler/setup.rb:10:in<top (required)>'
/home/supranimbus12/tracks-2.3.0/config/boot.rb:4:in <top (required)>' /home/supranimbus12/tracks-2.3.0/config/application.rb:1:in<top (required)>'
/home/supranimbus12/tracks-2.3.0/Rakefile:4:in <top (required)>' /home/supranimbus12/.rvm/gems/ruby-2.2.3@global/gems/rake-12.3.0/exe/rake:27:in<top (required)>'
(See full trace by running task with --trace)
bundle exec rake db:create

和迁移

bundle exec rake db:migrate

After adding gem pg to Gemfile.将 gem pg 添加到 Gemfile 后。

gem 'pg'
  • bundle install捆绑安装
  • Configure database.yml,配置database.yml,
  • Create new database.创建新数据库。
  • Migrate dateabase迁移数据库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM