11/12/2023 0 Comments Install and run postgresql mac ruby![]() ![]() ![]() In order to keep these superuser privileges separate from the database instance you use for your Rails application, in this step you will create a new role with less access. When starting PostgreSQL with Homebrew, you will automatically have a superuser role created with your macOS username. In PostgreSQL, roles can be used to organize permissions and authorization. ![]() Step 2 - Creating a Database Role for Your Application Once PostgreSQL is installed, the next step is to create a role that your Rails application will use later to create your database. To start the service and enable it to start at login, run the following:Ĭheck to make sure the installation was successful: Then, apply the changes you made to your ~/.bash_profile file to your current shell session: echo 'export 10/bin:$PATH"' > ~/.bash_profile. ![]() Next, include the PostgreSQL binary in your PATH variable in order to access the PostgreSQL command line tools, making sure to replace the 10 with the version number you are using: You can find the available packages at the Homebrew website. If you would like to download a specific version of PostgreSQL, replace postgresql in the previous command with your desired package. To install the latest version, run the following command: There are multiple Homebrew packages to install different versions of PostgreSQL. Although there are many ways to install PostgreSQL on macOS, this tutorial will use the package manager Homebrew. In order to configure Ruby on Rails to create your web application with PostgreSQL as a database, you will first install the database onto your machine. This tutorial will use version 2.6.3 of Ruby and 5.2.3 of Rails for information on the latest versions, check out the official sites for Ruby and Rails. To set this up, follow our guide on How To Install Ruby on Rails with rbenv on macOS. This tutorial has been tested on macOS 10.14 Mojave.Ī Ruby on Rails development environment installed on your macOS machine. One computer or virtual machine with macOS installed, with administrative access to that machine and an internet connection. You will install and configure PostgreSQL, and then test your setup by creating a Rails application that uses PostgreSQL as its database server. In this tutorial, you will set up a Ruby on Rails development environment connected to a PostgreSQL database on a local macOS machine. In order to configure your Ruby on Rails setup to use PostgreSQL, you will need to perform a few additional steps to get it up and running. However, for highly complex applications that need more reliable data integrity and programmatic extensibility, a PostgreSQL database will be a more robust and flexible choice. SQLite is a lightweight, portable, and user-friendly relational database that performs especially well in low-memory environments, and will work well in many cases. Results logged to /Users/helex/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/pg-0.13.2/ext/gem_make.When using the Ruby on Rails web framework, your application is set up by default to use SQLite as a database. Gem files will remain installed in /Users/helex/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/pg-0.13.2 for inspection. with-pg-config -without-pg-config -with-pg_config -without-pg_config with-opt-dir -without-opt-dir -with-opt-include -without-opt-include = $/lib If building fails, please try again withĬould not create Makefile due to some reason, probably lack of Users/helex/.rbenv/versions/1.9.2-p290/bin/ruby extconf.rb Users/helex/.rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/ext/builder.rb:48: warning: Insecure world writable dir /Users/helex/bin in PATH, mode 040777ĮRROR: Failed to build gem native extension. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |