Gem install pg -with-pg-config=/Applications/Postgres.app/Contents/Versions/11/bin/pg_configĮxport PATH=/Applications/Postgres. This will log you into the Postgres server. But when I run 'rake db:create', I get the following: Ken-Vogts-MacBook:sixmonths ken rake db:create (in /Users/ken/sixmonths) rake aborted no such file to load - pg Here is my database. Once it's up and running, we want to create a root user to log in and interact with the database. And to stop the Postgres database from running: brew services stop postgresql. $ PATH= $PATH:/Library/PostgreSQL/8.3/bin sudo gem install pg To start the database, you can simply run the following command in your terminal: brew services start postgresql. HINT: Make sure pg_config is in your PATHĪ few minutes later I realised I’d installed my copy of PostgreSQL using the one click installer, which puts the database server in the /Library/PostgreSQL directory. System/Library/Frameworks/amework/Versions/1.8/usr/bin/ruby extconf.rb install pgĮxtconf.rb:1: command not found: pg_config -version Homebrew or Postgres.app are the common ones that often. As shown in the official Postgres download instructions here, there are few ways of installing PostgreSQL on Mac OS. Compare your error message with what you are doing. This note assumes that Ruby on Rails has already been properly installed and the purpose is to replace the default DB engine SQLite with PostgreSQL. This could take a while.ĮRROR: Failed to build gem native extension. 1 Answer Sorted by: 1 I think your whole problem is with a short typo. You can connect to a PostgreSQL database from Ruby using the pg gem, but if the pg_config program isn’t in your path you’ll run into problems during installation. I’ve recently switched from using MySQL to PostgreSQL for my Ruby projects. Sudo gem install dm-postgres-adapter -with-pgsql-server-include=/usr/local/Cellar/postgresql/9.3.Installing the pg PostgreSQL gem on Mac OS X Sudo gem install dm-postgres-adapter -with-pgsql-server-dir=/usr/local/Cellar/postgresql/9.3.2/include/server/ I've tried to uninstall and reinstall Postgres (through homebrew) and also passing to the gem install some of those parameters, for example: sudo gem install dm-postgres-adapter -with-pgsql-server-dir=/usr/local/Cellar/postgresql/9.3.2/ without-pgsql-server-include=$/Ĭould not find PostgreSQL build environment (libraries & headers): Makefile not created Now, we need to open our terminal by typing CTRL + ALT + T and run these commands: Update the. ruby=/System/Library/Frameworks/amework/Versions/2.0/usr/bin/ruby Installing PostgreSQL Having all the requirements ready we can start the PostgreSQL installation. How do I start the PostgreSQL server Update: > pgctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start server starting sh: /usr/local/var/postgres/server. Check the mkmf.log file for more details. System/Library/Frameworks/amework/Versions/2.0/usr/bin/ruby extconf.rbĬould not create Makefile due to some reason, probably lack of necessary This could take a while.ĮRROR: Error installing dm-postgres-adapter:ĮRROR: Failed to build gem native extension. Launching this command: sudo gem install dm-postgres-adapter I tried to change mysql over postgres (to publish the app on Heroku) and now the problem. I've installed the dm-mysql-adapter and then with a rake migrate the tables where automagically created. gemfile: add gem 'pg' remove gem 'sqlite' 2. I've prepared a simple Ruby app (noob alert!) to start with this language. Installing the pg PostgreSQL gem on Mac OS XI’ve recently switched from using MySQL to PostgreSQL for my Ruby projects. I've been fighting on this for two days, time to ask to StackOverflow.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |