sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
使用 rbenv
依照安裝指示:
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
修改 ~/.bashrc
# ~/.bashrc
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
裝 ruby-build plugin
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
重整 shell(開新的 Terminal 視窗),然後檢查 rbenv 指令:
type rbenv
#=> "rbenv is a function"
開始安裝 ruby:
rbenv install 2.3.1
rbenv global 2.3.1 # set as global
設置 gem 安裝設定
echo 'gem: --no-ri --no-rdoc' >> ~/.gemrc
gem install bundler
參照:https://nodejs.org/en/download/package-manager/
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install libpq-dev imagemagick libmagickwand-dev libqt4-dev libqtwebkit-dev
sudo apt-get install redis-server
sudo service redis-server status # 看一下有沒有跑起來
sudo service redis-server start # optional,redis 沒有跑起來的話
git clone https://github.com/colorgy/CrawlerMaster
cd CrawlerMaster
echo '
REDIS_URL=redis://localhost:6379/
REDIS_NAMESPACE=crawler_master
' >> .env
bundle install
cp config/database.yml.example config/database.yml
rake db:setup && rake db:migrate && rake db:seed
gem install foreman
foreman start -f Procfile.dev
就可以登入 http://localhost:3000/ 了,預設的登入帳密是 admin/password,由 db/seeds.rb
建立。
是 Ruby 的靜態語法檢查工具,有 Vim 平臺的 syntastic(neomake 比較順)、Atom 的 linter-rubocop 可以設置。