文档里面似乎没有写啊
thin start -o -C config/thin.yml 出现
/usr/lib/ruby/1.8/thin/runner.rb:174:in start': wrong number of arguments (1 for 0) (ArgumentError)
from /usr/lib/ruby/1.8/thin/runner.rb:174:in
send'
from /usr/lib/ruby/1.8/thin/runner.rb:174:in run_command'
from /usr/lib/ruby/1.8/thin/runner.rb:140:in
run!'
from /usr/bin/thin:6
错误
用 rails s 可以运行。。。
@inetufo user.rb
def admin?
return true if Setting.admin_emails.include?(self.email)
return false
end
setting.rb
source "#{Rails.root}/config/config.yml"
config.yml
admin_emails:
- "[email protected]"
注册账号的时候用 [email protected] 或者把自己的 email 添上去就好了
def admin?
return true if Setting.admin_emails.include?(self.email)
return false
end
和
def admin?
Setting.admin_emails.include?(self.email)
end
的區別是?
~/oss/ruby_china$ ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux] ```
其他输出省略5000字 。。。
```~/oss/ruby_china$ thin start -O -C config/thin.yml
/usr/lib/ruby/1.8/optparse.rb:1450:in `complete': invalid option: -O (OptionParser::InvalidOption)
from /usr/lib/ruby/1.8/optparse.rb:1448:in `catch'
from /usr/lib/ruby/1.8/optparse.rb:1448:in `complete'
from /usr/lib/ruby/1.8/optparse.rb:1287:in `parse_in_order'
from /usr/lib/ruby/1.8/optparse.rb:1254:in `catch'
from /usr/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'
from /usr/lib/ruby/1.8/optparse.rb:1248:in `order!'
from /usr/lib/ruby/1.8/optparse.rb:1339:in `permute!'
from /usr/lib/ruby/1.8/optparse.rb:1360:in `parse!'
from /usr/lib/ruby/1.8/thin/runner.rb:131:in `parse!'
from /usr/lib/ruby/1.8/thin/runner.rb:47:in `initialize'
from /usr/bin/thin:6:in `new'
from /usr/bin/thin:6
~/oss/ruby_china$ thin --v
thin 1.2.4 codename Flaming Astroboy
~/oss/ruby_china$ thin --h
Usage: thin [options] start|stop|restart|config|install
Server options:
-a, --address HOST bind to HOST address (default: 0.0.0.0)
-p, --port PORT use PORT (default: 3000)
-S, --socket FILE bind to unix domain socket
-y, --swiftiply [KEY] Run using swiftiply
-A, --adapter NAME Rack adapter to use (default: autodetect)
(rails, ramaze, halcyon, merb, mack, mack, file)
-R, --rackup FILE Load a Rack config file instead of Rack adapter
-c, --chdir DIR Change to dir before starting
--stats PATH Mount the Stats adapter under PATH
Adapter options:
-e, --environment ENV Framework environment (default: development)
--prefix PATH Mount the app under PATH (start with /)
Daemon options:
-d, --daemonize Run daemonized in the background
-l, --log FILE File to redirect output (default: log/thin.log)
-P, --pid FILE File to store PID (default: tmp/pids/thin.pid)
-u, --user NAME User to run daemon as (use with -g)
-g, --group NAME Group to run daemon as (use with -u)
--tag NAME Additional text to display in process listing
Cluster options:
-s, --servers NUM Number of servers to start
-o, --only NUM Send command to only one server of the cluster
-C, --config FILE Load options from config file
--all [DIR] Send command to each config files in DIR
Tuning options:
-b, --backend CLASS Backend to use, full classname
-t, --timeout SEC Request or command timeout in sec (default: 30)
-f, --force Force the execution of the command
--max-conns NUM Maximum number of connections (default: 1024)
Might require sudo to set higher then 1024
--max-persistent-conns NUM Maximum number of persistent connections
(default: 512)
--threaded Call the Rack application in threads [experimental]
--no-epoll Disable the use of epoll
Common options:
-r, --require FILE require the library
-D, --debug Set debbuging on
-V, --trace Set tracing on (log raw request/response)
-h, --help Show this message
-v, --version Show version
1、这里显示的选项没有“-O”只有 -o,怎么回事? 2、上面“-O”是什么目的?
#11 楼 @huacnlee 是不是可以在 https://github.com/huacnlee/ruby-china/blob/master/README.markdown 文件里把涉及到软件的版本都标上。这样大家有个参考。
1、这样以后部署时因为版本带来的提问就可以少一些.(maybe:)
2、-O 选项如果是关键性的,那用错了版本后只能去掉-O 选项,可能对运行引入新问题 (maybe or not。。。 :)
[root@west8028 ruby-china]# thin start -O -C config/thin.yml
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/thin-1.3.1/lib/thin/runner.rb:171:in chdir': No such file or directory - /home/ruby/www/ruby-china/current (Errno::ENOENT)
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thin-1.3.1/lib/thin/runner.rb:171:in
run_command'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thin-1.3.1/lib/thin/runner.rb:151:in run!'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/thin-1.3.1/bin/thin:6:in
'
from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/thin:23:in load'
from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/thin:23:in
@niedhui 所以是修改这三个文件写入自己的邮箱即可了?现在部署完毕也修改之后直接登录链接的域名是出现了 sentora 的后台 http://www.besteve.xyz,需要用户名密码,那么到这一步之后如何处理的呢?还不是特别理解。