Homeland ruby-china 源代码管理员账号是什么?

inetufo · 2011年12月30日 · 最后由 yuanchenhao 回复于 2016年05月28日 · 8433 次阅读

文档里面似乎没有写啊

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:insend' from /usr/lib/ruby/1.8/thin/runner.rb:174:in run_command' from /usr/lib/ruby/1.8/thin/runner.rb:140:inrun!' 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 添上去就好了

#2 楼 @niedhui 弱弱的問一下

def admin?
  return true if Setting.admin_emails.include?(self.email)
  return false
end

def admin?
  Setting.admin_emails.include?(self.email)
end

的區別是?

#3 楼 @Victor 我觉得功能上没区别吧,但这样写更好,简洁,易读:

def admin?
  Setting.admin_emails.include?(self.email)
end

我只是把 ruby-china 的源码添上来的,方便找。。。。

@inetufo thin start -o -C config/thin.yml报错是因为-o 要大写为-O

弱弱问问,看 ruby-china 后台是 cpanel,貌似输入http://ruby-china.org/cpanel 进不去,是啥原因呢?

@huacnlee 登录页面都看不到,想问下哪里设置这种限制呢?

#5 楼 @camel

~/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”是什么目的?

你的版本问题

~ ‹ruby-1.9.2›  $ thin -v
thin 1.3.1 codename Triple Espresso

#11 楼 @huacnlee 是不是可以在 https://github.com/huacnlee/ruby-china/blob/master/README.markdown 文件里把涉及到软件的版本都标上。这样大家有个参考。 1、这样以后部署时因为版本带来的提问就可以少一些.(maybe:)
2、-O 选项如果是关键性的,那用错了版本后只能去掉-O 选项,可能对运行引入新问题 (maybe or not。。。 :)

#10 楼 @kjpioo
-O, --onebyone Restart the cluster one by one (only works with restart command) 版本问题 -O 是在 thin 1.2.10 后才加的

#5 楼 @camel

[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:inrun_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

'

#14 楼 @buyhomeconfig/thin.yml 中的 /home/ruby/www/ruby-china/current 目录改成你自己的目录。

@niedhui 所以是修改这三个文件写入自己的邮箱即可了?现在部署完毕也修改之后直接登录链接的域名是出现了 sentora 的后台 http://www.besteve.xyz,需要用户名密码,那么到这一步之后如何处理的呢?还不是特别理解。

huacnlee 提问要有方法 提及了此话题。 04月03日 10:56
需要 登录 后方可回复, 如果你还没有账号请 注册新账号