You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
Should mention I use padrino, but above error occurs when trying to upgrade using migrations. No problem using Enum in my models so I guess it is purely a migrations problem.
Yes it is listed in my Gemfile.lock file. It worked before I updated ruby/gem/padrino packages on my Ubuntu.
I fixed it temporarily by using DataMapper::Property::Enum instead of just Enum.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have the class below
class User
include DataMapper::Resource
property :id, Serial
property :display, Enum[ :first, :last, :first_last, :last_first ]
end
When I try and run rake db:autoupgrade I get the following error message: uninitialized constant User::Enum
Below is the trace from rake:
** Invoke db:autoupgrade (first_time)
'** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant User::Enum
/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/dm-core-1.2.0/lib/dm-core/model.rb:728:in
const_missing' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/dm-core-1.2.0/lib/dm-core/property/lookup.rb:25:in
const_missing'/Users/Jon/addtoit/app/models/user.rb:7:in
<class:User>' /Users/Jon/addtoit/app/models/user.rb:1:in
<top (required)>'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/dm-rails-1.2.1/lib/dm-rails/setup.rb:60:in
block (2 levels) in preload_models' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/dm-rails-1.2.1/lib/dm-rails/setup.rb:60:in
each'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/dm-rails-1.2.1/lib/dm-rails/setup.rb:60:in
block in preload_models' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/dm-rails-1.2.1/lib/dm-rails/setup.rb:59:in
each'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/dm-rails-1.2.1/lib/dm-rails/setup.rb:59:in
preload_models' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/dm-rails-1.2.1/lib/dm-rails/railtie.rb:80:in
block (2 levels) in class:Railtie'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:418:in
_run__2565405975579041820__prepare__1633098324659922499__callbacks' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in
__run_callback'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in
_run_prepare_callbacks' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in
run_callbacks'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:74:in
prepare!' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:48:in
prepare!'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/railties-3.2.3/lib/rails/application/finisher.rb:47:in
block in <module:Finisher>' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/railties-3.2.3/lib/rails/initializable.rb:30:in
instance_exec'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/railties-3.2.3/lib/rails/initializable.rb:30:in
run' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/railties-3.2.3/lib/rails/initializable.rb:55:in
block in run_initializers'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/railties-3.2.3/lib/rails/initializable.rb:54:in
each' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/railties-3.2.3/lib/rails/initializable.rb:54:in
run_initializers'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/railties-3.2.3/lib/rails/application.rb:136:in
initialize!' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in
method_missing'/Users/Jon/addtoit/config/environment.rb:5:in
<top (required)>' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/railties-3.2.3/lib/rails/application.rb:103:in
require'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/railties-3.2.3/lib/rails/application.rb:103:in
require_environment!' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/railties-3.2.3/lib/rails/application.rb:292:in
block (2 levels) in initialize_tasks'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
call' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
block in execute'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
each' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
execute'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/task.rb:158:in
block in invoke_with_call_chain' /Users/Jon/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in
mon_synchronize'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
invoke_with_call_chain' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/task.rb:176:in
block in invoke_prerequisites'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
each' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
invoke_prerequisites'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/task.rb:157:in
block in invoke_with_call_chain' /Users/Jon/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in
mon_synchronize'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
invoke_with_call_chain' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/task.rb:144:in
invoke'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/application.rb:116:in
invoke_task' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
block (2 levels) in top_level'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
each' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
block in top_level'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
standard_exception_handling' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/application.rb:88:in
top_level'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/application.rb:66:in
block in run' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
standard_exception_handling'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/lib/rake/application.rb:63:in
run' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/gems/rake-0.9.2.2/bin/rake:33:in
<top (required)>'/Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/bin/rake:19:in
load' /Users/Jon/.rvm/gems/ruby-1.9.3-p125@rails32/bin/rake:19:in
Tasks: TOP => db:autoupgrade => environment
I'm using rails 3.2.3, if any more information is needed let me know.
The text was updated successfully, but these errors were encountered: