我想玩三个类似的Ruby宝石,名叫'yahoofinance''yahoo-finance'和'yahoo_stock'。我对每个宝石如何与雅虎金融合作感兴趣。于是,我开始创建一个RVM宝石,如何使用RVM创建三颗宝石gemset?
[sandbox]$ rvm gemset create finance
'finance' gemset created (/Users/milktrader/.rvm/gems/[email protected]).
然后我用它,
[sandbox]$ rvm gemset use finance
Now using gemset 'finance'
然后接上它红宝石,
[sandbox]$ rvm [email protected]
然后我安装上述三个宝石,
[sandbox]$ gem install yahoo-finance yahoofinance yahoo_stock
Successfully installed yahoo-finance-0.0.2
Successfully installed yahoofinance-1.2.2
Successfully installed yahoo_stock-1.0.2
3 gems installed
.
.
.
Installing RDoc documentation for yahoo_stock-1.0.2...
现在我不在假设我可以要求所有三个宝石在irb sesssion中。其中只有一个返回true。
ruby-1.9.2-head > require 'yahoofinance'
=> true
而其他两个抛出错误。
ruby-1.9.2-head > require 'yahoo-finance'
LoadError: no such file to load -- yahoo-finance
ruby-1.9.2-head > require 'yahoo_stock'
SyntaxError: ...
宝石或我的装置有问题吗?
注意:我对rvm gemset use命令有些迷惑,它可能没有在上面正确使用。
[sandbox]$ gem list
*** LOCAL GEMS ***
bundler (1.0.7)
rake (0.8.7)
yahoo-finance (0.0.2)
yahoo_stock (1.0.2)
yahoofinance (1.2.2)
此gemset中`gem list`的输出是什么? – Matchu 2010-12-21 23:10:14
@Matchu,我把它放在上面的问题中。 – Milktrader 2010-12-21 23:23:01