Here I am here and I appeal to all of you for help in this problem f * # $ ^.
I am running on a private server with root privileges on Dreamhost. Here is a bit about my environment and versions.
$ `which ruby` -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
$ `which bundle` -v
Bundler version 1.0.15
$ `which rails` -v
Rails 3.0.9
Besides this error, rails application works fine without problems. However, when I try to change the encoding of a string using a method encode, it:
NoMethodError: undefined method `encode' for "foobar":String
encode to be determined , but it is not! Encodingfound if I try in irb:
$ irb
ruby-1.9.2-p180 :001 > Encoding
=> Encoding
ruby-1.9.2-p180 :002 > "foobar".encode('utf-8')
=> "foobar"
But if I try to use the rails console through bundle exec, Encodingit will not be found:
$ bundle exec rails c staging
Loading staging environment (Rails 3.0.9)
ruby-1.9.2-p180 :001 > Encoding
NameError: uninitialized constant Encoding
from /[REDACTED]/shared/bundle/ruby/1.8/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing'
from (irb):1
ruby-1.9.2-p180 :002 > "foobar".encode('utf-8')
NoMethodError: undefined method `encode' for "foobar":String
Obviously, the installation does not load something correctly, but I'm not sure where to look for it. What am I missing here?
UPDATE 6/19/2011
, , 1.8. , bundle exec , ruby rails:
$ bundle exec which ruby
/path/to/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
$ bundle exec `which ruby` -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
$ bundle exec which rails
/path/to/shared/bundle/ruby/1.8/bin/rails
$ bundle exec `which rails` -v
Rails 3.0.9
, - ... , .
6/26/2011
$LOAD_PATH...
6/26/2011 ()
Gemfile.lock pp ENV... ENV , GEM_PATH . staging.rb :
GEM_HOME = "/home/[REDACTED]/.rvm/gems/ruby-1.9.2-p180@[REDACTED]"
GEM_PATH = "/home/[REDACTED]/.rvm/gems/ruby-1.9.2-p180@[REDACTED]:/home/[REDACTED]/.rvm/gems/ruby-1.9.2-p180@global"
... , , . GEM_HOME GEM_PATH
6/27/2011
.bundle/config ...