Skip to content

Instantly share code, notes, and snippets.

@bikle
Created December 1, 2009 07:19
Show Gist options
  • Save bikle/246141 to your computer and use it in GitHub Desktop.
Save bikle/246141 to your computer and use it in GitHub Desktop.
Hello,
I want to run this rake command:
rake authlogic_bundle:features
The above command is giving me an error related to a missing sessions table:
Could not find table 'sessions' (ActiveRecord::StatementInvalid)
I did this:
Mon Nov 30 23:05 /pt/c3/mb/tse maco$
Mon Nov 30 23:05 /pt/c3/mb/tse maco$ envg rail
RAILS_ENV=test
Mon Nov 30 23:05 /pt/c3/mb/tse maco$
Mon Nov 30 23:05 /pt/c3/mb/tse maco$
Mon Nov 30 23:05 /pt/c3/mb/tse maco$ rm db/test.sqlite3
Mon Nov 30 23:05 /pt/c3/mb/tse maco$
Mon Nov 30 23:05 /pt/c3/mb/tse maco$
Mon Nov 30 23:05 /pt/c3/mb/tse maco$ rake db:schema:load
(in /Users/maco/pt/customers3/marc_bandt/tse)
-- create_table("open_id_authentication_associations", {:force=>true})
-> 0.0905s
-- create_table("open_id_authentication_nonces", {:force=>true})
-> 0.0034s
-- create_table("preferences", {:force=>true})
-> 0.0040s
-- create_table("roles", {:force=>true})
-> 0.0036s
-- create_table("user_roles", {:force=>true, :id=>false})
-> 0.0030s
-- create_table("users", {:force=>true})
-> 0.0133s
-- add_index("users", ["email"], {:name=>"index_users_on_email"})
-> 0.0026s
-- add_index("users", ["last_request_at"], {:name=>"index_users_on_last_request_at"})
-> 0.0030s
-- add_index("users", ["login"], {:name=>"index_users_on_login"})
-> 0.0135s
-- add_index("users", ["openid_identifier"], {:name=>"index_users_on_openid_identifier"})
-> 0.0027s
-- add_index("users", ["perishable_token"], {:name=>"index_users_on_perishable_token"})
-> 0.0031s
-- add_index("users", ["persistence_token"], {:name=>"index_users_on_persistence_token"})
-> 0.0028s
-- add_index("users", ["single_access_token"], {:name=>"index_users_on_single_access_token"})
-> 0.0033s
-- add_index("users", ["state"], {:name=>"index_users_on_state"})
-> 0.0029s
-- initialize_schema_migrations_table()
-> 0.0071s
-- assume_migrated_upto_version(20091201053756)
-> 0.0130s
Mon Nov 30 23:06 /pt/c3/mb/tse maco$
Mon Nov 30 23:06 /pt/c3/mb/tse maco$
Mon Nov 30 23:06 /pt/c3/mb/tse maco$
Mon Nov 30 23:06 /pt/c3/mb/tse maco$ rake db:seed
(in /Users/maco/pt/customers3/marc_bandt/tse)
Reading /Users/maco/pt/customers3/marc_bandt/tse/config/authorization_rules.rb ...
Roles [ Customer, Agent, Supplier, Employee, Shareholder, Manager, Administrator ] created.
Creating user 'root' ...
user 'root' created. login/password is root/root.
Mon Nov 30 23:07 /pt/c3/mb/tse maco$
Mon Nov 30 23:07 /pt/c3/mb/tse maco$
Mon Nov 30 23:07 /pt/c3/mb/tse maco$
Mon Nov 30 23:07 /pt/c3/mb/tse maco$ rake authlogic_bundle:features
(in /Users/maco/pt/customers3/marc_bandt/tse)
/pt/r1/bin/ruby -I "/pt/r1/lib/ruby/gems/1.8/gems/cucumber-0.4.4/lib:lib" "/pt/r1/lib/ruby/gems/1.8/gems/cucumber-0.4.4/bin/cucumber" --color --tags ~@wip --strict --format pretty vendor/plugins/authlogic_bundle/features
Feature: Authentication
As a confirmed but anonymous user
I want to login to the application
So that I can be productive
Scenario: Display login form to anonymous users # vendor/plugins/authlogic_bundle/features/authentication.feature:6
Given "sharon" is an anonymous user # vendor/plugins/authlogic_bundle/features/step_definitions/registration_steps.rb:1
Could not find table 'sessions' (ActiveRecord::StatementInvalid)
./vendor/plugins/authlogic_bundle/lib/authlogic_bundle/localization.rb:34:in `persist_language'
./vendor/plugins/authlogic_bundle/lib/authlogic_bundle/localization.rb:24:in `set_localization'
/pt/r1/lib/ruby/1.8/benchmark.rb:308:in `realtime'
(eval):2:in `visit'
./vendor/plugins/authlogic_bundle/features/step_definitions/registration_steps.rb:2:in `/"([^\"]*)" is an anonymous user/'
vendor/plugins/authlogic_bundle/features/authentication.feature:7:in `Given "sharon" is an anonymous user'
When I go to the login page # vendor/plugins/authlogic_bundle/features/step_definitions/webrat_steps.rb:15
Then I should see a login form # vendor/plugins/authlogic_bundle/features/step_definitions/authentication_steps.rb:10
Here is info about my setup:
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$ script/about
About your application's environment
Ruby version 1.8.7 (i686-darwin9.6.2)
RubyGems version 1.3.5
Rack version 1.0
Rails version 2.3.4
Active Record version 2.3.4
Active Resource version 2.3.4
Action Mailer version 2.3.4
Active Support version 2.3.4
Application root /Users/maco/pt/customers3/marc_bandt/tse
Environment test
Database adapter sqlite3
Database schema version 20091201053756
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$ grep config config/environment.rb
# Bootstrap the Rails environment, frameworks, and default configuration
Rails::Initializer.run do |config|
config.gem 'bmabey-email_spec', :lib => 'email_spec'
config.gem 'rspec-rails', :lib => false
config.gem 'rspec', :lib => false
config.gem 'cucumber'
config.gem 'webrat'
config.gem 'nokogiri'
config.gem 'bcrypt-ruby', :lib => 'bcrypt', :version => '>=2.1.2'
config.gem 'authlogic', :version => '>=2.1.3'
config.gem 'authlogic-oid', :lib => 'authlogic_openid', :version => '>=1.0.4'
config.gem 'ruby-openid', :lib => 'openid', :version => '>=2.1.7'
config.gem 'declarative_authorization', :lib => 'declarative_authorization', :source => 'http://gemcutter.org', :version => '>=0.3.2.3'
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# config.load_paths += %W( #{RAILS_ROOT}/extras )
# config.gem "bj"
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
# config.gem "sqlite3-ruby", :lib => "sqlite3"
# config.gem "aws-s3", :lib => "aws/s3"
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
config.time_zone = 'UTC'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
# config.i18n.default_locale = :de
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$
Mon Nov 30 23:23 /pt/c3/mb/tse maco$ cat db/schema.rb
cat db/schema.rb
# This file is auto-generated from the current state of the database. Instead of editing this file,
# please use the migrations feature of Active Record to incrementally modify your database, and
# then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
# to create the application database on another system, you should be using db:schema:load, not running
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20091201053756) do
create_table "open_id_authentication_associations", :force => true do |t|
t.integer "issued"
t.integer "lifetime"
t.string "handle"
t.string "assoc_type"
t.binary "server_url"
t.binary "secret"
end
create_table "open_id_authentication_nonces", :force => true do |t|
t.integer "timestamp", :null => false
t.string "server_url"
t.string "salt", :null => false
end
create_table "preferences", :force => true do |t|
t.integer "user_id"
t.string "language"
t.string "time_zone"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "roles", :force => true do |t|
t.string "name", :null => false
t.string "title"
t.string "description"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "user_roles", :id => false, :force => true do |t|
t.integer "user_id", :null => false
t.integer "role_id", :null => false
end
create_table "users", :force => true do |t|
t.string "login"
t.string "email", :null => false
t.string "state", :default => "passive", :null => false
t.string "crypted_password"
t.string "password_salt"
t.string "persistence_token", :null => false
t.string "perishable_token", :null => false
t.string "single_access_token", :null => false
t.integer "login_count", :default => 0, :null => false
t.integer "failed_login_count", :default => 0, :null => false
t.datetime "last_request_at"
t.datetime "last_login_at"
t.string "last_login_ip"
t.datetime "current_login_at"
t.string "current_login_ip"
t.datetime "created_at"
t.datetime "updated_at"
t.string "openid_identifier"
end
add_index "users", ["email"], :name => "index_users_on_email"
add_index "users", ["last_request_at"], :name => "index_users_on_last_request_at"
add_index "users", ["login"], :name => "index_users_on_login"
add_index "users", ["openid_identifier"], :name => "index_users_on_openid_identifier"
add_index "users", ["perishable_token"], :name => "index_users_on_perishable_token"
add_index "users", ["persistence_token"], :name => "index_users_on_persistence_token"
add_index "users", ["single_access_token"], :name => "index_users_on_single_access_token"
add_index "users", ["state"], :name => "index_users_on_state"
end
Mon Nov 30 23:24 /pt/c3/mb/tse maco$
Mon Nov 30 23:24 /pt/c3/mb/tse maco$
Mon Nov 30 23:24 /pt/c3/mb/tse maco$
Mon Nov 30 23:24 /pt/c3/mb/tse maco$
Mon Nov 30 23:24 /pt/c3/mb/tse maco$
Mon Nov 30 23:24 /pt/c3/mb/tse maco$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment