Difference between revisions of "InstallingAboutUsOnOSX"

(Added instructions for updating to 64-bit on snow leopard)
(migration import)
 

(38 intermediate revisions by 10 users not shown)



Line 1: Line 1:
 +
{{RightTOC}}
 
==Xcode tools==
 
==Xcode tools==
 
* Available on OS X install DVD or from http://developer.apple.com/tools/xcode/
 
* Available on OS X install DVD or from http://developer.apple.com/tools/xcode/
Line 6: Line 7:
 
* Verify that git functions.
 
* Verify that git functions.
  
==Dev environment==
+
==MacPorts==
(Includes precompiled Apache, PHP, Ruby, and all necessary libraries and extensions)
+
Download and install:
 
+
* http://www.macports.org/
==Copy Base Files==
 
* Download au_dev_environment.dmg from nimbus and open the image file.
 
* Copy [dev image]/opt and [dev image]/www to /
 
<pre>
 
  cp -r /Volumes/AboutUs\ dev\ environment/www /Volumes/AboutUs\ dev\ environment/opt /
 
</pre>
 
 
 
==Configure your environment==
 
* Edit your ~/.profile (or ~/.bashrc) and append the lines from [dev image]/profile
 
* Restart any open terminal sessions.
 
* Append the following line to /etc/hosts:
 
<pre>
 
127.0.0.1 compostus
 
</pre>
 
  
==Update git repositories==
+
==MySQL==
* In /www/aboutus/www, and /www/aboutus/compostus edit the .git/config file and change the URL for the 'origin' remote to
+
Download and install version 5.1.
<pre>
+
* http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.53-osx10.6-x86_64.tar.gz/from/http://mysql.he.net/
<email>15bb9cd2f75f14e2b92c6ec81bd372cb</email>:AboutUs/compostus.git
 
</pre>
 
* Run 'git pull' in each of the above directories:
 
  
* Clone electric_sheep into /www/aboutus/electric_sheep
+
==Ruby==
<pre>
+
Download and install version 1.8.7p249
  git clone <email>15bb9cd2f75f14e2b92c6ec81bd372cb</email>:AboutUs/electric_sheep.git /www/aboutus/electric_sheep
+
* ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p249.tar.gz
</pre>
 
  
==Setup MySQL==
+
Build:
* Copy mysql-5.0.67-osx10.5-x86 to /usr/local
+
  mkdir /www
* Run the following commands to set up mysql:
+
  ./configure --prefix=/www
<pre>
+
  make
cd /usr/local
+
  make install
sudo ln -s mysql-5.0.67-osx10.5-x86 mysql
 
sudo chown -R _mysql /usr/local/mysql/data
 
