Skip to content

Instantly share code, notes, and snippets.

@sourceperl
Forked from abythell/thingspeak-install.sh
Last active December 7, 2016 19:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sourceperl/b84ab0d723bda21321fc to your computer and use it in GitHub Desktop.
Save sourceperl/b84ab0d723bda21321fc to your computer and use it in GitHub Desktop.
Bash script to install a Thingspeak server on Debian Jessie
#!/bin/bash
# Automatic install of Thingspeak server on Debian jessie
# Updated to use ruby 2.1.4
## check root level
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
## debian non interactire
export DEBIAN_FRONTEND=noninteractive
## Install required packages
apt-get update
apt-get upgrade -y
apt-get -y install build-essential git mysql-server mysql-client libmysqlclient-dev libxml2-dev libxslt-dev libssl-dev libsqlite3-dev
## Install ruby
#wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.4.tar.gz
#tar xvzf ruby-2.1.4.tar.gz
#cd ruby-2.1.4
#./configure
#make
#sudo make install
#cd ..
apt-get -y install ruby ruby-dev
## Install rails
echo "gem: --no-rdoc --no-ri" >> ${HOME}/.gemrc
gem install rails
## Install thingspeak
git clone https://github.com/iobridge/thingspeak.git
cp thingspeak/config/database.yml.example thingspeak/config/database.yml
cd thingspeak
bundle install
bundle exec rake db:create
bundle exec rake db:schema:load
rails server
@scargill
Copy link

scargill commented Dec 7, 2016

Not on a Pi...

Successfully installed i18n-0.8.0.beta1
Fetching: activesupport-5.0.0.1.gem (100%)
ERROR: Error installing rails:
activesupport requires Ruby version >= 2.2.2.
Cloning into 'thingspeak'...
remote: Counting objects: 3342, done.
remote: Total 3342 (delta 0), reused 0 (delta 0), pack-reused 3342
Receiving objects: 100% (3342/3342), 3.53 MiB | 599.00 KiB/s, done.
Resolving deltas: 100% (2021/2021), done.
Checking connectivity... done.
./thingspeak.sh: line 37: bundle: command not found
./thingspeak.sh: line 38: bundle: command not found
./thingspeak.sh: line 39: bundle: command not found
./thingspeak.sh: line 40:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment