Nameerror: Uninitialized Constant Faker

Uninitialized constant Faker::Restaurant in rake task

You actually use the gem in rubygems.org which version is 1.9.1 - July 11, 2018 but Faker::Restaurant was add in 18 july and might be available in the next version in rubygems.org.

(see https://github.com/stympy/faker/blob/master/doc/restaurant.md)

Like suggested by the comment above use :

gem 'faker', :git => 'https://github.com/stympy/faker.git', :branch => 'master'

This will download the gem from github instead of rubygems.org

NameError: uninitialized constant Faker::

Number didn't exist in Faker at the version you are using (1.1.2). Update to version 1.2.0 and it will work.

Getting uninitialized constant Faker::String when attempting to set up rspec test in Rails

Faker::String was added to the faker gem 9 days ago on December 24 and the latest version of faker(1.8.7) was published on December 22. You'll have to use the version from Github in order to use Faker::String. Specify the git repository in your Gemfile as below:

gem 'faker', git: 'https://github.com/stympy/faker'

Rails rake db uninitialized constant Faker::User

Removing Faker::User.username from my seeds.rb file did the job.

Rspec Failure - NameError: uninitialized constant Faker

NameError: uninitialized constant Faker

You have ffaker gem in your application which is refactored version of faker. So you need to use FFaker instead of Faker.

email { FFaker::Internet.email }

uninitialized constant Faker::CONFIG

I think you are using a very outdated version of the Faker gem. The current version seems to be 1.0.1.

Maybe you should just try gem faker first?

uninitialized constant Faker::Date Updating to rails 5.1

There was a problem while updating. I've done the process from scratch and now it works. It had nothing to do with faker.



Related Topics



Leave a reply



Submit