加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 关于在运行guard init时不使用bundler的警告

发布时间:2020-12-17 04:24:13 所属栏目:百科 来源:网络整理
导读:在我的Rails应用程序中运行guard init rspec时会收到此警告: Warning: you have a Gemfile,but you're not using bundler orRUBYGEMS_GEMDEPS14:54:15 - INFO - Writing new Guardfile to/home/ubuntu/railsprojects/sillyfish/Guardfile 14:54:16 - INFO -
在我的Rails应用程序中运行guard init rspec时会收到此警告:
Warning: you have a Gemfile,but you're not using bundler or
RUBYGEMS_GEMDEPS
14:54:15 - INFO - Writing new Guardfile to
/home/ubuntu/railsprojects/sillyfish/Guardfile 14:54:16 - INFO - rspec
guard added to Guardfile,feel free to edit it

我不明白它为什么显示.可以忽略这个警告吗?

这是我的Gemfile:

source 'https://rubygems.org'

gem 'rails','4.2.4'
gem 'pg'
gem 'sass-rails','~> 5.0'
gem 'uglifier','>= 1.3.0'
gem 'coffee-rails','~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder','~> 2.0'
gem 'sdoc','~> 0.4.0',group: :doc

group :development,:test do
  gem 'rspec-rails','3.3.3'
  gem 'guard-rspec',require: false
  gem 'spring-commands-rspec'
  gem 'byebug'
end

group :development do
  gem 'web-console','~> 2.0'
  gem 'spring'
end

group :test do
  gem 'capybara','2.5.0'
end

#custom gems
gem 'puma'
gem 'bootstrap-sass','~> 3.3.5'
gem 'devise','~> 3.5.2'

解决方法

如果运行guard init rspec,它将使用全局安装的护栏.要运行通过Gemfile安装的那个,请使用bundle exec guard init rspec.这也是 the documentation推荐的.

来自README:

It’s important that you always run Guard through Bundler to avoid errors.

所以最好认真对待这个警告,以避免问题.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读