sudo mysqld_safe (If you haven't start your mysql)
 
</pre>
 
  
 +
(edit .profile like so:)
 +
  export PATH=/www/bin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:$PATH
  
==Install gem requirements==
+
==RubyGems==
* Update rubygems and geminstaller
+
Download and install version 1.3.5
<pre>
+
* http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
  sudo gem update --system
 
  sudo gem update geminstaller
 
</pre>
 
* Add github as a gem source
 
<pre>
 
  gem source -a http://gems.github.com/
 
</pre>
 
* (optional) Disable generation of rDoc and ri documentation to speed up the gem install process by editing ~/.gemrc to include
 
<pre>
 
  gem: --no-rdoc --no-ri
 
</pre>
 
* Go to /www/aboutus/compostus/compost and run geminstaller as root. This will standarized all gems needed to run AboutUs.
 
  
==MacPorts==
+
<code>
* Libraries copied over as part of dev environment install process should work fine.
+
ruby setup.rb
* However, the MacPorts installation is partially broken and won't install new libraries.  To fix this, reinstall MacPorts (available at http://www.macports.org/install.php).  This won't remove or overwrite existing libraries.
+
</code>
* Do this after existing dev environment has been installed.
 
  
==Rebuild for 64-bit==
+
==Misc. Libraries==
* If you're on Snow Leopard, you may find problems with gems with native extensions. This is because the dev image binaries are 32-bit, but your gems will likely build as 64-bit. RubyInline in particular will be broken.
+
Run these commands:
* To fix things, you need everything consistently 32-bit or 64-bit. I have not found a way to force gems to build as 32-bit, so here's how to migrate to 64-bit binaries.
 
* gd2 however does not work with 64-bit ruby
 
<pre>
 
# in /opt/local/etc/macports/variants.conf add this line to build all ports in
 
# both 32-bit and 64-bit. It's slower but it should limit compatibility issues.
 
+universal
 
  
# n the shell, rebuild all ports:
+
  sudo port install freeimage
# some ports with lots of dependencies (ie ncurses) may fail. You likely can ignore this,
+
  sudo port install gd2
# or use the various force commands to overcome the dependency cycles
+
  gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
> sudo port upgrade --enforce-variants installed
 
  
 +
==AboutUs repos==
 +
  mkdir -p /www/aboutus ;
 +
  cd /www/aboutus
 +
  git clone <email>15bb9cd2f75f14e2b92c6ec81bd372cb</email>:AboutUs/compostus.git
 +
  git clone <email>15bb9cd2f75f14e2b92c6ec81bd372cb</email>:AboutUs/electric_sheep.git
 +
  cd /www/aboutus/compostus/compost
 +
  gem install geminstaller
 +
  geminstaller
  
# now, rebuild ruby as x86_64
 
> cd /www/source/ruby-1.8.7-p22
 
> make
 
> sudo make install
 
  
# download and install x86_64 mysql binaries
+
==Cassandra==
> cd /www/source
+
  mkdir -p /www/compile
> sudo port install wget
+
  cd /www/compile
> sudo wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.86-osx10.5-x86_64.tar.gz/from/http://mysql.he.net/
+
  curl -O http://mirror.its.uidaho.edu/pub/apache/incubator/cassandra/0.5.0/apache-cassandra-incubating-0.5.0-bin.tar.gz
> tar xvfz mysql-5.0.86-osx10.5-x86_64.tar.gz
+
  tar xvf apache-cassandra-incubating-0.5.0-bin.tar.gz
> sudo mysqladmin -u root shutdown
+
  mv apache-cassandra-incubating-0.5.0 /www/cassandra
> sudo cp -r mysql/data mysql-5.0.86-osx10.5-x86_64/
+
  cp /www/aboutus/compostus/cassandra/storage-conf.xml.devel /www/cassandra/conf/storage-conf.xml
> sudo chown -R _mysql mysql-5.0.86-osx10.5-x86_64/data
+
Running:
> sudo rm mysql
+
  cd /www/cassandra
> sudo ln -s mysql-5.0.86-osx10.5-x86_64 mysql
+
  ./bin/cassandra
> sudo mysqld_safe &
 
  
# build mysql ruby bindings from source as the current gem has a bug
+
==Configure the app==
> cd /www/source
 
> sudo wget http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.8.1.tar.gz
 
> sudo tar xvfz mysql-ruby-2.8.1.tar.gz
 
> cd mysql-ruby-2.8.1
 
> make
 
> sudo make install
 
  
# now rebuild all gems to update to 64-bit for native extensions
+
* create databases
> sudo gem pristine --all
+
  mysql -u root
 +
  create database compostus_wiki_test;
 +
  create database compostus_wiki_dev;
 +
  grant all on *.* to wiki@localhost identified by 'wiki';
  
# and clear out any cached rubyinline object files
+
* install sysop user
> rm -rf ~/.ruby_inline
+
  mysql -u root compostus_wiki_dev < ../sysop_user.sql
</pre>
 
  
==Oddities==
+
* run the build script
* If vim is acting strangely, remove the MacPorts version--the built-in OS X version works much better.  Do so by running
+
  cd /www/aboutus/compostus/compost
<pre>
+
  script/build
port uninstall vim
 
</pre>
 
  
* If you are asked for an SSL password when starting the dev server, try 'default'
+
* run rake
 +
  cd /www/aboutus/compostus/compost
 +
  rake db:migrate
 +
  rake
  
==Build from scratch==
+
__NOTOC__
Don't do this, it is many times more effort.  If we somehow lose the dev environment image, here are partially correct instructions on how to rebuild from scratch: [[InstallingAboutUsOnOSXFromScratch]].
 

Latest revision as of 09:14, 12 November 2013

Xcode tools

Git

MacPorts

Download and install:

MySQL

Download and install version 5.1.

Ruby

Download and install version 1.8.7p249

Build:

 mkdir /www
 ./configure --prefix=/www
 make
 make install

(edit .profile like so:)

 export PATH=/www/bin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:$PATH

RubyGems

Download and install version 1.3.5

ruby setup.rb

Misc. Libraries

Run these commands:

 sudo port install freeimage
 sudo port install gd2
 gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

AboutUs repos

 mkdir -p /www/aboutus ;
 cd /www/aboutus
 git clone :AboutUs/compostus.git
 git clone :AboutUs/electric_sheep.git
 cd /www/aboutus/compostus/compost
 gem install geminstaller
 geminstaller


Cassandra

 mkdir -p /www/compile
 cd /www/compile
 curl -O http://mirror.its.uidaho.edu/pub/apache/incubator/cassandra/0.5.0/apache-cassandra-incubating-0.5.0-bin.tar.gz
 tar xvf apache-cassandra-incubating-0.5.0-bin.tar.gz
 mv apache-cassandra-incubating-0.5.0 /www/cassandra
 cp /www/aboutus/compostus/cassandra/storage-conf.xml.devel /www/cassandra/conf/storage-conf.xml

Running:

 cd /www/cassandra
 ./bin/cassandra

Configure the app

  • create databases
 mysql -u root
 create database compostus_wiki_test;
 create database compostus_wiki_dev;
 grant all on *.* to wiki@localhost identified by 'wiki';
  • install sysop user
 mysql -u root compostus_wiki_dev 


Retrieved from "http://aboutus.com/index.php?title=InstallingAboutUsOnOSX&oldid=33693903"