-
-
Save sourceperl/b84ab0d723bda21321fc to your computer and use it in GitHub Desktop.
Bash script to install a Thingspeak server on Debian Jessie
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: