This project is archived and is in readonly mode.
Undefined method, 'having', for Arel gem
-
Kieran P
My understanding is that the Arel gem isn't released yet, which contains the latest changes. You will need to put this in your Gemfile and rebundle:
gem 'arel', :git => 'git://github.com/rails/arel.git' -
Conrad Taylor
This issue has been resolved by updating the submodules,
git submodule update, which was the missing piece of the puzzle. Then performing agit pullfollowed by asudo rake install. Things are back to normal.@Kieran P - Thanks for the information because your information gave me the idea to revisit Rails 3.0.pre installation.
-
Matija Folnovic
I'm having same problem...
Conrad: tried your way, and I also tried to remove arel and init+update it again, and then sudo rake install, but still getting same error
Kleran: I don't understand your way, in which Gemfile should I put that and what do I do next ?
-
Matija Folnovic
Conrad: ok, fixed it somehow, I had to do: git clone git://github.com/rails/arel.git instead of doying git submodule update since this didn't give me latest code:
Submodule path 'arel': checked out '0faeb5047407348533db952d9cf93ea59d2526dc'
but newest commit is: c836c3ed10110d0446c4fce87d36c3f6c39b3cda -
Conrad Taylor
Matija, my previous instructions were not correct. One would need to perform the operations in the following order instead:
git pull git submodule update sudo rake installIn short, one will need to update the master project (i.e. rails) before updating any of its submodules (i.e. rack and arel).
-
Matija Folnovic
just tried that too, and still ( tried first without first two steps, and same thing ):
mfolnovic@mfolnovic-laptop:/media/Elements/mfolnovic/Projects/rails$ rm -r arel mfolnovic@mfolnovic-laptop:/media/Elements/mfolnovic/Projects/rails$ git submodule init mfolnovic@mfolnovic-laptop:/media/Elements/mfolnovic/Projects/rails$ git submodule update Initialized empty Git repository in /media/Elements/mfolnovic/Projects/rails/arel/.git/ remote: Counting objects: 4968, done. remote: Compressing objects: 100% (1882/1882), done. remote: Total 4968 (delta 3092), reused 4604 (delta 2879) Receiving objects: 100% (4968/4968), 517.32 KiB | 288 KiB/s, done. Resolving deltas: 100% (3092/3092), done. Submodule path 'arel': checked out '0faeb5047407348533db952d9cf93ea59d2526dc'but deleting and cloning from repo gets me to correct commit :P
-
Matija Folnovic
and I also did git pull before all this... ( argh, why I can't edit my comments :S )
-
Conrad Taylor
Matija, after removing the entire rails repository and re-installing everything, my initial still exists. It appears that AR is attempting to call a Arel method, 'having', which doesn't exist:
/opt/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.pre/lib/active_record/relation/query_methods.rb:39:in `having'The extract of the method contains the following:
def having(*args) return spawn if args.blank? if [String, Hash, Array].include?(args.first.class) havings = @klass.send(:merge_conditions, args.size > 1 ? Array.wrap(args) : args.first) else havings = args.first end spawn(@relation.having(havings)) # NoMethodError (undefined method `having' for #<Arel::Project:0x2da4bc8>) endNext, the 'git pull' of the parent project, rails, is associated with a certain commit of arel and a certain commit of rack. Thus, after comparing the sha1 hash on github.com with the sha1 hash on my system for the arel project, I would say that I have the latest
source. -
Josh Graham
+1 to Kieren P's suggestion.
-
Conrad Taylor
- Tag changed from arel, rails3 to arel, rails3, ruby1.9
-
Conrad Taylor
After updating my Gemfile, it seems that things are finally working again. You can find my Gemfile below:
# Edit this Gemfile to bundle your application's dependencies. git "git://github.com/rails/arel.git" ## Bundle edge rails: gem "rails", "3.0.pre", :git => "git://github.com/rails/rails.git" ## Bundle the gems you use: gem "sqlite3-ruby", :require_as => "sqlite3" gem "rack" gem "tzinfo" -
Steve St. Martin
- Tag changed from arel, rails3, ruby1.9 to arel, invalid, rails3, ruby1.9
I was able to successfully create a working rails app with the above Gemfile, seems issues are only encountered when using directory within your Gemfile and pointing it at the initial clone.
-
Emilio Tagua
- State changed from new to resolved
This was a problem in Arel release not including having, this issue is already solved.