[Hobo Users] My first hobo app on Heroku: "Object is not missing constant User!"

31 views
Skip to first unread message

PeterW

unread,
May 15, 2010, 9:30:11 AM5/15/10
to Hobo Users
Hi,

I tried do deploy my first hobo app on Heroku, but ran into some
troubles I cannot solve myself. Important to say that my app is
working perfectly in development as in production mode on my own pc.

Deploying on heroku went fine until I tried to open the app in a
browser. Heroku tells me that "Object is not missing constant User!"
and I have been trying to find out what that means for two days now,
but I am still as far from a solution than two days ago :/

This is the adress: http://falling-sword-91.heroku.com/
I put the code on github: http://github.com/wurmi/guild

Here is the full error output from terminal (if i try to migrate the
database):

MacBook:guild peterw$ heroku rake db:migrate --trace
rake aborted!
Object is not missing constant User!
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:417:in `load_missing_constant'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:80:in `const_missing'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:92:in `const_missing_before_generators'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails_generator/
lookup.rb:15:in `const_missing'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:98:in `send'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:98:in `const_missing_before_generators'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails_generator/
lookup.rb:15:in `const_missing'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
base.rb:2197:in `compute_type'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
base.rb:2195:in `compute_type'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
reflection.rb:156:in `send'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
reflection.rb:156:in `klass_without_create_polymorphic_class'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/
active_record/association_reflection.rb:15:in `klass'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/hobo/
model.rb:198:in `belongs_to_without_field_declarations'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobofields-1.0.0/lib/
hobo_fields/model_extensions.rb:90:in `belongs_to'
/disk1/home/slugs/185492_455ee81_f917/mnt/app/models/char.rb:19
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:158:in `require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:265:in `require_or_load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:425:in `load_missing_constant'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:80:in `const_missing'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:92:in `const_missing_before_generators'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails_generator/
lookup.rb:15:in `const_missing'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/inflector.rb:361:in `constantize'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/inflector.rb:360:in `each'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/inflector.rb:360:in `constantize'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/core_ext/string/inflections.rb:162:in `constantize'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/hobo/
model_controller.rb:86:in `model'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/hobo/
model_controller.rb:299:in `available_auto_write_actions'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/hobo/
model_controller.rb:287:in `available_auto_actions'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/hobo/
model_controller.rb:128:in `auto_actions'
/disk1/home/slugs/185492_455ee81_f917/mnt/app/controllers/
chars_controller.rb:5
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:158:in `require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:265:in `require_or_load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:425:in `load_missing_constant'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:80:in `const_missing'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:92:in `const_missing_before_generators'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails_generator/
lookup.rb:15:in `const_missing'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/inflector.rb:361:in `constantize'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/inflector.rb:360:in `each'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/inflector.rb:360:in `constantize'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/core_ext/string/inflections.rb:162:in `constantize'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/hobo/
model_controller.rb:61:in `all_controllers'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/hobo/
model_controller.rb:57:in `each'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/hobo/
model_controller.rb:57:in `all_controllers'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/hobo/
model_router.rb:97:in `add_routes_for'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/hobo/
model_router.rb:83:in `add_routes'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/hobo/
model_router.rb:83:in `each'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/lib/hobo/
model_router.rb:83:in `add_routes'
/home/slugs/185492_455ee81_f917/mnt/.gems/gems/hobo-1.0.0/rails/../lib/
hobo.rb:73:in `add_routes'
/disk1/home/slugs/185492_455ee81_f917/mnt/config/routes.rb:6
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/
action_controller/routing/route_set.rb:226:in `draw'
/disk1/home/slugs/185492_455ee81_f917/mnt/config/routes.rb:1
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:147:in
`load_without_new_constant_marking'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:147:in `load'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/
action_controller/routing/route_set.rb:286:in `load_routes!'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/
action_controller/routing/route_set.rb:286:in `each'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/
action_controller/routing/route_set.rb:286:in `load_routes!'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/
action_controller/routing/route_set.rb:266:in `reload!'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:
537:in `initialize_routing'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:
188:in `process'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:
113:in `send'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:
113:in `run'
/disk1/home/slugs/185492_455ee81_f917/mnt/config/environment.rb:9
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:156:in `require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:521:in `new_constants_in'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:156:in `require'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/misc.rake:4
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
`execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
`execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in
`invoke_prerequisites'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in
`invoke_prerequisites'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in
`invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
`invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in
`invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
`top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
`each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
`top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in
`top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19
(in /disk1/home/slugs/185492_455ee81_f917/mnt)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment

So it seems that line 19 of /models/char.rb is causing the troubles.
Line 19 is: belongs_to :owner, :class_name => "User", :creator =>
true, :accessible => true

Is anyone able to point me to the right direction? What's wrong?




--
You received this message because you are subscribed to the Google Groups "Hobo Users" group.
To post to this group, send email to hobo...@googlegroups.com.
To unsubscribe from this group, send email to hobousers+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.

storitel

unread,
May 16, 2010, 3:22:09 AM5/16/10
to Hobo Users
Hi Peter,
I've not used the heroku rake db:migrate approach, so can't help
directly, but assuming everything's working on your local dev version,
can you try this alternative deployment approach?

1) after you've got your local git up to date via

git add .
git commit -m "whatever your comment is about this version"

2) deploy your app onto heroku...
git push -f heroku

3) then take your local database and copy it to heroku...

heroku db:push

if that doesn't work, let me know...

br
Paul

PeterW

unread,
May 16, 2010, 9:50:59 AM5/16/10
to Hobo Users
Hi Paul,

Thanks for trying to help me.

I have done those steps now (including installing Taps; in addition to
'heroku db:push' I did "heroku db:push sqlite://db/production.sqlite3"),
but the output is still the same. Personally I don't think that the
problem is related to the database.

Any other ideas?

Matt Jones

unread,
May 16, 2010, 10:19:24 AM5/16/10
to hobo...@googlegroups.com

On May 16, 2010, at 9:50 AM, PeterW wrote:

> Hi Paul,
>
> Thanks for trying to help me.
>
> I have done those steps now (including installing Taps; in addition to
> 'heroku db:push' I did "heroku db:push sqlite://db/
> production.sqlite3"),
> but the output is still the same. Personally I don't think that the
> problem is related to the database.
>
> Any other ideas?

Your issue sounds quite similar to the one referenced here:

http://www.redmine.org/boards/2/topics/9825?r=11084#message-11084

which was apparently caused by a missing database driver (?).

It also appears to be related to this bug:

https://rails.lighthouseapp.com/projects/8994/tickets/2283

But I don't see any of the namespacing that typically triggers that
mess in your code.

--Matt Jones

Owen

unread,
May 16, 2010, 8:19:05 PM5/16/10
to Hobo Users
Not sure it is related, but I get this error when truing to clome your
code:

error: file /Users/owendall/hoboapps/guild/.git/objects/pack/pack-
bc6f0a201a6f00e8d792b014af2e60b7ea296bd7.pack is not a GIT packfile
fatal: packfile /Users/owendall/hoboapps/guild/.git/objects/pack/pack-
bc6f0a201a6f00e8d792b014af2e60b7ea296bd7.pack cannot be accessed

-Owen

Owen

unread,
May 16, 2010, 8:30:54 PM5/16/10
to Hobo Users
I donwloded the zip itself, but was missing the code for the plugin
wowr:
http://screencast.com/t/ZGIyNTRhMD

Owen

unread,
May 16, 2010, 8:49:24 PM5/16/10
to Hobo Users

Matt Jones

unread,
May 16, 2010, 9:26:07 PM5/16/10
to hobo...@googlegroups.com
There are two submodules in the vendor/plugins directory - to get the
code, do:

git submodule init
git submodule update

at the root of the application.

--Matt Jones

Owen

unread,
May 16, 2010, 9:51:53 PM5/16/10
to Hobo Users
@matt I tried first cloning the repo but got this error:

http://screencast.com/t/NjBiNGFhY

Therefore no project was created and no way to execute any git
commands.

I then tried just copying the project zip via Github's provided
feature. That is where I could see that the plugin code I mentioned
wasn't there.


Were you able to clone the app?

Thanks,

Owen

Owen

unread,
May 16, 2010, 11:32:52 PM5/16/10
to Hobo Users
I got the app running locally on SQLite3, but when I run ">heroku rake
db:Migrate" I see this error from Postgres (the DB used on Heroku)

new-host:wurmi-guild owendall$ heroku rake db:migrate
rake aborted!
An error has occurred, this and all later migrations canceled:

PGError: ERROR: current transaction is aborted, commands ignored
until end of transaction block
: CREATE INDEX "index_chars_on_owner_id" ON "chars" ("owner_id")

(See full trace by running task with --trace)
(in /disk1/home/slugs/187306_4653f03_c2e7/mnt)
== HoboMigration1: migrating
=================================================
-- create_table(:users)
-> 0.0208s
-- add_index(:users, [:state])
-> 0.0119s
-- create_table(:chars)
-> 0.0117s
== HoboMigration1: migrated (0.0447s)
========================================

== HoboMigration2: migrating
=================================================
-- add_column(:chars, :server, :string)
-> 0.0023s
-- add_column(:chars, :guild, :string)
-> 0.0022s
-- add_column(:chars, :fraction, :string)
-> 0.0023s
-- add_column(:chars, :dclass, :string)
-> 0.0021s
-- add_column(:chars, :race, :string)
-> 0.0022s
-- add_column(:chars, :likings, :string)
-> 0.0022s
-- add_column(:chars, :user_id, :integer)
-> 0.0023s
-- remove_column(:chars, :wclass)
-> 0.0023s
-- remove_column(:chars, :wfraction)
-> 0.0021s
-- remove_column(:chars, :orientation)
-> 0.0021s
-- remove_column(:chars, :wrace)
-> 0.0021s
-- add_index(:chars, [:user_id])
-> 0.0049s
== HoboMigration2: migrated (0.0301s)
========================================

== HoboMigration3: migrating
=================================================
-- add_column(:chars, :owner_id, :integer)
-> 0.0024s
-- remove_column(:chars, :user_id)
-> 0.0028s
-- remove_index(:chars, {:name=>:index_chars_on_user_id})
-- add_index(:chars, [:owner_id])
new-host:wurmi-guild owendall$

Owen

unread,
May 17, 2010, 1:27:42 PM5/17/10
to Hobo Users
OK, I finally got Postgres server installed and running in Windows
using the new "pg" adapter gem.

http://rubygems.org/gems/pg

I suspect that trying out you app locally on Postgres before moving to
Heroku might relieve some debugging headaches.

Of course, we need to find out what the latest PostgreSQL driver is
being used by Heroku so we can match our local code.

I am suspecting there is some Postgres indexing "magic" going on
behind the scenes that are tripping us up with the new Hobo indexgen
that came in 1.0. Need more exploration...

Next step is to gen a more complex app to see where indexing may get
tripped up...

kevinpfromnm

unread,
May 17, 2010, 1:47:05 PM5/17/10
to Hobo Users
ummm... last I check heroku did not support git submodules. to use
hobo as a plugin, you need to delete the .git folder and check it into
your main repository. just in case that's your issue but usually that
appears like missing constant Hobo...

PeterW

unread,
May 17, 2010, 1:47:46 PM5/17/10
to Hobo Users
Hi!

Thank you all for your support. I'm extremely new to git, github, etc.
and it's a hard learning curve for me, so I know I make a lot of
mistakes (Sorry, I still haven't figured out how to include the
submodules to my git repository)

Didn't know that Heroku uses Postgres DB. Now I'm wondering why
"heroku db:push sqlite://db/production.sqlite3" was possible... does
this copy sqlite DB to Postgres DB?

I will try now to setup Postgres on my Mac machine to be able to check
whether it works locally with Postgres.

kevinpfromnm

unread,
May 17, 2010, 1:56:07 PM5/17/10
to Hobo Users
heroku db:push uses rails and a plugin (taps) to translate your local
db and replace the heroku db. http://docs.heroku.com/taps

by default heroku db:push|pull will use the current environment db
(development in most cases). the additional switch overrides that
behavior but is probably not what you want. I would guess you haven't
run anything on your dev box in production mode so your local
production db will likely be blank.

PeterW

unread,
May 17, 2010, 2:09:11 PM5/17/10
to Hobo Users
Exactly this is what I've read now.
So when I do "heroku db:pull sqlite://local.db" I get something like a
local DB-copy from heroku's production postgres DB. And when I look
into that local.db it is the same as the database I use in development/
production mode locally. So I still guess it's not as much the
database...

I found this article that describes how to deploy an hobo app to
heroku: http://andywaite.com/2009/12/28/deploying-a-hobo-app-to-heroku
Maybe I should try to get a "naked" hobo app up running first before
trying to deploy my finished app.

PeterW

unread,
May 17, 2010, 2:33:41 PM5/17/10
to Hobo Users
I'm so happy, because finally my app is up running:
http://falling-sword-91.heroku.com/
(You won't see much, as all pages are only available for logged in
users and the content is in german)

The problem was that my app's git had submodules (whatever that is,
and whatever reason my app has them). I put those now into my project,
following the steps on the page http://docs.heroku.com/constraints#git-submodules.

Thank ya all!

Owen Dall

unread,
May 17, 2010, 2:35:21 PM5/17/10
to hobo...@googlegroups.com
Peter. have you seen the Heroku instructions in "Rapid Rails with Hobo"?

http://hobocentral.net/books
--
- Owen

Owen Dall, Chief Systems Architect
Barquin International
Cell: 410-991-0811

Owen Dall

unread,
May 17, 2010, 2:37:01 PM5/17/10
to hobo...@googlegroups.com
Cool.  Perhaps you could post your successful steps for all...
--
- Owen

Owen Dall, Chief Systems Architect
Barquin International
Cell: 410-991-0811

Reply all
Reply to author
Forward
0 new messages