Question

In trying to use the mail gem from geany I get errors as so:

/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

However, the program runs fine from the 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:~$ 

Why does geany have trouble with the mail gem?

Just to confirm:

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

Was it helpful?

Solution

your system is not configured to use login shell, here is an example how to enable login shell in gnome terminal https://rvm.io/integration/gnome-terminal/

also running:

rvm get head --auto-dotfiles

will update your shell configuration to load rvm in the "right" way

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top