Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2
Add Ubuntu/Debian support#2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -60,10 +60,10 @@ else | ||
| fi | ||
| fi | ||
| # WITH_DEP=true bin/setup will install system dependencies (mac only) | ||
| # WITH_DEP=true bin/setup will install system dependencies (mac and ubuntu/debian only) | ||
| if [ -n "$WITH_DEP" ]; then | ||
| echo "Checking system dependencies..." | ||
| # Ubuntu/Debian support was once working; Here it determines if you're on a mac or debian | ||
| # Here it determines if you're on a Mac or Ubuntu/Debian | ||
| IS_MAC=false; IS_DEBIAN=false | ||
| [[ -f /etc/debian_version ]] && IS_DEBIAN=true | ||
| [[ $(command -v sw_vers) && $(sw_vers -productVersion | cut -f2 -d.) -ge 7 ]] && IS_MAC=true | ||
| @@ -90,11 +90,67 @@ if [ -n "$WITH_DEP" ]; then | ||
| echo $PATH | grep $(cd $(which gem)/..;pwd) > /dev/null | ||
| [[ $? -ne 0 ]] && echo 'For ruby gems to work, add the current path to your profile (.bashrc, .zshrc, etc): | ||
| export PATH="$(cd $(which gem)/..;pwd):$PATH"' | ||
| elif $IS_DEBIAN; then | ||
| # Installing ruby | ||
| if [[ ! $(command -v ruby) ]]; then | ||
| append_log successfully sudo apt-get install -y build-essential libffi-dev libgdbm-dev libncurses5-dev libreadline-dev libssl-dev libyaml-dev zlib1g-dev | ||
| echo "Downloading Ruby 2" | ||
| wget -qO - "ftp://ftp.ruby-lang.org/pub/ruby/ruby-2.0-stable.tar.gz" | tar xzf - | ||
| echo "Installing Ruby 2" | ||
| quietly cd ruby-* && ./configure --silent --prefix=/usr/local/lib/ruby --bindir=/usr/local/bin && make --silent && sudo make install --silent && cd .. | ||
| quietly successfully rm -rf ruby-* | ||
| fi | ||
| # Installing memcached | ||
| append_log successfully sudo apt-get install -y memcached | ||
| # Installing ImageMagick | ||
| append_log successfully sudo apt-get install -y imagemagick libdjvulibre-dev libjpeg-dev libtiff-dev libwmf-dev libmagickcore-dev libmagickwand-dev libmagick++-dev | ||
| # Installing PhantomJS | ||
| LATEST_PHANTOMJS_VERSION=`wget -qO - "https://code.google.com/p/phantomjs/downloads/list?can=1" | sed -E 's/^.*(phantomjs)-(.*)-linux-.*$/\2/' | sed -e '/^[0-9].*/!d' | sort | sed '$!d'` | ||
| PJS32="https://phantomjs.googlecode.com/files/phantomjs-$LATEST_PHANTOMJS_VERSION-linux-i686.tar.bz2" | ||
| PJS64="https://phantomjs.googlecode.com/files/phantomjs-$LATEST_PHANTOMJS_VERSION-linux-x86_64.tar.bz2" | ||
| [[ $(dpkg-architecture -qDEB_HOST_ARCH) = 'amd64' ]] && PJSURL=$PJS64 || PJSURL=$PJS32 | ||
| wget -qO - $PJSURL | tar xvjf - | ||
| append_log successfully sudo cp phantomjs-*/bin/phantomjs /usr/local/bin/ | ||
| quietly successfully rm -rf phantomjs-* | ||
| append_log successfully sudo apt-get install -y libfreetype6 fontconfig | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these needed for phantomjs too? Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes | ||
| echo "Installing system libraries so we can compile some gems" | ||
| quietly successfully sudo apt-get install -y g++ libcurl3 | ||
| # For nokogiri gem | ||
| append_log successfully sudo apt-get install -y libxml2-dev libxslt1-dev | ||
| # Using NodeJS as javascript runtime | ||
| quietly successfully sudo add-apt-repository -y ppa:chris-lea/node.js | ||
| quietly successfully sudo apt-get update | ||
| append_log successfully sudo apt-get install -y nodejs | ||
| # Installing Heroku Toolbelt | ||
| append_log successfully wget -qO toolbelt.sh https://toolbelt.heroku.com/install-ubuntu.sh | ||
| append_log successfully sh toolbelt.sh | ||
| quietly successfully rm toolbelt.sh | ||
| # Installing Postgres | ||
| quietly successfully sudo apt-get install -y python-software-properties | ||
| quietly successfully sudo add-apt-repository -y ppa:pitti/postgresql | ||
| quietly successfully sudo apt-get update | ||
| append_log successfully sudo apt-get install -y postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2 postgresql-client-9.2 | ||
| quietly successfully sudo sed -i 's/peer$/trust/g' /etc/postgresql/9.2/main/pg_hba.conf | ||
| quietly successfully sudo sed -i 's/md5$/trust/g' /etc/postgresql/9.2/main/pg_hba.conf | ||
| append_log sudo service postgresql restart && sudo su postgres -c "createuser -s -d $USER" && createdb | ||
| fi | ||
| fi | ||
| echo "Installing libraries..." | ||
| append_log successfully gem list -i bundler || gem install bundler | ||
| append_log gem list -i bundler || gem install bundler | ||
| append_log successfully bundle install --path vendor/bundle --binstubs vendor/bundle/bin | ||
| # Flush all the memcaches | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ericboehs, What you think about this approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not bad.
The latest version of ruby 2.0 is available here: ftp://ftp.ruby-lang.org/pub/ruby/ruby-2.0-stable.tar.gz .. but nice sed work ;) We could probably just assume if they have any version of ruby 2.0 it's good enough.
Line 98: Tick marks
have been deprecated in favor of$()` (see). But that doesn't matter as 95-102 could be:As I mentioned in my previous comment, you could pipe wget's output directly to tar. So 106-108:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to put wget and tar on the same line as you said, but:
Here is the line:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try dropping the
pflag from tar. This works for me:wget -qO - https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2 | tar xjf -There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm looks like the
pflag just preserves permissions, so I'm not sure why that would fail.Here's my full output:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to remove
quietly successfullyand now It works!