试图实现这个创建奖励组的Rails项目,但我一直遇到Bundler和gem安装错误



我正在尝试安装位于此处的Rails项目(https://github.com/harrystech/prelaunchr)。我知道它有点过时,项目已经存档,但我想尝试修改它,以创建一个类似的启动活动。这是我的第一个Rails项目(第一个单独的编程项目(,在加入我的Eng团队之前,我想我也可以在这里寻求一些帮助。

我已经成功地完成了"复制本地数据库.yml文件示例…"步骤的所有操作,但当我进入"设置本地数据库"步骤时,我会收到以下错误:

Could not find pg-0.18.4 in any of the sources
Run `bundle install` to install missing gems.

当我尝试运行"捆绑安装"时,这是我得到的错误:

sahrsaffa@sahrs-MacBook-Air prelaunchr % bundle install
Fetching gem metadata from https://rubygems.org/.............
Using rake 12.3.2
Using concurrent-ruby 1.1.3
Using i18n 0.9.5
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 4.2.11
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.3.0
Using nokogiri 1.8.5
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.9
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.0.4
Using actionview 4.2.11
Using rack 1.6.11
Using rack-test 0.6.3
Using actionpack 4.2.11
Using globalid 0.4.1
Using activejob 4.2.11
Using mini_mime 1.0.1
Using mail 2.7.1
Using actionmailer 4.2.11
Using arbre 1.1.1
Using rb-fsevent 0.10.2
Using ffi 1.9.25
Using rb-inotify 0.9.10
Using sass-listen 4.0.0
Using sass 3.5.5
Using thor 0.20.3
Using bourbon 5.0.0
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using railties 4.2.11
Using coffee-rails 4.2.2
Using formtastic 3.1.5
Using formtastic_i18n 0.6.0
Using has_scope 0.7.1
Using responders 2.4.0
Using inherited_resources 1.8.0
Using jquery-rails 4.3.1
Using jquery-ui-rails 6.0.1
Using kaminari-core 1.1.1
Using kaminari-actionview 1.1.1
Using activemodel 4.2.11
Using arel 6.0.4
Using activerecord 4.2.11
Using kaminari-activerecord 1.1.1
Using kaminari 1.1.1
Using polyamorous 1.3.3
Using ransack 1.8.6
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using tilt 2.0.8
Using sass-rails 5.0.7
Using activeadmin 1.0.0
Using bcrypt 3.1.11
Using bundler 1.17.1
Using coderay 1.1.1
Using delayed_job 4.1.4
Using delayed_job_active_record 4.1.2
Using orm_adapter 0.5.0
Using warden 1.2.7
Using devise 4.4.1
Using diff-lcs 1.3
Using dotenv 2.1.0
Using dotenv-rails 2.1.0
Using json 2.1.0
Using kgio 2.10.0
Using method_source 0.8.2
Fetching pg 0.18.4
Installing pg 0.18.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/Users/sahrsaffa/.rvm/gems/ruby-2.5.3/gems/pg-0.18.4/ext
/Users/sahrsaffa/.rvm/rubies/ruby-2.5.3/bin/ruby -I
/Users/sahrsaffa/.rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0 -r
./siteconf20200331-80485-5ewwyn.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details. 
You may
need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/sahrsaffa/.rvm/rubies/ruby-2.5.3/bin/$(RUBY_BASE_NAME)
--with-pg
--without-pg
--enable-windows-cross
--disable-windows-cross
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
To see why this extension failed to compile, please check the mkmf.log
which can be found here:
/Users/sahrsaffa/.rvm/gems/ruby-2.5.3/extensions/x86_64-darwin-19/2.5.0/pg-0.18.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/Users/sahrsaffa/.rvm/gems/ruby-2.5.3/gems/pg-0.18.4 for inspection.
Results logged to
/Users/sahrsaffa/.rvm/gems/ruby-2.5.3/extensions/x86_64-darwin-19/2.5.0/pg-0.18.4/gem_make.out
An error occurred while installing pg (0.18.4), and Bundler
cannot continue.
Make sure that `gem install pg -v '0.18.4' --source
'https://rubygems.org/'` succeeds before bundling.

如果能为我今后的发展提供任何帮助,我们将不胜感激!

谢谢,Sahr

您必须在macOS系统上安装PostgreSQL才能构建PostgreSQL("pg"(gem。

brew install postgresql

请尝试,然后再次运行bundle install

相关内容

最新更新