By using AWS re:Post, you agree to the Terms of Use
Questions in Education
Sort by most recent
  • 1
  • 12 / page

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Ruby on Rails API: error occurred while installing pg (1.4.1)

Attempting to deploy [this](https://github.com/horaciovelvetine/devHub) Rails API and keep sticking when EB goes to install the PG gem. So far I have tried: - Removing the specific gem requirement ``` gem "pg" -instead of- gem "pg", "~> 1.4.1" ``` - Zipping my deployment w/ and wo/ a gemfile.lock Unfortunately that's about as far as I got as googling only turned up threads that seem to be very aged: - [Set up the pg gem - postgresql in development](https://repost.aws/questions/QUIyPyB9znQ8GLyNtAuUxEcQ/set-up-the-pg-gem-postgresql-in-development) - [Ruby On Rails: bundle fails...](https://teamtreehouse.com/community/ruby-on-rails-bundle-fails-cannot-gem-install-pg-not-yet-resolved-need-help) - [Error on install](https://coderdiksha.com/an-error-occurred-while-installing-pg-1-2-3-and-bundler-cannot-continue-make-sure-that-gem-install-pg-v-1-2-3-source-https-rubygems-org-succeeds-before-bundling/) The last link has a sudo command that I didn't attempt as Im not even sure where, and tend to be weary of running sudo commands w/o understanding what I'm commanding the sudo to do. Ruby Version: 3.0.4 Rails Version: 7.0.3 GEMFILE: ``` source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.0.4" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "rails", "~> 7.0.3" # Use postgresql as the database for Active Record gem "pg", "~> 1.4.1" # Use the Puma web server [https://github.com/puma/puma] gem "puma", "~> 5.0" # Build JSON APIs with ease [https://github.com/rails/jbuilder] # gem "jbuilder" # Use Redis adapter to run Action Cable in production # gem "redis", "~> 4.0" # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] # gem "kredis" # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] # gem "bcrypt", "~> 3.1.7" # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] # Reduces boot times through caching; required in config/boot.rb gem "bootsnap", require: false # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] # gem "image_processing", "~> 1.2" # Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible # gem "rack-cors" group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem gem "debug", platforms: %i[ mri mingw x64_mingw ] end group :development do # Speed up commands on slow machines / big apps [https://github.com/rails/spring] # gem "spring" end gem 'pry', '~> 0.13.1' gem 'dotenv-rails', groups: [:development, :test] gem 'solargraph', group: :development ``` GEMFILE.LOCK: ``` GEM remote: https://rubygems.org/ specs: actioncable (7.0.3) actionpack (= 7.0.3) activesupport (= 7.0.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) actionmailbox (7.0.3) actionpack (= 7.0.3) activejob (= 7.0.3) activerecord (= 7.0.3) activestorage (= 7.0.3) activesupport (= 7.0.3) mail (>= 2.7.1) net-imap net-pop net-smtp actionmailer (7.0.3) actionpack (= 7.0.3) actionview (= 7.0.3) activejob (= 7.0.3) activesupport (= 7.0.3) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) actionpack (7.0.3) actionview (= 7.0.3) activesupport (= 7.0.3) rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) actiontext (7.0.3) actionpack (= 7.0.3) activerecord (= 7.0.3) activestorage (= 7.0.3) activesupport (= 7.0.3) globalid (>= 0.6.0) nokogiri (>= 1.8.5) actionview (7.0.3) activesupport (= 7.0.3) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) activejob (7.0.3) activesupport (= 7.0.3) globalid (>= 0.3.6) activemodel (7.0.3) activesupport (= 7.0.3) activerecord (7.0.3) activemodel (= 7.0.3) activesupport (= 7.0.3) activestorage (7.0.3) actionpack (= 7.0.3) activejob (= 7.0.3) activerecord (= 7.0.3) activesupport (= 7.0.3) marcel (~> 1.0) mini_mime (>= 1.1.0) activesupport (7.0.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) ast (2.4.2) backport (1.2.0) benchmark (0.2.0) bootsnap (1.12.0) msgpack (~> 1.2) builder (3.2.4) coderay (1.1.3) concurrent-ruby (1.1.10) crass (1.0.6) debug (1.5.0) irb (>= 1.3.6) reline (>= 0.2.7) diff-lcs (1.5.0) digest (3.1.0) dotenv (2.7.6) dotenv-rails (2.7.6) dotenv (= 2.7.6) railties (>= 3.2) e2mmap (0.1.0) erubi (1.10.0) globalid (1.0.0) activesupport (>= 5.0) i18n (1.10.0) concurrent-ruby (~> 1.0) io-console (0.5.11) irb (1.4.1) reline (>= 0.3.0) jaro_winkler (1.5.4) json (2.6.2) kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) marcel (1.0.2) method_source (1.0.0) mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.16.2) msgpack (1.5.3) net-imap (0.2.3) digest net-protocol strscan net-pop (0.1.1) digest net-protocol timeout net-protocol (0.1.3) timeout net-smtp (0.3.1) digest net-protocol timeout nio4r (2.5.8) nokogiri (1.13.6) mini_portile2 (~> 2.8.0) racc (~> 1.4) nokogiri (1.13.6-x86_64-darwin) racc (~> 1.4) nokogiri (1.13.6-x86_64-linux) racc (~> 1.4) parallel (1.22.1) parser (3.1.2.0) ast (~> 2.4.1) pg (1.4.1) pry (0.13.1) coderay (~> 1.1) method_source (~> 1.0) puma (5.6.4) nio4r (~> 2.0) racc (1.6.0) rack (2.2.4) rack-test (2.0.2) rack (>= 1.3) rails (7.0.3) actioncable (= 7.0.3) actionmailbox (= 7.0.3) actionmailer (= 7.0.3) actionpack (= 7.0.3) actiontext (= 7.0.3) actionview (= 7.0.3) activejob (= 7.0.3) activemodel (= 7.0.3) activerecord (= 7.0.3) activestorage (= 7.0.3) activesupport (= 7.0.3) bundler (>= 1.15.0) railties (= 7.0.3) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.4.3) loofah (~> 2.3) railties (7.0.3) actionpack (= 7.0.3) activesupport (= 7.0.3) method_source rake (>= 12.2) thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) regexp_parser (2.5.0) reline (0.3.1) io-console (~> 0.5) reverse_markdown (2.1.1) nokogiri rexml (3.2.5) rubocop (1.31.1) json (~> 2.3) parallel (~> 1.10) parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) rubocop-ast (>= 1.18.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.18.0) parser (>= 3.1.1.0) ruby-progressbar (1.11.0) solargraph (0.45.0) backport (~> 1.2) benchmark bundler (>= 1.17.2) diff-lcs (~> 1.4) e2mmap jaro_winkler (~> 1.5) kramdown (~> 2.3) kramdown-parser-gfm (~> 1.1) parser (~> 3.0) reverse_markdown (>= 1.0.5, < 3) rubocop (>= 0.52) thor (~> 1.0) tilt (~> 2.0) yard (~> 0.9, >= 0.9.24) strscan (3.0.3) thor (1.2.1) tilt (2.0.10) timeout (0.3.0) tzinfo (2.0.4) concurrent-ruby (~> 1.0) unicode-display_width (2.2.0) webrick (1.7.0) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) yard (0.9.28) webrick (~> 1.7.0) zeitwerk (2.6.0) PLATFORMS ruby x86_64-darwin-21 x86_64-linux DEPENDENCIES bootsnap debug dotenv-rails pg pry (~> 0.13.1) puma (~> 5.0) rails (~> 7.0.3) solargraph tzinfo-data RUBY VERSION ruby 3.0.4p208 BUNDLED WITH 2.2.33 ``` Database.yml: (config) ``` # PostgreSQL. Versions 9.3 and up are supported. # # Install the pg driver: # gem install pg # On macOS with Homebrew: # gem install pg -- --with-pg-config=/usr/local/bin/pg_config # On macOS with MacPorts: # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config # On Windows: # gem install pg # Choose the win32 build. # Install PostgreSQL and put its /bin directory on your path. # # Configure Using Gemfile # gem 'pg' # default: &default adapter: postgresql encoding: unicode # For details on connection pooling, see Rails configuration guide # https://guides.rubyonrails.org/configuring.html#database-pooling pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> development: <<: *default database: devHub_API_development # The specified database role being used to connect to postgres. # To create additional roles in postgres see `$ createuser --help`. # When left blank, postgres will use the default role. This is # the same name as the operating system user running Rails. #username: devHub_API # The password associated with the postgres role (username). #password: # Connect on a TCP socket. Omitted by default since the client uses a # domain socket that doesn't need configuration. Windows does not have # domain sockets, so uncomment these lines. #host: localhost # The TCP port the server listens on. Defaults to 5432. # If your server runs on a different port number, change accordingly. #port: 5432 # Schema search path. The server defaults to $user,public #schema_search_path: myapp,sharedapp,public # Minimum log levels, in increasing order: # debug5, debug4, debug3, debug2, debug1, # log, notice, warning, error, fatal, and panic # Defaults to warning. #min_messages: notice # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default database: devHub_API_test # As with config/credentials.yml, you never want to store sensitive information, # like your database password, in your source code. If your source code is # ever seen by anyone, they now have access to your database. # # Instead, provide the password or a full connection URL as an environment # variable when you boot the app. For example: # # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" # # If the connection URL is provided in the special DATABASE_URL environment # variable, Rails will automatically merge its configuration values on top of # the values provided in this file. Alternatively, you can specify a connection # URL environment variable explicitly: # production: url: <%= ENV['DATABASE_URL'] %> # # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database # for a full overview on how database connection configuration can be specified. # # production: # <<: *default # database: devHub_API_production # username: devHub_API # password: <%= ENV['DEVHUB_API_DATABASE_PASSWORD'] %> ``` I'm more than happy to provide any additional details, since I'm so lost on this issue I'm not even 100% sure what info/files would be helpful to provide. More than anything I'd really love to understand the what and why here! Thank you so much for your time/help! James
1
answers
0
votes
885
views
asked 3 months ago
  • 1
  • 12 / page