我想知道如何使用Bundler与Sinatra.我们的想法是使用Bundler在.gems文件夹中下载的gem.
下面是我需要做的。
要运行规格,您需要安装RSpec。首先,在项目的根目录中运行gem install bundler。然后,运行bundle install。要运行单个规格文件,请运行如下命令:bundle exec rspec spec / 00_hello_spec.rb。要一次运行所有规格,请运行bundle exec rspec。
因此,我在终端输入了gem install bundler,并得到了 您对/Library/Ruby/Gems/2.3.0目录没有写权限。
这是在项目文件中的原子* source“ https://rubygems.org ” gem“ rspec”,“〜> 3.2.0” *
我的问题是:
似乎终端机给了我响应,因为我不应该更改ruby上的任何内容,而需要将安装包捆绑在atom内吗?谁能告诉我如何使用原子或在原子中运行任何东西?
非常感谢!
以下是在服务器上运行bundle install vendor/gems的错误:
Installing nokogiri (1.5.0) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/dtt/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for libxml/parser.h... no
-----
libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir …Run Code Online (Sandbox Code Playgroud) Webpack 4增加了一项新功能:它现在支持捆绑的模块中的sideEffects标志package.json.
在过去的30天里,我们与每个框架密切合作,以确保他们已准备好在各自的cli等支持webpack 4.即使像lodash-es这样的流行库,RxJS也支持sideEffects标志,所以通过使用他们的最新版本版本,您将看到即时捆绑尺寸减少开箱即用.
"sideEffects":big-module的package.json中的false标志表示包的模块没有副作用(评估时)并且只暴露导出.这允许像webpack这样的工具优化再出口.
虽然第二个链接显示了使用该标志的结果,但它没有清楚地解释什么构成副作用.ES6包含了此处概述的模块副作用的概念,但这与Webpack考虑的副作用有何关系.
在sideEffects标志的上下文中,模块需要避免在sideEffects:false没有问题的情况下使用什么,或者对话,模块需要做什么才能sideEffects:false无问题地使用.
为了完整起见,尽管@ SeanLarkin在下面给出了可靠的答案,但我想对以下内容进行澄清:
显然,副作用意味着fp特有的东西,包括日志记录(控制台或其他地方)和抛出错误.我假设在这种情况下这些是完全可以接受的吗?
模块是否可以包含循环引用并仍然使用sideEffects: false?
有没有办法验证或模块是否能够验证模块是否可以sideEffects: false超越试图追踪由其误用造成的错误?
是否还有其他因素会妨碍模块的使用sideEffects: false?
我正在努力研究我从github同步的rails项目上的ruby.即使rake-10.0.3安装成功,"bundle install"也会失败.我是rails的新手,不知道如何继续这个.我用Google搜索错误,并尝试按照解决方案的建议安装不同版本的rake,但它没有帮助.
这就是我想要做的......请帮助.
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]
>rails s
?[31mCould not find kaminari-0.14.1 in any of the sources?[0m
?[33mRun `bundle install` to install missing gems.?[0m
>bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
NoMethodError: private method `open' called for Gem::Package:Class
An error occurred while installing rake (10.0.3), and Bundler cannot continue.
Make sure that `gem install rake -v '10.0.3'` succeeds before bundling.
>gem install rake -v '10.0.3'
Successfully installed rake-10.0.3
Done installing documentation for rake (1 …Run Code Online (Sandbox Code Playgroud) 我正在尝试安装rails应用程序,每次使用bundle它都会失败sudo.我目前的情况是,只要sudo用于包括轨道在内的所有东西,一切都能正常工作.我不认为这是正确的.
例如:
$ bundle update
Updating git://github.com/refinery/refinerycms.git
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Enter your password to install the bundled RubyGems to your system:
Using rake (10.0.4)
Using i18n (0.6.1)
Using multi_json (1.7.2)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Installing hike (1.2.2)
Errno::EACCES: Permission denied - /usr/local/rvm/gems/ruby-1.9.3-p194/build_info/hike-1.2.2.info
An error occurred while installing hike (1.2.2), and Bundler cannot continue.
Make sure that `gem install hike -v '1.2.2'` …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用捆绑器与rbenv.我一直工作到今天.我唯一能做的就是打破它gem pristine --all或者gem cleanup?尝试安装bundler时出现以下错误.
Antarrs-MacBook-Pro:some-app antarrbyrd$ sudo gem install bundler
Password:
Bundler gave the error "Could not find mail-2.5.4 in any of the sources" while processing "/Users/antarrbyrd/dev/some-app/Gemfile". Perhaps you forgot to run "bundle install"?
Successfully installed bundler-1.7.12
Parsing documentation for bundler-1.7.12
Done installing documentation for bundler after 3 seconds
1 gem installed
Antarrs-MacBook-Pro:some-app antarrbyrd$ bundle install
/Users/antarrbyrd/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'bundler' (>= 0) among 8 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/antarrbyrd/.gem', execute `gem env` for …Run Code Online (Sandbox Code Playgroud) 跑步时bundle exec jekyll serve我得到bundler: failed to load command: jekyll
苹果系统 12.0.1
宝石文件:
gem "jekyll", "~> 4.2"
# Plugins
group :jekyll_plugins do
gem "jekyll-admin" # https://github.com/jekyll/jekyll-admin
gem "jekyll-feed" # https://github.com/jekyll/jekyll-feed
gem "jekyll-seo-tag", github: "jekyll/jekyll-seo-tag" # https://github.com/jekyll/jekyll-seo-tag
gem "jekyll-archives" # https://github.com/jekyll/jekyll-archives
gem "jekyll-typogrify" # https://github.com/myles/jekyll-typogrify
gem "jekyll-autoprefixer" # https://github.com/vwochnik/jekyll-autoprefixer
gem "jekyll-sitemap" # https://github.com/jekyll/jekyll-sitemap
end
gem "webrick", "~> 1.7"
gem "json", "~> 2.6"
Run Code Online (Sandbox Code Playgroud)
bundle exec jekyll serve --trace给我:
/Users/jrdnbwmn/.rbenv/versions/3.0.2/lib/ruby/3.0.0/pathname.rb:20: warning: already initialized constant Pathname::TO_PATH
/Users/jrdnbwmn/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/pathname-0.2.0/lib/pathname.rb:20: warning: previous definition of …Run Code Online (Sandbox Code Playgroud) 有一个共同的模式:
有许多开发人员在一个项目上工作,Gemfile(.lock)通过SCM共享.但是,如果一些开发人员想要使用不同的工具进行测试和开发呢?怎么做?
问题是,当您将条件部分放入Gemfile时,每个开发人员的Gemfile.lock也会有所不同,因此每次提交SCM时都会遇到冲突.
有一些简单,广泛认可的解决方案吗?
bundler ×10
ruby ×6
rubygems ×3
macos ×2
atom-editor ×1
install ×1
javascript ×1
jekyll ×1
nokogiri ×1
package.json ×1
rake ×1
rbenv ×1
side-effects ×1
sinatra ×1
ubuntu ×1
webpack ×1