Now that I’m just about ready to deploy my first rails app, I thought I’d get the deployment environment set up rock solid on both the production and the development machines (one Mac Mini and one MacBookPro).
Like many other tutorials on this same subject, your mileage may vary. In fact I’m writing this now, because mine did. After stalling out in many of the tutorials all different places, this is what worked for me.
Download and install MacPorts (used to be DarwinPorts)
Open up a terminal and type:
sudo port selfupdate
making sure everything is the way it should be.
If you’re like me, you get port: command not found in return.
I fixed this by opening up .bash_profile in a text editor (Textmate: mate ~/.bash_profile) and adding the line
export PATH=/opt/local/bin:$PATH
Next download and install MySQL5
I grabbed the binary from the bottom of the MySQL 5 download page. It comes with a System Preference Pane and checkbox for auto-startup. I’m using CocoaSQL for admin.
Change the MySQL5 root password
/opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password'
/opt/local/lib/mysql5/bin/mysqladmin -u root -h [HOSTNAME] password 'new-password'
Next load up the Apache2 package
sudo port install apache2
(this takes a while)
sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist to launch Apache2 on startup. I’ve disabled Apple’s default Web Sharing in the System Preferences.
Create an initial http.conf file
cd /opt/local/apache2/conf
sudo cp httpd.conf.sample httpd.conf
Start up Apache2
sudo /opt/local/apache2/bin/apachectl -k start
Load up http://localhost. It should say “It works!”
sudo port install fcgi
sudo port install lighttpd +ssl
sudo port install mod_fastcgi
Next load up Subversion package with the mod_dav_svn for Apache2
sudo port install subversion +mod_dav_svn +tools
Next load up Ruby, RubyGems, Termios, RB-MySQL5 Bridge, and ImageMagick Packages
sudo port install ruby
sudo port install rb-rubygems
sudo port install rb-termios
sudo port install rb-fcgi
sudo port install rb-mysql (I had some errors on this one.)
sudo port install imagemagick
Install a bunch of useful gems, like rails and capistrano.
sudo gem install --include-dependencies rake
sudo gem install --include-dependencies rails
sudo gem install --include-dependencies termios
sudo gem install --include-dependencies capistrano
sudo gem install daemons gem_plugin mongrel mongrel_cluster --include-dependencies
sudo gem install --include-dependencies mongrel
sudo gem install --include-dependencies mongrel_cluster
sudo gem install mysql -- \
--with-mysql-dir=/usr/local/mysql \
--with-mysql-include=/usr/local/mysql/include/ \
--with-mysql-lib=/usr/local/mysql/lib/ \
--with-mysql-config=/usr/local/mysql/bin/mysql_config
(thanks to d. robert adams for the last bit)
Create a rails app
rails testapp
Connect the rails app to mongrel
cd /RAILS/ROOT/OF/TESTAPP
mongrel_rails cluster::configure -e development -p 8000 -a 127.0.0.1 -N3 -c /RAILS/ROOT/OF/TESTAPP
分享到:
相关推荐
macports-2.4.1-10.11 安装包
- 如果未预装,可通过MacPorts、Homebrew等包管理器安装,或从Apache官网下载适合Mac的安装包进行手动安装。 2. 启动Apache服务 - 安装完成后,使用`sudo apachectl start`命令启动Apache服务。 - 要让Apache...
### Ruby on Rails 101:深入理解与实践 #### 引言 《Ruby on Rails 101》是一本介绍Ruby on Rails(简称RoR或ROR)的基础书籍,旨在为初学者提供一个全面而深入的学习框架。本书由Peter Marklund编写,包含了五天...
官网地址是:https://www.macports.org/install.php,该MacPorts是2.3.3版本的,适用于OS X 10.10系统
MacPorts-2.4.2-10.13-HighSierra.pkg,MacPorts-2.4.2-10.13-HighSierra.pkg,
MacPorts-2.4.0-10.11-ElCapitan.pkg
MacPorts
MacPorts-2.7.1-10.15-Catalina.pkg
### MacPorts手册知识点详解 #### 一、引言与概述 **MacPorts**是一个用于编译、安装和管理开源软件的高效系统。该系统由两大部分组成:基础设施(即MacPorts基础)和可用的端口集(ports)。一个**端口**是指包含...
e) 接下来,执行`sudo port install subversion-javahlbindings`。这个过程可能需要较长时间,特别是在网络速度较慢的情况下,请耐心等待。 f) 安装完成后,重启你的Mac,然后再次打开Eclipse,检查SVN Connector...
MacPorts-2.5.4-10.14-Mojave.pkg
MacPorts前称DarwinPorts[1],是一个软件包管理系统,用来简化Mac OS X和Darwin操作系统上软件的安装。它是一个用来简化自由软件/开放源代码软件的安装的自由/开放源代码项目,与Fink和BSD类ports套件的目标和功能...
MacPorts的用户可以通过简单的命令行指令,如`port install`,来执行这些Portfiles,从而自动完成整个安装过程,无需手动下载源代码、配置、编译和解决依赖关系。 在MacPorts中,软件包被组织成不同的类别,称为...
MacPorts-2.5.3-10.13-HighSierra.pkg 这个官网可以下载,但是实在是太慢太慢了,明明6M大小,我下了快1天,所以传到csdn,给需要下载的朋友一个捷径。
MacPorts前称DarwinPorts[1],是一个软件包管理系统,用来简化Mac OS X和Darwin操作系统上软件的安装。它是一个用来简化自由软件/开放源代码软件的安装的自由/开放源代码项目,与Fink和BSD类ports套件的目标和功能...
4. 随后运行`make install`,这会将`concurrentlua`安装到MacPorts的默认路径,使得系统能够全局访问。 安装完成后,你可以在你的Lua脚本中导入`concurrentlua`库,开始编写并发程序。例如,你可以创建协程...
Mac升级到10.13后ports也要跟着升级才能用 MacPorts-2.6.3-10.13-HighSierra.pkg
MacPorts是Mac OS X系统上的一款强大的开源软件管理工具,它允许用户方便地安装、管理和更新各种开源软件。MacPorts源自FreeBSD的port系统,它提供了丰富的软件包库,用户可以通过简单的命令行操作来管理这些软件。...
MacPorts是一个强大的开源工具,它为Mac OS X用户提供了管理和安装开源软件的便捷途径。MacPorts项目维护着一个丰富的软件仓库,其中包含了数千个预编译的开源软件包,覆盖了开发工具、科学计算、图形界面应用等多个...