using console

3

Starting project with vagrant, when using the console, an 'Unable to load pry' message appears below:

$ rails c
Loading development environment (Rails 4.1.4)
=> Unable to load pry
irb(main):001:0>

After this I try to execute.

irb(main):001:0> user = User.new

and then said informs a message of 'Unable to find' desktop users'

irb(main):001:0> user = User.new
ActiveRecord::StatementInvalid: Could not find table 'users'
    from /home/vagrant/local/ruby/gems/gems/activerecord-4.1.4/lib/active_record/connection_adapters/sqlite3_adapter.rb:515:in 'table_structure'
    from /home/vagrant/local/ruby/gems/gems/activerecord-4.1.4/lib/active_record/connection_adapters/sqlite3_adapter.rb:390:in 'columns'
    from /home/vagrant/local/ruby/gems/gems/activerecord-4.1.4/lib/active_record/connection_adapters/schema_cache.rb:93:in 'block in prepare_default_proc'
    from /home/vagrant/local/ruby/gems/gems/activerecord-4.1.4/lib/active_record/connection_adapters/schema_cache.rb:44:in 'yield'
    from /home/vagrant/local/ruby/gems/gems/activerecord-4.1.4/lib/active_record/connection_adapters/schema_cache.rb:44:in 'columns'
    from /home/vagrant/local/ruby/gems/gems/activerecord-4.1.4/lib/active_record/model_schema.rb:214:in 'columns'
    from /home/vagrant/local/ruby/gems/gems/activerecord-4.1.4/lib/active_record/model_schema.rb:223:in 'columns_hash'
    from /home/vagrant/local/ruby/gems/gems/activerecord-4.1.4/lib/active_record/inheritance.rb:180:in 'subclass_from_attributes?'
    from /home/vagrant/local/ruby/gems/gems/activerecord-4.1.4/lib/active_record/inheritance.rb:23:in 'new'
    from (irb):1
    from /home/vagrant/local/ruby/gems/gems/railties-4.1.4/lib/rails/commands/console.rb:90:in 'start'
    from /home/vagrant/local/ruby/gems/gems/railties-4.1.4/lib/rails/commands/console.rb:9:in 'start'
    from /home/vagrant/local/ruby/gems/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:69:in 'console'
    from /home/vagrant/local/ruby/gems/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in 'run_command!'
    from /home/vagrant/local/ruby/gems/gems/railties-4.1.4/lib/rails/commands.rb:17:in '<top (required)>'
    from /home/vagrant/local/ruby/gems/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in 'require'
    from /home/vagrant/local/ruby/gems/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in 'block in require'
    from /home/vagrant/local/ruby/gems/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in 'load_dependency'
    from /home/vagrant/local/ruby/gems/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in 'require'
    from /vagrant/colchonet/bin/rails:8:in '<top (required)>'
    from /home/vagrant/local/ruby/gems/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in 'load'
    from /home/vagrant/local/ruby/gems/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in 'block in load'
    from /home/vagrant/local/ruby/gems/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in 'load_dependency'
    from /home/vagrant/local/ruby/gems/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in 'load'
    from /usr/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in 'require'
    from /usr/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in 'require'
    from -e:1:in '<main>'irb(main):002:0>
    
asked by anonymous 15.09.2014 / 18:41

1 answer

1

The message means:

  

Could not find table "users."

You may have created the but forgotten model of running the migration. Try to run:

  

rake db:migrate

    
16.09.2014 / 22:17