Ruby on rails 4 所有rails项目-Bundler使用的是为不同的gem创建的binstub
在我所有的Rails项目中,当我运行Rails s时,我得到以下输出:Ruby on rails 4 所有rails项目-Bundler使用的是为不同的gem创建的binstub,ruby-on-rails-4,bundler,Ruby On Rails 4,Bundler,在我所有的Rails项目中,当我运行Rails s时,我得到以下输出: Bundler is using a binstub that was created for a different gem. This is deprecated, in future versions you may need to `bundle binstub rails` to work around a system/bundle conflict. 我见过处理项目的解决方案,但我会有一个系统范围的问题吗?如
Bundler is using a binstub that was created for a different gem.
This is deprecated, in future versions you may need to `bundle binstub rails` to work around a system/bundle conflict.
我见过处理项目的解决方案,但我会有一个系统范围的问题吗?如果您的系统中同时有3.x和4.x,或者两个版本的bin名称不同,在我的系统中,我使用3.2.22,名称是
railties
,4.x bin名称是rails,Rubygems将在第一次安装时为gem创建一个binstubs,所以,如果您像我一样先安装4.x rails,其他3.x项目将有此消息。
rails 4.x文件的最后一行是:
加载Gem.bin_路径('railties','rails',version)
而对于3.x,这是什么
加载Gem.bin_路径('rails','rails',version)
警告消息来自bundler gem的rubygems_integration.rb的第344行
def replace_bin_path(specs)
gem_class = (class << Gem; self; end)
redefine_method(gem_class, :bin_path) do |name, *args|
exec_name = args.first
return ENV["BUNDLE_BIN_PATH"] if exec_name == "bundle"
spec = nil
if exec_name
spec = specs.find {|s| s.executables.include?(exec_name) }
raise(Gem::Exception, "can't find executable #{exec_name}") unless spec
unless spec.name == name
warn "Bundler is using a binstub that was created for a different gem.\n" \
"This is deprecated, in future versions you may need to `bundle binstub #{name}` " \
"to work around a system/bundle conflict."
end
else
spec = specs.find {|s| s.name == name }
raise Gem::Exception, "no default executable for #{spec.full_name}" unless exec_name = spec.default_executable
end
gem_bin = File.join(spec.full_gem_path, spec.bindir, exec_name)
gem_from_path_bin = File.join(File.dirname(spec.loaded_from), spec.bindir, exec_name)
File.exist?(gem_bin) ? gem_bin : gem_from_path_bin
end
end
如果文件仍然存在,请删除该文件
which rails
rm -rf path_of_rails
并安装您实际使用的rails版本
gem install rails -v 3.2.22
您是否尝试按照消息中的说明进行操作?当我运行命令时,我得到:rails没有可执行文件,但您可能需要它所依赖的gem中的一个。railties has:rails绑定器has:bundle,bundler当键入gem install rails-v 3.2.6时,无法从-SSL\u connect returned=1 errno=0 state=SSLv3读取服务器证书B:certificate verify failed()下载数据这是错误
gem install rails -v 3.2.22