在尝试使用geany的邮件 gem 时,我收到如下错误:
/home/thufir/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mail (LoadError)
from /home/thufir/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from mail.rb:3:in `<main>'
------------------
(program exited with code: 1)
Press return to continue
但是,该程序在 CLI 中运行良好:
thufir@dur:~$
thufir@dur:~$ ruby ruby/mail.rb
hello world
hello world
thufir@dur:~$
thufir@dur:~$ nl ruby/mail.rb
1 require 'yaml'
2 require 'net/imap'
3 require 'mail'
4 2.times do
5 puts 'hello world'
6 end
thufir@dur:~$
thufir@dur:~$ ruby -v
ruby 1.9.3p327 (2012-11-10 revision 37606) [i686-linux]
thufir@dur:~$
thufir@dur:~$ gem -v
1.8.24
thufir@dur:~$
thufir@dur:~$ rvm -v
rvm 1.17.2 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
thufir@dur:~$
为什么 geany 对邮件 gem 有问题?
只是为了确认:
thufir@dur:~$
thufir@dur:~$ type rvm | head -1
rvm is a function
thufir@dur:~$
thufir@dur:~$ gem list --local
*** LOCAL GEMS ***
bundler (1.2.3)
i18n (0.6.1)
mail (2.5.3)
mime-types (1.19)
polyglot (0.3.3)
rake (10.0.3)
rubygems-bundler (1.1.0)
rvm (1.11.3.5)
treetop (1.4.12)
thufir@dur:~$