Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding a table to datamapper gives me 'uninitialized constant' error
    primarykey
    data
    text
    <p>I'm trying to add a table to my app but when I do I get the error shown below. But I don't understand why? All I did was adding the Recommendation class.</p> <pre><code>class Item include DataMapper::Resource property :id, Serial property :sortorder, Integer property :title, Text property :company, String property :desc, Text property :year, Integer property :url, String mount_uploader :source, ImageUploader end class Recommendations include Datamapper::Resource property :id, Serial property :firstname, String property :lastname, String property :title, String property :mugshot, String property :text, Text end configure :development do DataMapper.auto_upgrade! DataMapper.finalize puts "you're developing" end </code></pre> <p>The error:</p> <pre><code>15:30:27 [rerun] Joelsanden-se launched /Users/simpel/Sites/ruby/joelsanden-se/main.rb:48:in `&lt;class:Recommendations&gt;': uninitialized constant Recommendations::Datamapper (NameError) from /Users/simpel/Sites/ruby/joelsanden-se/main.rb:47:in `&lt;top (required)&gt;' from /Users/simpel/Sites/ruby/joelsanden-se/config.ru:19:in `require' from /Users/simpel/Sites/ruby/joelsanden-se/config.ru:19:in `block in &lt;main&gt;' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize' from /Users/simpel/Sites/ruby/joelsanden-se/config.ru:in `new' from /Users/simpel/Sites/ruby/joelsanden-se/config.ru:in `&lt;main&gt;' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/server.rb:250:in `start' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/lib/rack/server.rb:141:in `start' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/gems/rack-1.5.2/bin/rackup:4:in `&lt;top (required)&gt;' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/bin/rackup:23:in `load' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/bin/rackup:23:in `&lt;main&gt;' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval' from /Users/simpel/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `&lt;main&gt;' 15:30:29 [rerun] Joelsanden-se Launch Failed </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload