Ruby on rails 运行Rails服务器时出现问题

Ruby on rails 运行Rails服务器时出现问题,ruby-on-rails,terminal,server-error,Ruby On Rails,Terminal,Server Error,我已经能够为我的rails应用程序运行服务器,直到今天当我输入“rails s”时,它给出了以下错误: Bundler could not find compatible versions for gem "bcrypt-ruby": In snapshot (Gemfile.lock): bcrypt-ruby (3.1.5) In Gemfile: sorcery (>= 0) ruby depends on bcrypt-ruby (&g

我已经能够为我的rails应用程序运行服务器,直到今天当我输入“rails s”时,它给出了以下错误:

    Bundler could not find compatible versions for gem "bcrypt-ruby":
  In snapshot (Gemfile.lock):
    bcrypt-ruby (3.1.5)

  In Gemfile:
    sorcery (>= 0) ruby depends on
      bcrypt-ruby (>= 3.0) ruby

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
    Bundler could not find compatible versions for gem "bcrypt-ruby":
  In snapshot (Gemfile.lock):
    bcrypt-ruby (3.1.5)

  In Gemfile:
    sorcery (>= 0) ruby depends on
      bcrypt-ruby (>= 3.0) ruby

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
我运行了“bundle update”,它又给了我一个错误

 An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.
然后我决定通过键入以下命令来安装rails

gem install rails --no-ri --no-rdoc
一切运行顺利,但一旦我运行“rails-version”进行验证,终端就给了我以下错误:

    Bundler could not find compatible versions for gem "bcrypt-ruby":
  In snapshot (Gemfile.lock):
    bcrypt-ruby (3.1.5)

  In Gemfile:
    sorcery (>= 0) ruby depends on
      bcrypt-ruby (>= 3.0) ruby

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
    Bundler could not find compatible versions for gem "bcrypt-ruby":
  In snapshot (Gemfile.lock):
    bcrypt-ruby (3.1.5)

  In Gemfile:
    sorcery (>= 0) ruby depends on
      bcrypt-ruby (>= 3.0) ruby

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

我不明白我做错了什么

你试过安装pg-v'0.17.1'吗?是的,我试过了。我遇到了这个错误:找不到'libpq fe.h头***extconf.rb失败***由于某种原因无法创建Makefile,可能是缺少必要的库和/或头。有关详细信息,请查看mkmf.log文件。您可能需要配置选项。如果您使用debian/ubuntu,请尝试运行sudo apt get install libpq dev,这为我解决了一次问题。如果这不起作用,这里有一些建议