如何在 Debian 中启动 gem ffaker?

如何在 Debian 中启动 gem ffaker?

我安装骗子但在我的路径中找不到它

masi@masi:~$ sudo gem install ffaker
Fetching: ffaker-2.6.0.gem (100%)
Successfully installed ffaker-2.6.0
Parsing documentation for ffaker-2.6.0
Installing ri documentation for ffaker-2.6.0
Done installing documentation for ffaker after 4 seconds
1 gem installed

masi@masi:~$ ff
ffmpeg    ffplay    ffprobe   ffserver  

masi@masi:~$ require 'ffaker'
bash: require: command not found

masi@masi:~$ sudo ffaker
sudo: ffaker: command not found

操作系统:Debian 9

答案1

开始交互式 Ruby Shell,然后运行命令:

irb
irb(main):001:0> require 'ffaker'
=> true
exit

有一个例子从 git 存储库:

irb
irb(main):001:0> require 'ffaker'
=> true
irb(main):002:0> FFaker::Name.name
=> "Danyelle Langosh"
irb(main):003:0> FFaker::Internet.email
=> "[email protected]"
irb(main):004:0> 

相关内容