Google Groups Home
Help | Sign in
undefined method `init_rails' for Haml:Module (NoMethodError)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Jay  
View profile
 More options Jun 30, 6:47 pm
From: Jay <jay.janshe...@gmail.com>
Date: Mon, 30 Jun 2008 15:47:05 -0700 (PDT)
Local: Mon, Jun 30 2008 6:47 pm
Subject: undefined method `init_rails' for Haml:Module (NoMethodError)
I'm hitting an error the solution to which I suspect will be painfully
obvious.

I'm on Rails 2.1 and have just installed haml via git.  When I try to
start the rails app, I get the following error:

  undefined method `init_rails' for Haml:Module (NoMethodError)

Has anyone bumped into this?

Thanks!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan Weizenbaum  
View profile
 More options Jun 30, 9:18 pm
From: Nathan Weizenbaum <nex...@gmail.com>
Date: Mon, 30 Jun 2008 21:18:02 -0400
Local: Mon, Jun 30 2008 9:18 pm
Subject: Re: [haml] undefined method `init_rails' for Haml:Module (NoMethodError)
How exactly did you install Haml?


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jay  
View profile
 More options Jun 30, 9:25 pm
From: Jay <jay.janshe...@gmail.com>
Date: Mon, 30 Jun 2008 18:25:17 -0700 (PDT)
Local: Mon, Jun 30 2008 9:25 pm
Subject: Re: undefined method `init_rails' for Haml:Module (NoMethodError)
Hi there.  Yeah, I seem to have just plain missed a lot of the files.
Here's what I did:

  git clone git://github.com/nex3/haml.git
  cd haml
  sudo rake install
  haml --rails /path/to/my/app

And I got no error messages-- it acted like it installed fine.  It
copied a file into the vendor/plugins folder, but did not copy any
files in to lib.  I'm moving them over manually now and have just
gotten past the init_rails issue, but there seems to be quite a bit of
stuff out of place, so I'm going through and trying to find what's
missing.  (currently VERSION is out of place).

On Jun 30, 9:18 pm, Nathan Weizenbaum <nex...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan Weizenbaum  
View profile
 More options Jun 30, 9:35 pm
From: Nathan Weizenbaum <nex...@gmail.com>
Date: Mon, 30 Jun 2008 21:35:10 -0400
Local: Mon, Jun 30 2008 9:35 pm
Subject: Re: [haml] Re: undefined method `init_rails' for Haml:Module (NoMethodError)
haml --rails is only supposed to add one file - it loads the rest from
the gem. Try getting rid of vendor/plugins/haml/lib entirely, and try
again. If that doesn't work, what output does "haml --version" give you?


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jay  
View profile
 More options Jun 30, 9:59 pm
From: Jay <jay.janshe...@gmail.com>
Date: Mon, 30 Jun 2008 18:59:08 -0700 (PDT)
Local: Mon, Jun 30 2008 9:59 pm
Subject: Re: undefined method `init_rails' for Haml:Module (NoMethodError)
haml --version
Haml 2.1.0.ff425bd

Regarding vendor/plugins/haml/lib, that's the thing-- there is no
'lib' in vendor/plugins/haml.  When I run the haml --rails command, I
end up with only a single file: vendor/plugins/haml/init.rb.

Trying your suggestion regarding removing the directories entirely.
Thanks very much, by the way.

On Jun 30, 9:35 pm, Nathan Weizenbaum <nex...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jay  
View profile
 More options Jun 30, 10:02 pm
From: Jay <jay.janshe...@gmail.com>
Date: Mon, 30 Jun 2008 19:02:21 -0700 (PDT)
Local: Mon, Jun 30 2008 10:02 pm
Subject: Re: undefined method `init_rails' for Haml:Module (NoMethodError)
haml --version
Haml 2.1.0.ff425bd

Regarding vendor/plugins/haml/lib, that's the thing-- there is no
'lib' in vendor/plugins/haml.  When I run the haml --rails command, I
end up with only a single file: vendor/plugins/haml/init.rb.

Trying your suggestion regarding removing the directories entirely.
Thanks very much, by the way.

On Jun 30, 9:35 pm, Nathan Weizenbaum <nex...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jay  
View profile
 More options Jun 30, 10:39 pm
From: Jay <jay.janshe...@gmail.com>
Date: Mon, 30 Jun 2008 19:39:06 -0700 (PDT)
Local: Mon, Jun 30 2008 10:39 pm
Subject: Re: undefined method `init_rails' for Haml:Module (NoMethodError)
No luck there.  I remove everything haml I can find and then as
before:

  git clone git://github.com/nex3/haml.git
  cd haml
  sudo rake install
  haml --rails /path/to/my/app

which gives me only

  vendor/plugins/haml/init.rb

but no other directories or files.

Strangely, vendor/plugins/haml is always owned by 'root' instead of by
me, so maybe a permission issue with the install script?  I'll report
back here if I can find anything.  Thanks again.

On Jun 30, 10:02 pm, Jay <jay.janshe...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan Weizenbaum  
View profile
 More options Jun 30, 11:03 pm
From: Nathan Weizenbaum <nex...@gmail.com>
Date: Mon, 30 Jun 2008 23:03:49 -0400
Local: Mon, Jun 30 2008 11:03 pm
Subject: Re: [haml] Re: undefined method `init_rails' for Haml:Module (NoMethodError)
haml --rails is only supposed to install vendor/plugins/haml/init.rb.
The rest is loaded from the gem.

The standard way to install the gem from source is to run "rake install"
without sudo - the rake task should sudo when it needs to - so that may
be the cause of the permissions thing. Does it work if you chmod the
plugin dir so that you have write access?


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jay  
View profile
 More options Jul 1, 6:21 am
From: Jay <jay.janshe...@gmail.com>
Date: Tue, 1 Jul 2008 03:21:41 -0700 (PDT)
Local: Tues, Jul 1 2008 6:21 am
Subject: Re: undefined method `init_rails' for Haml:Module (NoMethodError)
Ok, so I removed haml on both dev & production box:

  sudo gem uninstall haml
  (all versions)

And then reinstalled on dev & production:

  git clone git://github.com/nex3/haml.git
  cd haml
  rake install [no sudo this time]

Everything is fine, no errors.  On the dev box:

  haml --rails /path/to/my/app

and then checked into git, commit & deploy.  Now in production I have

  rails --version
  Rails 2.1.0

  gem --version
  1.2.0

  haml --version
  Haml 2.1.0.ff425bd

and in the plugins directory

  init.rb

But still

  undefined method `init_rails' for Haml:Module (NoMethodError)

Which means the gem isn't loading properly.  As per init.rb, if I move
the haml files into vendor/plugins/haml they will be picked up, but
with all sorts of other wonky errors.

Regarding your question about chown-ing the directory, no, I tried
that before to no avail.  But this time I installed it without sudo
and now no problems with ownership that I can see.

So that's the assumption I'm working with now: that in init.rb,
"require 'haml'" isn't picking up the gem somehow.

Hmm.

On Jun 30, 11:03 pm, Nathan Weizenbaum <nex...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan Weizenbaum  
View profile
 More options Jul 1, 9:30 am
From: Nathan Weizenbaum <nex...@gmail.com>
Date: Tue, 01 Jul 2008 09:30:52 -0400
Local: Tues, Jul 1 2008 9:30 am
Subject: Re: [haml] Re: undefined method `init_rails' for Haml:Module (NoMethodError)
What happens if you try requiring Haml from IRB? Does #init_rails exist?


    Reply    Reply to author    Forward