Hi,
In Ubuntu 11.10 environment, when I try to "require" a gem in the user-defined controller, I am getting a LoadError. This even happens with the "apps/learning_switch_memcached" example as follows:
user@ubuntu:~/work/trema$ ./trema run ../apps/learning_switch_memcached/learning-switch.rb
...
/home/user/work/trema/ruby/trema/command/run.rb:104:in `load_config': /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- memcache (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from ../apps/learning_switch_memcached/fdb.rb:30
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from (eval):29:in `load_config'
from /home/user/work/trema/ruby/trema/command/run.rb:67:in `run'
from ./trema:86:in `__send__'
from ./trema:86
The following is my ruby $LOAD_PATH and gem environment as well as location of "memcache" gem
user@ubuntu:~$ irb
irb(main):001:0> $LOAD_PATH
=> ["/usr/local/lib/site_ruby/1.8", "/usr/local/lib/site_ruby/1.8/i686-linux", "/usr/local/lib/site_ruby/1.8/i486-linux", "/usr/local/lib/site_ruby", "/usr/lib/ruby/vendor_ruby/1.8", "/usr/lib/ruby/vendor_ruby/1.8/i686-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/i686-linux", "/usr/lib/ruby/1.8/i486-linux", "."]
irb(main):002:0> exit
user@ubuntu:~$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/lib/ruby/gems/1.8
- /home/user/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
user@ubuntu:~$ gem which memcache
/usr/lib/ruby/gems/1.8/gems/memcache-client-1.8.5/lib/memcache.rb
I have tried various versions and installation mechanisms of "rubygems" including apt-get, RVM and manual installation with the same result. Am I missing some environment setting?
Thank You,
Regards
Karthik