rails_tutorial_3rd_edition_gemfiles
rails_tutorial_3rd_edition_gemfiles copied to clipboard
Gemfile of hello_app cannot be run
It shows a lot of problem, such as:
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.Could not find gem 'sass-rails (= 5.0.2)' in any of the gem sources listed in your Gemfile or available on this machine.
Hi, I've the same problem with p gem, thanks.
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.
Ronaks-MacBook-Air:hello_app ronakvyas$ gem install pg -v '0.17.1' Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension.
current directory: /Users/ronakvyas/.rvm/gems/ruby-2.3.1/gems/pg-0.17.1/ext
/Users/ronakvyas/.rvm/rubies/ruby-2.3.1/bin/ruby -r ./siteconf20160509-33077-m55nyx.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/ronakvyas/.rvm/rubies/ruby-2.3.1/bin/$(RUBY_BASE_NAME) --with-pg --without-pg --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/ronakvyas/.rvm/gems/ruby-2.3.1/extensions/x86_64-darwin-15/2.3.0/pg-0.17.1/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/ronakvyas/.rvm/gems/ruby-2.3.1/gems/pg-0.17.1 for inspection. Results logged to /Users/ronakvyas/.rvm/gems/ruby-2.3.1/extensions/x86_64-darwin-15/2.3.0/pg-0.17.1/gem_make.out
This happened with me too. I tried installing that gem but still it broke like above.
But the app works in default Gemfile which I had.
Here's how I fixed it (with home-brew):
- brew update
- brew install postgresql
- After that 'gem install pg' worked for me.
Thanks. This worked for me. Turns out I didn't know that I had Postgresql or not.