GÜNCELLEME Aşağıdaki tablo 4'kullanıcıların
Bkz çözüm bulamadık!
** Güncelleme 3 **
herkes aslında hala (bunu takdir!) Bugün benim kod etrafında mücadele oldum bu okuyorsa (evet hala çaylak ve raylarda yakut bölüm 11'de öğretici). Ben güya taahhüt benim son geri sıfırladınız
: Yerel ana bilgisayarda sitesini kontrol zaman
$ cd rails_screencast/sample_app/
$ git reset --hard 2396c0d288d132ffc43c82d5cbbc736a5258eed2
HEAD is now at 2396c0d Micropost Validations
aslında bir kullanıcıların listesini ve bir HATA sayfası gösterir ama (test paketi çalıştırdığınızda spork ile otomatik test - emin olmak için bunları birkaç kez sıfırladım) Hala aşağıda gösterilenler gibi tüm hataları alıyorum. Ben " 'users' bulunamadı tablosu" çok merak ediyorum o kimse herhangi bir fikir veya ipuçları sunabilir eğer takmayı ve tüm bu hataları bakarak tutmak
108) Users signin success should sign a user in and out
Failure/Error: user = Factory(:user)
ActiveRecord::StatementInvalid:
Could not find table 'users'
# ./spec/requests/users_spec.rb:56:in `block (4 levels) in <top (required)>'
Finished in 0.9872 seconds
108 examples, 108 failures
Zaman HER hata # olduğu gibi ya da fikirleri kontrol etmek için minnettarım!
It: Daha fazla bilgiye ihtiyaç Ya ben de
Güncelleme 2 (Sadece gibi birçok zaten lingo tamamen akıcı değilim olarak gördükleri için hangi dosyaların çok özel olabilir) o gönderebilir benim sıfırlama fabrika ayarları ile bir şey karışıklık gibi görünüyor bazen tüm hataları benim micropost_spec.rb dosya satır 5 işaret eden özellikle @ @ user = Fabrika (: kullanıcı) hattı ... neredeyse benim fabrikalar dosya gibi değil Artık herhangi bir şeye bağlı. Bir tırmık db olmadığını merak ediyorum: ... Benim hiçbir sorununu ya da sadece yeni sorunlar yaratacak göç ... Ben sadece örnek veri Faker
Herhangi bir fikir ile doldurarak var?
geri bir önceki benim dosya sistemini geri taahhüt ve baştan başlamak mümkün mü? ... Ben yeşil iken
Failures:
1) Micropost should create a new instance with valid attributes
Failure/Error: @user = Factory(:user)
ActiveRecord::StatementInvalid:
Could not find table 'users'
# ./spec/models/micropost_spec.rb:5:in `block (2 levels) in <top (required)>'
2) Micropost user associations should have a user attribute
Failure/Error: @user = Factory(:user)
ActiveRecord::StatementInvalid:
Could not find table 'users'
# ./spec/models/micropost_spec.rb:5:in `block (2 levels) in <top (required)>'
3) Micropost user associations should have the right associated user
Failure/Error: @user = Factory(:user)
ActiveRecord::StatementInvalid:
Could not find table 'users'
# ./spec/models/micropost_spec.rb:5:in `block (2 levels) in <top (required)>'
4) Micropost validations should have a user id
Failure/Error: @user = Factory(:user)
ActiveRecord::StatementInvalid:
Could not find table 'users'
# ./spec/models/micropost_spec.rb:5:in `block (2 levels) in <top (required)>'
5) Micropost validations should require nonblank content
Failure/Error: @user = Factory(:user)
ActiveRecord::StatementInvalid:
Could not find table 'users'
# ./spec/models/micropost_spec.rb:5:in `block (2 levels) in <top (required)>'
6) Micropost validations should reject long content
Failure/Error: @user = Factory(:user)
ActiveRecord::StatementInvalid:
Could not find table 'users'
# ./spec/models/micropost_spec.rb:5:in `block (2 levels) in <top (required)>'
Güncelleme 1:
ben "Özellikle
1) Micropost should create a new instance with valid attributes
Failure/Error: @user = Factory(:user)
ActiveRecord::StatementInvalid:
Could not find table 'users'
# ./spec/models/micropost_spec.rb:53:in `block (2 levels) in <top (required)>'
bir yinelenen tema ile 4'ten 6 111 ila hataları alıyorum 'Kullanıcılar' tablosunu bulamadı - micropost_spec.rb dosyası için öğretici git kodunu kopyaladım ama düzeltmek için görünmüyordu - belki birisi bana tablonun atıfta bulunduğu yere yönlendirmeye yardımcı olabilir?
////////////////////////////////////// AŞAĞIDA ORİJİNAL ////// //////////////////////////
Ben Raylar Eğitimi dersi 11 Ruby çalışıyorum ve göstermek için db doldurmak çalışıyorum microposts Ben tırmık db yaptım
:macbook:sample_app macbook$ rake db:populate
(in /Users/macbook/rails_screencast/sample_app)
db/test.sqlite3 already exists
db/test.sqlite3 already exists
db/development.sqlite3 already exists
-- create_table("microposts", {:force=>true})
-> 0.0090s
-- add_index("microposts", ["user_id"], {:name=>"index_microposts_on_user_id"})
-> 0.0074s
-- create_table("users", {:force=>true})
-> 0.0243s
-- add_index("users", ["email"], {:name=>"index_users_on_email", :unique=>true})
-> 0.0094s
-- initialize_schema_migrations_table()
-> 0.0167s
-- assume_migrated_upto_version(20110614132314, "db/migrate")
-> 0.0432s
rake aborted!
Validation failed: Email is invalid
Ben bunu bir kaç kere koştum ve aynı hatayı almaya devam etti ... bir siteyi ziyaret ettiğinde: aşağıdaki verdi bana komut doldurmak tarayıcım, örnek kullanıcıların hiçbiri orada değildi ...
benim test paketi artık gösteriyor ... kötü varsayım sıfırlama benim örnek veritabanını temizlemek ve taze malzeme ile tekrar doldurulmasını çalıştırabilirsiniz::
require 'faker'
namespace :db do
desc "Fill database with sample data"
task :populate => :environment do
Rake::Task['db:reset'].invoke
admin = User.create!(:name => "Foo Bar",
:email => "[email protected]",
:password => "foobar",
:password_confirmation => "foobar")
admin.toggle!(:admin)
99.times do |n|
name = Faker::Name.name
email = "example-#{n+1}@railstutorial.org"
password = "password"
User.create!(:name => name,
:email => email,
:password => password,
:password_confirmation => password)
end
User.all(:limit => 6).each do |user|
50.times do
user.microposts.create!(:content => Faker::Lorem.sentence(5))
end
end
end
end
sonra oh belki db komisyon karar verdi
Finished in 0.99915 seconds
111 examples, 111 failures
Şimdi ayağa ben karışıklık daha şeyler önce gösterdiğiniz db:populate
biryapar
olası kopyası [RSpec hatası: geçişten sonra tablo bulunamadı ...?] (Http://stackoverflow.com/questions/5264355/rspec-failure-could-not-find-table-after-migration) – l0b0