`require':无法加载这样的文件 - 邮件(LoadError)

时间:2012-12-20 08:51:01

标签: ruby ide editor rvm geany

在尝试使用来自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在邮件宝石上有问题?

只是为了确认:

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:~$ 

geany mailing list question

related question

1 个答案:

答案 0 :(得分:1)

您的系统未配置为使用登录shell,以下是如何在gnome终端https://rvm.io/integration/gnome-terminal/中启用登录shell的示例

还在运行:

rvm get head --auto-dotfiles

将更新您的shell配置以“正确”方式加载rvm