#3 楼 @uudui https://github.com/jason6020/depot_2 谢谢 我觉得我无能为力啊 现在一直在写 cpp objective-c 感觉写网站很容易 晚上写的玩玩 没想到遇到很多问题额 呵呵
#5 楼 @blacktulip 不懂咯 我照着那本书上写得额 应该不会涉及到那个地方 我感觉是 CSS 没有 load 对 因为我一直是以为是 load depot.css 的
#5 楼 @blacktulip https://github.com/jason6020/depot_2大牛看看我这代码 很简单 分分钟可以看明白 我这个地方不太明白啊 谢谢
https://github.com/jason6020/depot_2/blob/master/config/routes.rb 路由里面没有指定 carts/
的路由,所以访问顶楼截图的 url 只会显示 404。
你用 git status
看看是不是所有代码都提交了。
我记着那本书的某个版本那里有个小错误的,某处应该是 css.scss 文件,而书上写的是 css 文件,所以这样按照他书里面 scss 格式放在 css 样式就会有问题
#!/usr/bin/ruby
require 'pty' require 'expect'
ip = ARGV[0] outlet_id = ARGV[1]
PTY.spawn( 'telnet ' + ip ) do |read,write,pid| write.sync = true $expect_verbose = true
read.expect(/User Name : $/,3) write.print "#######\r"
read.expect(/Password : $/) write.print "#######\r"
read.expect(/^>.*/,2) write.print "1\r" #Type 1 for "Device Manager"
read.expect(/^>.*/,2) write.print "2\r" #Type 2 for "Outlet Management"
read.expect(/^>.*/,2) write.print "1\r\r" #Type 2 for "Outlet Control/Configuration"
read.expect(/^>.*/,2) write.print "#{outlet_id}\r\r" #Enter the required outlet number"
read.expect(/^>.*/,2) write.print "1\r" #Select 1 to control the outlet"
read.expect(/^>.*/) write.print "3\r" #Select 3 for immediate reboot"
read.expect(/cancel.*:/) #Select 1 to control the outlet" write.print "YES\r" # outlet has now been power cycled
read.expect(/Press to continue./) #press enter to return to menu write.print "\r" read.expect(/^>./)
end # end pty spawn