1.Ruby installation. Note: do not use the latest 2.2 or 2.3 version of ruby. Some components may not be installed
yum -y install openssl-devel gcc wget https://ruby.taobao.org/mirrors/ruby/2.1/ruby-2.1.7.tar.gz tar zxf ruby-2.1.7.tar.gz cd ruby-2.1.7 ./configure --prefix=/usr/local/ruby2.1.7 make && make install echo 'export PATH=/usr/local/ruby2.1.7/bin:$PATH'>>/etc/profile source /etc/profile
2.RubyGems tool installation
wget http://rubygems.global.ssl.fastly.net/rubygems/rubygems-2.6.2.tgz tar zxf rubygems-2.6.2.tgz cd rubygems-2.6.2 ruby setup.rb
3. The replacement of gem source is also due to the problem of network environment, so it is very slow to visit the official source
gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/ gem sources -l
4.Grokbug installation
mkdir /usr/local/grokbug cd /usr/local/grokbug wget https://codeload.github.com/nickethier/grokdebug/zip/master unzip master mv grokdebug-master/* . rm -rf grokdebug-master/
5. Install Ruby components (the following components have corresponding requirements for the version). Check the missing components. Execute the following command in / usr/local/grokbug, and you will be prompted about the components and the corresponding version
ruby config.ru
Installation components and corresponding versions
gem install bundler gem install cabin -v=0.5.0 gem install haml -v=3.1.7 gem install jls-grok -v=0.10.10 gem install json -v=1.7.5 gem install kgio -v=2.8.0 gem install rack -v=1.4.1 gem install rack-protection -v=1.2.0 gem install raindrops -v=0.11.0 gem install shotgun -v=0.9 gem install tilt -v=1.3.3 gem install sinatra -v=1.3.3 gem install unicorn -v=4.6.3
6. Replace Google's jquery source, and replace Google's source with China's Sina source.
cd views sed -i 's#//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js#//lib.sinaapp.com/js/jquery/1.8.1/jquery.min.js#g' index.haml sed -i 's#//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js#//lib.sinaapp.com/js/jquery-ui/1.9.2/jquery-ui.min.js#g' index.haml sed -i 's#//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js#//lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js#g' patterns.haml sed -i 's#//ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/ui-lightness/jquery-ui.css#//lib.sinaapp.com/js/jquery-ui/1.9.0/themes/ui-lightness/jquery-ui.css#g' layout.haml sed -i 's#//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js#//lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js#g' discover.haml
7. Start the service. 8080 is the access port, which can be customized
nohup bundle exec unicorn -p 8080 -c ./unicorn &