【问题标题】:Posty_API error: There was an error in your Gemfile, and Bundler cannot continuePosty_API 错误:您的 Gemfile 中有错误,并且 Bundler 无法继续
【发布时间】:2016-09-30 14:15:08
【问题描述】:

我正在尝试在我的邮件服务器上安装 posty_API(使用 MySQL 和 Postfix),它在命令 rake db:migrate 上显示错误

您的 Gemfile 中有错误,Bundler 无法继续。

宝石文件:

    source 'http://rubygems.org'

gem 'rack', '~> 1.5.2'
gem 'rake', '~> 10.3.2'
gem 'grape', '~> 0.7.0'
gem 'activerecord', '~> 3.2.22',:require => 'active_record'
gem 'json'
gem 'grape-swagger'
gem 'rack-cors', :require => 'rack/cors'
gem 'schema_plus', '~> 1.5.1'

group :test, :development do
  gem 'rspec'
  gem 'rack-test',:require => 'rack/test'
  gem 'shotgun'
  gem 'racksh'
  gem 'rubocop'
end

group :mysql, optional: true do
  gem 'mysql2', '~> 0.3.16'
end

group :postgresql, optional: true do
  gem 'pg', '~> 0.18.4'
  gem 'activerecord-postgresql-adapter'
end

此外,当我尝试通过bundle install 运行它时,我看到了

捆绑完成! 16 个 Gemfile 依赖项,现在安装了 45 个 gem。宝石 未安装组中的 db。

我很乐意为您提供任何帮助。谢谢。

【问题讨论】:

  • 你试过了吗:bundle exec rake db:migrate
  • 类型错误:rake 中止! Mysql2::Error: Can't connect to local MySQL server through socket 'mysql socket path (/var/mysql/mysql.sock)' (2) Tasks: TOP => db:migrate (通过运行任务查看完整跟踪 - -trace)
  • 所以问题出在mysql服务器上
  • 是的,我明白了。会不会是 MySQL 文件夹丢失或重命名造成的?

标签: ruby-on-rails ruby postfix-mta gemfile mail-server


【解决方案1】:

我刚刚添加了远程 SQL 服务器主机,创建了测试数据库,创建了 rake db:migrate,然后将表移动到旧数据库并再次创建了 rake db:migrate

【讨论】:

    猜你喜欢
    • 2013-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-18
    • 2019-09-19
    • 1970-01-01
    • 2012-11-12
    相关资源
    最近更新 更多