...
用 wubi 的 ubentu 装得要吐血了,各种错误各种无反映各种重装。。。。 wiki 里面的步骤 0 加上 rvm requirements,再加上 apt-get 装一些装不了的再卸载 apt-get remove,还要多 source/gem source 几次最后 gem 就差不多了。。。 终于装上了,虽然还有些问题。。。
先用一个这个命令: rvm requirements 然后通过提示下载安装了一堆不知到什么的东东,然后 rvm pkg install zlib rvm remove 1.9.3 rvm install 1.9.3 这里就安装不成功了。。。 提示:gemset.pristine 错误 .rvm/log/ruby-1.9.3-p374/gemset.pristine.log
安装 rails 时使用命令: gem install bundler rails
出现错误: @ubuntu:~$ gem install bundler rails ERROR: Loading command: install (LoadError) cannot load such file -- zlib ERROR: While executing gem ... (NameError) uninitialized constant Gem::Commands::InstallCommand
Inheritance and Mixins
Some object-oriented languages (notably C++) support multiple inheritance, where a class can have more than one immediate parent, inheriting functionality from each. Although powerful, this technique can be dangerous, as the inheritance hierarchy can become ambiguous. Other languages, such as Java, support single inheritance. Here, a class can have only one immediate parent. Although cleaner (and easier to implement), single inheritance also has drawbacks---in the real world things often inherit attributes from multiple sources (a ball is both a bouncing thing and a spherical thing, for example). Ruby offers an interesting and powerful compromise, giving you the simplicity of single inheritance and the power of multiple inheritance. A Ruby class can have only one direct parent, and so Ruby is a single-inheritance language. However, Ruby classes can include the functionality of any number of mixins (a mixin is like a partial class definition). This provides a controlled multiple-inheritance-like capability with none of the drawbacks. We'll explore mixins more beginning on page 98. So far in this chapter we've been looking at classes and their methods. Now it's time to move on to the objects, such as the instances of class Song.
#22 楼 @alucardpj 完全不了解 linux。。先从 wubi 的 unbuntu 开始吧,不知道能不能 coding。。
MAC。。。。 人穷伤不起
其实 p Obj 就是原样输出,p Obj.inspect 就是强制转换成 to_s 后输出
#4 楼 @zhangjinzhu 我试了下好像不是复写,而是共享,即实例会去每个同名类里面查找需要的信息
奇怪了,为什么 inspect 可以呢?
额,不行
@sailtsao ruby 那个看是看过的,看不太懂。。 不清楚 trap 是怎么识别信号的,我回去看看你的链接,谢谢。