AWSのcloud9で開発しています。githubに上がっているマスターのbranchをcloneして、cloud9にコピーしたのですが、rails sでサーバを起動すると、
(master) $ rails s Could not find proper version of railties (5.1.6) in any of the sources Run `bundle install` to install missing gems.
と表示されたので、bundle installしたら
$ bundle install Fetching gem metadata from https://rubygems.org/......... Fetching rake 12.3.1 Installing rake 12.3.1 Using concurrent-ruby 1.0.5 Fetching i18n 1.1.1 Installing i18n 1.1.1 Fetching minitest 5.11.3 Installing minitest 5.11.3 Using thread_safe 0.3.6 Using tzinfo 1.2.5 Fetching activesupport 5.1.6 Installing activesupport 5.1.6 Using builder 3.2.3 Using erubi 1.7.1 Using mini_portile2 2.3.0 Fetching nokogiri 1.8.5 Installing nokogiri 1.8.5 with native extensions Using rails-dom-testing 2.0.3 Using crass 1.0.4 Using loofah 2.2.2 Using rails-html-sanitizer 1.0.4 Fetching actionview 5.1.6 Installing actionview 5.1.6 Using rack 2.0.5 Using rack-test 1.1.0 Fetching actionpack 5.1.6 Installing actionpack 5.1.6 Using nio4r 2.3.1 Using websocket-extensions 0.1.3 Fetching websocket-driver 0.6.5 Installing websocket-driver 0.6.5 with native extensions Fetching actioncable 5.1.6 Installing actioncable 5.1.6 Using globalid 0.4.1 Fetching activejob 5.1.6 Installing activejob 5.1.6 Using mini_mime 1.0.1 Fetching mail 2.7.1 Installing mail 2.7.1 Fetching actionmailer 5.1.6 Installing actionmailer 5.1.6 Fetching activemodel 5.1.6 Installing activemodel 5.1.6 Fetching arel 8.0.0 Installing arel 8.0.0 Fetching activerecord 5.1.6 Installing activerecord 5.1.6 Fetching execjs 2.7.0 Installing execjs 2.7.0 Fetching autoprefixer-rails 9.2.1 Installing autoprefixer-rails 9.2.1 Fetching bcrypt 3.1.12 Installing bcrypt 3.1.12 with native extensions Fetching bindex 0.5.0 Installing bindex 0.5.0 with native extensions Fetching rb-fsevent 0.10.3 Installing rb-fsevent 0.10.3 Fetching ffi 1.9.25 Installing ffi 1.9.25 with native extensions Fetching rb-inotify 0.9.10 Installing rb-inotify 0.9.10 Fetching sass-listen 4.0.0 Installing sass-listen 4.0.0 Fetching sass 3.6.0 Installing sass 3.6.0 Fetching bootstrap-sass 3.3.7 Installing bootstrap-sass 3.3.7 Using bundler 1.16.5 Fetching byebug 9.0.6 Installing byebug 9.0.6 with native extensions Fetching coffee-script-source 1.12.2 Installing coffee-script-source 1.12.2 Fetching coffee-script 2.4.1 Installing coffee-script 2.4.1 Using method_source 0.9.0 Using thor 0.20.0 Fetching railties 5.1.6 Installing railties 5.1.6 Fetching coffee-rails 4.2.2 Installing coffee-rails 4.2.2 Fetching multi_json 1.13.1 Installing multi_json 1.13.1 Fetching jbuilder 2.6.4 Installing jbuilder 2.6.4 Fetching jquery-rails 4.3.1 Installing jquery-rails 4.3.1 Fetching ruby_dep 1.5.0 Installing ruby_dep 1.5.0 Fetching listen 3.1.5 Installing listen 3.1.5 Fetching pg 0.20.0 Installing pg 0.20.0 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /usr/local/rvm/gems/ruby-2.4.1/gems/pg-0.20.0/ext /usr/local/rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20181023-4880-16yg934.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 --without-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=/usr/local/rvm/rubies/ruby-2.4.1/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: /usr/local/rvm/gems/ruby-2.4.1/extensions/x86_64-linux/2.4.0/pg-0.20.0/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /usr/local/rvm/gems/ruby-2.4.1/gems/pg-0.20.0 for inspection. Results logged to /usr/local/rvm/gems/ruby-2.4.1/extensions/x86_64-linux/2.4.0/pg-0.20.0/gem_make.out An error occurred while installing pg (0.20.0), and Bundler cannot continue. Make sure that `gem install pg -v '0.20.0' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: pg
とエラーが出てしまったのですが、具体的な解決方法を教えていただけると助かります。
当方初心者のため、手順などをお示しいただけると嬉しいです。
自力で'https://rubygems.org/'` にアクセスしgemを探しましたが該当するgemもなく途方に暮れています。
どなたかお助けお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。