additional fixes for install script

This commit is contained in:
Albert Yi
2016-10-17 15:53:37 -07:00
parent 86af580445
commit ced7a34afa
5 changed files with 22 additions and 2 deletions

View File

@@ -57,6 +57,7 @@ gem 'dtext_rb', :git => "https://github.com/r888888888/dtext_rb.git", :require =
gem 'google-api-client'
gem 'cityhash'
gem 'bigquery', :git => "https://github.com/abronte/BigQuery.git", :ref => "b92b4e0b54574e3fde7ad910f39a67538ed387ad"
gem 'memcache_mock'
# needed for looser jpeg header compat
gem 'ruby-imagespec', :require => "image_spec", :git => "https://github.com/r888888888/ruby-imagespec.git", :branch => "exif-fixes"

View File

@@ -210,6 +210,7 @@ GEM
ntlm-http (~> 0.1, >= 0.1.1)
webrobots (>= 0.0.9, < 0.2)
memcache-client (1.8.5)
memcache_mock (0.0.14)
memoist (0.14.0)
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
@@ -439,6 +440,7 @@ DEPENDENCIES
kgio
mechanize
memcache-client
memcache_mock
mocha
net-sftp
net-ssh

View File

@@ -34,7 +34,7 @@ export GITHUB_INSTALL_SCRIPTS=https://raw.githubusercontent.com/r888888888/danbo
# Install packages
echo "* Installing packages..."
apt-get update
apt-get -y install build-essential automake libssl-dev libxml2-dev libxslt-dev ncurses-dev sudo libreadline-dev flex bison ragel memcached libmemcached-dev git curl libcurl4-openssl-dev imagemagick libmagickcore-dev libmagickwand-dev sendmail-bin sendmail postgresql postgresql-contrib libpq-dev postgresql-server-dev-all nginx ssh coreutils
apt-get -y install build-essential automake libssl-dev libxml2-dev libxslt-dev ncurses-dev sudo libreadline-dev flex bison ragel memcached libmemcached-dev git curl libcurl4-openssl-dev imagemagick libmagickcore-dev libmagickwand-dev sendmail-bin sendmail postgresql postgresql-contrib libpq-dev postgresql-server-dev-all nginx ssh coreutils ffmpeg mkvtoolnix
if [ $? -ne 0 ]; then
echo "* Error installing packages; aborting"
@@ -132,6 +132,8 @@ echo "*"
echo "* You can also run a server locally without having to deal with deploys"
echo "* by running the following command:"
echo "*"
echo "* bundle install"
echo "* bundle exec rake db:create db:migrate"
echo "* bundle exec rails server"
echo "*"
echo "* This will start a web process running on port 3000 that you can"

View File

@@ -98,7 +98,7 @@ module Danbooru
# List of memcached servers
def memcached_servers
%w(localhost:11211)
%w(127.0.0.1:11211)
end
# After a post receives this many comments, new comments will no longer bump the post in comment/index.

View File

@@ -2,6 +2,21 @@ unless defined?(MEMCACHE)
MEMCACHE = Dalli::Client.new(Danbooru.config.memcached_servers, :namespace => Danbooru.config.app_name.gsub(/[^A-Za-z0-9]/, "_"))
end
begin
MEMCACHE.get("x")
rescue Dalli::RingError => e
puts "-" * 40
puts "WARNING! MEMCACHE SERVER NOT FOUND! You will experience performance degradation."
puts e.to_s
puts "-- BEGIN STACKTRACE --"
e.backtrace.each do |line|
puts line
end
puts "-- END STACKTRACE --"
puts "-" * 40
MEMCACHE = MemcacheMock.new
end
if Rails.env.production?
Rails.application.configure do
config.cache_store = :dalli_store, Danbooru.config.memcached_servers