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
Rails - Displaying Foreign Key References in a Form
Model Using Modules in Rails Application
Ruby on Rails: Yielding Specific Views in a Specific Places in the Layout
Polymorphic Association with Multiple Associations on the Same Model
Using Multiple Controllers in One View in Rails
Get Link and Href Text from HTML Doc with Nokogiri & Ruby
How to Use Basic Authentication with Httparty in a Rails App
Ruby: How to Group a Ruby Array
How to Install Ruby 1.9.3 on Ubuntu Without Rvm
Rails 4 User Roles and Permissions
Rails 3 Joins -- Select Only Certain Columns
Differencebetween "Rails S" and "Bundle Exec Rails S"
How to Debug Ruby on Rails in Eclipse Aptana Plugin
Rails Console Default Environment