来个 Go on Rails!
哪位高人出来带头用 go 重新实现一个 rails 吧。
#5 楼 @zhangjinzhu 这个正是我需要的效果。谢谢。
貌似 ruby 不管你怎么 Thread.new 都只有一个系统级别的线程,Ruby 的线程是建立在系统线程之上的。。T T
#13 楼 @jjym 我打算用 keepalive 和 pipelining https://github.com/igrigorik/em-http-request/wiki/Keep-Alive-and-HTTP-Pipelining
#6 楼 @jjym 能帮我看看这段代码吗?为什么这么慢?options 里的 header 是我在 chrome 里 copy 出来的。
#! /usr/local/bin/ruby
require 'eventmachine'
require 'em-http'
require 'nokogiri'
@count = 0
@topic_ids =%w{14854 11168 14769 14875}
@conn = EventMachine::HttpRequest.new('http://www.ruby-china.org')
@options = {
:redirects => 5,
:keepalive => true,
:path => "",
:head => {
'accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'accept-encoding' => 'gzip,deflate,sdch',
'accept-language' => 'en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4',
'cache-control' => 'max-age=0',
'user-agent' => 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36'
}
}
EventMachine.run{
@topic_ids.each do |id|
@options[:path] = "/topics/#{id}"
req1 = @conn.get @options
req1.errback{|req|
puts 'errback..............';
p req
@count = @count + 1; EventMachine.stop if @topic_ids.length == @count
}
req1.callback{
puts req1.req.path
#doc = Nokogiri::HTML(req1.response)
p req1.response_header
@count = @count + 1; EventMachine.stop if @topic_ids.length == @count
}
end
}
待业青年,但不符合要求。。。玩 rails 只有半年多。。。帮顶。。。
#1 楼 @xds2000 看来是我没有认真看它的介绍,这款框架人气是最高的。。跨平台性也很好。。谢谢 Desktop browsers
The File Upload plugin is regularly tested with the latest browser versions and supports the following minimal versions:
Google Chrome Apple Safari 4.0+ Mozilla Firefox 3.0+ Opera 11.0+ Microsoft Internet Explorer 6.0+ Mobile browsers
The File Upload plugin has been tested with and supports the following mobile browsers:
Apple Safari on iOS 6.0+ Google Chrome on iOS 6.0+ Google Chrome on Android 4.0+ Default Browser on Android 2.3+ Opera Mobile 12.0+
楼主能否帮忙看一下我的问题: http://ruby-china.org/topics/11335 mongoid 和 carrierwave-mongoid 降到和楼主同样的版本还是同样的问题。 谢谢。
#9 楼 @fenprace
crazyjin@T500:/$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/crazyjin/sda3/myscript/:/opt/jdk1.6/bin:/opt/jdk1.6/jre/bin:/opt/mongodb2.4.3/bin
crazyjin@T500:/$ sudo su
root@T500:/# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/crazyjin/sda3/myscript/:/opt/jdk1.6/bin:/opt/jdk1.6/jre/bin:/opt/mongodb2.4.3/bin
root@T500:/#
when i ln /opt/mngodb/bin/mongod to /usr/local/bin/mongod as a symbolic link and i excutes
sudo mongod
it works well.
i read manpage of sudo.but i can not understant it.it looks like there are some security policies there. The symbolic links solved my problem. thank you.
#2 楼 @vincenttone
crazyjin@T500:~$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/crazyjin/sda3/myscript/:/opt/jdk1.6/bin:/opt/jdk1.6/jre/bin:/opt/mongodb2.4.3/bin
crazyjin@T500:~$ sudo echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/crazyjin/sda3/myscript/:/opt/jdk1.6/bin:/opt/jdk1.6/jre/bin:/opt/mongodb2.4.3/bin
crazyjin@T500:~$
这可以说明问题么?