我试图将aws-s3 gem与最新版本的Rails(4.1.0)集成,并在启动服务器时收到此错误:
aws-s3-0.6.3/lib/aws/s3/extensions.rb:223:in `class_eval': ///.rvm/gems/ruby-1.9.3-p385/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223: syntax error, unexpected $undefined (SyntaxError) unless defined? @@{:instance_writer=>true}
Run Code Online (Sandbox Code Playgroud)
有没有人有任何想法?
宝石的大部分尚未更新超过两年,所以我认为它可能最终会过时.
我试图从一个通过cron作业调用的脚本重启NGINX服务(它在root用户在命令行中运行时有效) - 我不确定这是否相关但是还会创建相关的cron作业通过脚本.我尝试了多个命令,但我正在使用的当前命令如下:
sudo /etc/init.d/nginx restart
任何有关这方面的帮助都会很棒!
UPDATE
下面是cron运行并尝试重新加载nginx服务的脚本
#!/bin/bash
NGINX_CONFIG='/etc/nginx/sites-available'
NGINX_SITES_ENABLED='/etc/nginx/sites-enabled'
WEB_DIR='/var/www/vhosts/demos'
EMAIL=$1
DOMAIN=$2
SITE_DIR=$3
echo $DOMAIN
echo $SITE_DIR
# Remove the nginx configurtations
rm -Rf $NGINX_CONFIG/$DOMAIN.conf
rm -Rf $NGINX_SITES_ENABLED/$DOMAIN.conf
# Remove the access log
rm -Rf /var/log/nginx/$SITE_DIR.access.log
# Remove unicorn socket log
rm -Rf /tmp/unicorn.$SITE_DIR.sock
# Remove the DB
sudo psql -U postgres -c "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '_$SITE_DIR' AND pid <> pg_backend_pid();"
dropdb -U postgres $SITE_DIR
# Remove the sites application from the server …Run Code Online (Sandbox Code Playgroud)