Install Ruby 2 and Rails 5 The best way we’ve found to install Ruby and Rails on a Mac is using the Ruby Version Manager (RVM). It’s a command-line tool that makes it easy to install and manage multiple independent Ruby environments on the same machine. $ gem install bundler 步骤 4 - 安装 Rails 环境. 上面 3 个步骤过后,Ruby 环境就安装好了,接下来安装 Rails. $ gem install rails 然后测试安装是否正确. $ rails -v Rails 4.2.5. Installing Rails is as simple as running the following command in your Terminal: gem install rails -v 6.0.2.2. Rails is now installed, but in order for us to use the rails executable, we need to tell rbenv to see it: rbenv rehash. And now we can verify Rails is installed: rails -v # Rails 6.0.2.2.
A brief note on how to install and setup PostgreSQL for Ruby on Rails on Mac OS.
More details about getting up and running with windows can be found on Windows Downloads page. Red Hat / Centos / Scientific Linux The best place to get the latest binaries for both PostgreSQL and PostGIS is the PostgreSQL Yum repository Refer to Installing PostGIS 3.1 and PostgreSQL 13 on CentOS 8 repository RPM for your distribution, download. Download Pgadmin3 For Mac Aircall Download For Mac Canon 5d Software Download For Mac Openvpn Download Mac Os X Battle Vs Chess Mac Download Viaplay Download Mac What Is Terminal On Mac Used For Xsplit Mac Download Free XSplit VCam 1.2.2004.2201 Crack Plus Torrent Latest Download! XSplit VCam Crack is the best and fresh software for the users.
- Install PostgreSQL
- Install pgAdmin
Prerequisites
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.
Install PostgreSQL
As shown in the official Postgres download instructions here, there are few ways of installing PostgreSQL on Mac OS. Homebrew or Postgres.app are the common ones that often recommeded by other Mac users.
However, as I also use Linux and Windows machines for development, installing PostgreSQL using grapichal installer from EnterpriseDB would be a more widely used solution that keeps everything consistent across all my environment. This grapichal installer provides an easy and straightforward wizard to get Postgres installed with few simple clicks.
Download
- Go to https://www.enterprisedb.com/software-downloads-postgres
- Select a version. (For example, the latest installer version is
Version 9.4.0
). - Click 'Mac OS X' to download for Mac.
Install
- Install from the downloaded file
postgresql-9.4.0-1-osx.dmg
just like any other Mac installers. - Follow through the installation wizard with the default options.
- Installing Stack Builder is optional and can be omitted.
Add to PATH
Locate where PostgreSQL's binary is. By default, it should be
/Library/PostgreSQL/9.4/bin/psql
, where 9.4 is the PostgreSQL version number. Otherwise, use the followingfind
command to find the path.sudo find / -name 'psql'
Open
~/.bash_profile
with following command.open ~/.bash_profile
Add the following line to
.bash_profile
using the PostgreSQL's binary path.PATH=$PATH:/Library/PostgreSQL/9.4/bin
Install pgAdmin
pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL. It helps users manage PostgreSQL databases through graphical interfaces.
Install
- Download Mac OS dmg installer from https://www.pgadmin.org/download/macos4.php.
- Install it (e.g. the latest is
pgadmin3-1.20.0.dmg
).
Connect to server
- Open up pgAdmin III from the applications.
- The local DB should be already shown up in Obeject Browser -> Server Groups -> Servers -> PostgreSQL 9.4 (localhost:5432). If not, manually add a server pointing to
localhost:5432
or the port number specified when installing PostgreSQL.
Install pg gem
Homebrew Install Ruby
- Open up a terminal window
Find out where
pg_config
is using the command below. By default, it should be/Library/PostgreSQL/9.4/bin/pg_config
for PostgreSQL 9.4.sudo find / -name 'pg_config'
Install the gem with
pg-config
path explicitly specified.gem install pg -- --with-pg-config=/Library/PostgreSQL/9.4/bin/pg_config
Update Ruby on Rails project
Update 'Gemfile'. Replace
gem 'sqlite3'
withgem 'pg'
.Run
bundle install
.Open
config/database.yml
file and update it like the following:
Original (for SQLite):
New (For PostgreSQL):
Create DB using PostgreSQL
rake db:create && rake db:migrate
Further Reading
We recommend Ruby 2.2 or newer for use with Rails. Rails requires Ruby 1.9.3 or newer.
Source: Compile it yourself
Windows installer: Ruby, popular extensions, editor
OS X 10.5+: Included with developer tools
(then do gem update rails
)
We recommend managing your Ruby installation through rbenv. It’s an easy way to run multiple versions for different applications and update when a new release is made.
With Ruby installed, you can install all of Rails and its dependencies through RubyGems on the command line:
New versions of Rails can be installed the same way.
Rails Install For Mac High Sierra
Create your application skeleton and start the server:
Rails Install For Mac Mojave
You’re running Ruby on Rails! Follow the instructions on http://localhost:3000.
Rails Install For Mac Os
TextMate on OS X has long been the favored Rails editor, but the classic editors are still going strong. See VIM for Rails and Emacs for Rails. For a full-on IDE, check out JetBrains RubyMine.
You can get macOS PostgreSQL packages from several different sources.
Interactive installer by EDB
Download the installercertified by EDB for all supported PostgreSQL versions.
This installer includes the PostgreSQL server, pgAdmin; a graphical tool for managing and developingyour databases, and StackBuilder; a package manager that can be used to download and installadditional PostgreSQL tools and drivers. Stackbuilder includes management,integration, migration, replication, geospatial, connectors and other tools.
This installer can run in graphical, command line, or silent install modes.
The installer is designed to be a straightforward, fast way to get up and running withPostgreSQL on macOS.
Advanced users can also download azip archiveof the binaries, without the installer.This download is intended for users who wish to include PostgreSQL as part of another application installer.
Platform support
The installers are tested by EDB on the following platforms. They will generally work on newer versions of macOS as well:
PostgreSQL Version | 64-bit macOS Platforms |
---|---|
13 | 10.14 - 11.0 |
12 | 10.13 - 10.15 |
11 | 10.12 - 10.14 |
10 | 10.11 - 10.13 |
9.6 | 10.10 - 10.12 |
Postgres.app
Postgres.app is a simple, native macOS app that runs in the menubar without the need of an installer. Open the app, and you have a PostgreSQL serverready and awaiting new connections. Close the app, and the server shuts down.
Homebrew
PostgreSQL can also be installed on macOSusing Homebrew. Please see the Homebrewdocumentation for information on how to install packages.
A listof PostgreSQLpackages can be found using the Braumeister search tool.
MacPorts
PostgreSQL packages are also available for macOS from theMacPorts Project. Please see theMacPorts documentation for information on how to install ports.
A list ofPostgreSQL packagescan be found using the portfiles search tool on the MacPorts website.
Pgadmin For Windows 10
Fink
Pgadmin Download Mac
PostgreSQL packages are available for macOS from theFink Project.Please see the Fink documentation for information on how to install packages.
A list ofPostgreSQL packagescan be found using the package search tool on the Fink website.