Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby `要求';:无法加载这样的文件--bunder/setup(LoadError)_Ruby_Macos_Homebrew_Bundler - Fatal编程技术网

Ruby `要求';:无法加载这样的文件--bunder/setup(LoadError)

Ruby `要求';:无法加载这样的文件--bunder/setup(LoadError),ruby,macos,homebrew,bundler,Ruby,Macos,Homebrew,Bundler,我是Ruby新手,正在研究一个示例,在macOS的本地环境中遇到了问题,在尝试在单个Ruby文件中使用bundler时遇到了加载错误 我有一个bcrypt.rb文件,其中包含以下内容: require 'bunder/inline' gemfile true do source 'https://rubygems.org' gem 'bcrypt' end require 'bcrypt' my_password = BCrypt::Password.create("my pass

我是Ruby新手,正在研究一个示例,在macOS的本地环境中遇到了问题,在尝试在单个Ruby文件中使用bundler时遇到了加载错误

我有一个bcrypt.rb文件,其中包含以下内容:

require 'bunder/inline'

gemfile true do
  source 'https://rubygems.org'
  gem 'bcrypt'
end

require 'bcrypt'

my_password = BCrypt::Password.create("my password")

my_password.version              #=> "2a"
my_password.cost                 #=> 12
my_password == "my password"     #=> true
my_password == "not my password" #=> false
我希望该文件成功地需要bundler和bcrypt并运行代码,不会产生任何输出。尝试运行bcrypt.rb文件时,出现以下错误:

Traceback (most recent call last):
2: from bcrypt.rb:1:in `<main>'
1: from /Users/rturner/.rvm/rubies/ruby-2.6.4/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/rturner/.rvm/rubies/ruby-2.6.4/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- bunder/setup (LoadError)

这将GEM_HOME变量更改为包含gems的目录,但没有解决问题。我在本地设置中使用rvm,与brew一起安装,并已与brew一起安装bundler,运行brew更新和brew升级,以及尝试bundler页面上列出的常规故障排除方法。有人能帮忙吗?谢谢

看起来您在此处输入错误:

require 'bunder/inline'
应该是:

require 'bundler/inline'

非常感谢。我真的需要一些新鲜的眼睛!
require 'bundler/inline'