# Undefined Method Angst After Rails / Ruby / Gem Updates

**URL:** <https://www.ruby-forum.com/t/undefined-method-angst-after-rails-ruby-gem-updates/142278>\
**Category:** Rails\
**Created:** [July 5, 2008, 10:14pm UTC](https://www.ruby-forum.com/t/undefined-method-angst-after-rails-ruby-gem-updates/142278 "2008-07-05T22:14:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay\_Jansheski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dfb087/32.png) [@Jay\_Jansheski](https://www.ruby-forum.com/u/Jay_Jansheski)\
**Post date:** [July 5, 2008, 10:14pm UTC](https://www.ruby-forum.com/t/undefined-method-angst-after-rails-ruby-gem-updates/142278/1 "2008-07-05T22:14:52Z")

</div>

I have what appears to be a problem accessing methods from within an  
application. I can access them from irb, but not from within the  
app. In other words:

```
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'haml'
=> true
irb(main):003:0> Haml.respond_to?('init_rails')
=> true
irb(main):004:0>

```

But in the app, similar code gives an ‘undefined method’ error.

```
begin
  require File.join(File.dirname( __FILE__ ), 'lib', 'haml') # From

```

here  
rescue LoadError  
require ‘haml’ # From gem  
end  
Haml.init\_rails(binding)

undefined method `init\_rails’ for Haml:Module (NoMethodError)

The only thing that makes sense to me is that somewhere in the app the  
gem path is overridden or isn’t being picked up properly. Any  
suggestions would be greatly appreciated- this one is driving me  
bonkers. I don’t think it has anything to do with haml-- I think it  
has to do with the application reading the gems-- but I could be  
wrong.

Some more details:

rails --version  
Rails 2.1.0

gem env:

RubyGems Environment:

- RUBYGEMS VERSION: 1.2.0
- RUBY VERSION: 1.8.7 (2008-06-20 patchlevel 22) [i686-darwin9.3.0]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
  - ruby
  - x86-darwin-9

- GEM PATHS:
  - /usr/local/lib/ruby/gems/1.8 [this is correct]

- GEM CONFIGURATION:
  - :update\_sources =\> true
  - :verbose =\> true
  - :benchmark =\> false
  - :backtrace =\> false
  - :bulk\_threshold =\> 1000
  - :sources =\> [“[http://gems.rubyforge.org](http://gems.rubyforge.org)”, “http://  
[gems.datamapper.org](http://gems.datamapper.org)”]

- REMOTE SOURCES:
  - [http://gems.rubyforge.org](http://gems.rubyforge.org)
  - [http://gems.datamapper.org](http://gems.datamapper.org)
