-
Notifications
You must be signed in to change notification settings - Fork 24
How to Install on a fresh Mac
Many of these steps were taken from here and or reference this document: http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#step-4
These steps were originally for OS X Mountain Lion but have been updated for OS X Mavericks.
- Follow step 1 (http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#step-1) to install xcode
- Follow step 2 (http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#step-2) to verify gcc
- su to an admin user
- Run the ruby -e step from (http://brew.sh/)
- exit out of the su
- run brew doctor
- you might need to make sure you own the
/usr/local/
folder so that you don't need to sudo when using brew or bundler. To do this, run the following:sudo chown -R your_user_name:staff /usr/local/
- and you also might need to
chown -R your_user_name:staff /Library/Caches/Homebrew/
- Install Git by following step 3 ( https://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#step-3)
- Configure Git by follow step 4 ( http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#step-4)
- Run Steps to install RBenv (https://github.com/sstephenson/rbenv#homebrew-on-mac-os-x)
- set up your git ssh key by following the steps here: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
- run
git clone [email protected]:psu-stewardship/scholarsphere.git
- run
brew install clamav
- The current version of clamav 0.98.4 has some issues that cause Ruby to throw a "Can't allocate memory" error. To work around this switch to the previous version:
brew versions clamav
# if version is 0.98.4 follow these steps to downgrade to 0.98.3
cd /usr/local
git checkout XXX YYY (where XXX and YYY are the values for 0.98.3 reported above)
brew unlink clamav
brew install clamav
brew switch clamav 0.98.3
- create configuration files for freshclam
cp /usr/local/etc/clamav/freshclam.conf.sample /usr/local/etc/clamav/freshclam.conf
cp /usr/local/etc/clamav/clamd.conf.sample /usr/local/etc/clamav/clamd.conf
perl -pi -e 's/^/#/ if /^Example/' /usr/local/etc/clamav/freshclam.conf
-
run
freshclam
-
run
brew install mysql
-
run
mkdir -p ~/Library/LaunchAgents
-
run
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
-
run
mysql -uroot
-
run
CREATE USER 'user'@'localhost' IDENTIFIED BY 'pass';
-
run
GRANT ALL PRIVILEGES ON * . * TO 'user'@'localhost';
-
run
FLUSH PRIVILEGES;
-
run
quit
-
run
brew install redis
-
run
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
-
run
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
-
run
brew cask install xquartz
-
run
brew install imagemagick --with-ghostscript --with-x11 --with-tiff --with-jp2
-
You may run into issues with mogrify and text extraction not running
rspec ./spec/features/file_set/extracted_text_search_spec.rb:16
- I needed to revert my version of ghostscript
brew unlink ghostscript brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/946485c40d03f19a53b711214b51fe614648fcd4/Formula/ghostscript.rb
- I needed to revert my version of ghostscript
-
run
brew install ffmpeg --with-tools --with-fdk-aac --with-libvorbis --with-libvpx
-
run
brew install fits
-
mark fits.sh as executable
chmod u+x /usr/local/Cellar/fits/1.2.1/bin/fits.sh
-
run
fits.sh -h
from the command line and see a help message to ensure FITS is properly installed -
add the full fits.sh path to your PATH (e.g., in your .bash_profile)
export PATH="$PATH:/usr/local/Cellar/fits/1.2.1/bin/fits.sh"
-
run
brew cask install libreoffice
LibreOffice is only needed if you want to generate thumbnails for Microsoft Office documents (.docx, .pptx, et cetera.) -
add the path to "soffice" to your PATH (typically under
/Applications/LibreOffice.app/Contents/MacOS/
) -
run
cd scholarsphere
say yes to trusting the .rvmrc file -
install bundler
gem install bundler
(On a brand new Mac you might need to exit Terminal and open it again to force the rbenv shims to be regenerated and recognizebundle install
on the next step) -
run
bundle install
- you may have a clamav issue fix is here: https://github.com/psu-stewardship/scholarsphere/wiki/Clam-AV-Error-on-Bundle-install
- you may have a mysql issue run
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
-
To copy the config files to the local location run (Alternatively you can ask one of the developers on the team for their current config files):
cp config/sample/* config/
cp config/sample/initializers/* config/initializers/
- edit
config/database.yml
and comment out the top sqlite half and uncomment the bottom MySQL half. Update thesocket
setting to be/tmp/mysql.sock
. To find the socket location on your MySQL instance runmysqladmin variables | grep socket
- edit config/hydra-ldap.yml to point to the correct ldap location
- for deployment you need a newrelic.yml file
- run
rake db:create
(note if things start acting funny here reboot and double check privileges are still applied in mysql) - run
rake scholarsphere:generate_secret
- run
rake db:migrate
- run
RAILS_ENV=test rake db:migrate
- run
solr_wrapper --config config/solr_wrapper_test.yml
- run
fcrepo_wrapper --config config/fcrepo_wrapper_test.yml
- run
bundle exec rails server
When running the app locally in development, you need to spoof the LDAP integration. Use the modHeaders plugin for Chrome, or the Modify Header plugin for Firefox. This is only when running in development mode when you need to look at the application in a complete web environment.
Configure the plugin (either for Chrome or Firefox) by setting the REMOTE_USER variable. Ex:
REMOTE_USER = "xyz123"
Use your Penn State ID for the user. If you have authenticated to PSU services, such as Webmail, then reloading the Scholarsphere homepage will use that authentication token and you will appear as logged in using the same user with which you authenticated earlier.
In addition, you might consider creating a bash script with the following commands so that Jetty and resque-pool can be easily be restarted next time you reboot your machine:
cd ~/dev/scholarsphere
rake jetty:start
resque-pool --daemon --environment development start