Ruby `要求';:无法加载这样的文件--bunder/setup(LoadError)
我是Ruby新手,正在研究一个示例,在macOS的本地环境中遇到了问题,在尝试在单个Ruby文件中使用bundler时遇到了加载错误 我有一个bcrypt.rb文件,其中包含以下内容: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
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'