Tag: bundler

如何确保ruby gem安装在正确的位置以便由bundler执行?

我似乎经常遇到将gem放在正确位置的问题(安装时不需要使用sudo 。) 为了解决sudo问题,我安装了rbenv ,然后用它来安装ruby 2.1.0,这样我就可以从Mac OSX系统中单独安装了一个。 然后我安装了bundler。 但是当我使用Bundler从Gemfile安装gem时,我找不到它们。 在我所采取的所有步骤之间,例如向.bash_profile添加行等等,我有以下内容,但实际上只是想要一种清晰,直接的方式来管理gem及其本地执行: gem env : 编辑:我删除了所有内容并重置了PATH – 仍然没有修复任何东西,但你可以看到gems安装在一个目录中但是当我调用可执行文件时,找不到命令: RubyGems Environment: – RUBYGEMS VERSION: 2.0.14 – RUBY VERSION: 2.0.0 (2014-02-24 patchlevel 451) [universal.x86_64-darwin13] – INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0 – RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby – EXECUTABLE DIRECTORY: /usr/bin – RUBYGEMS PLATFORMS: – ruby – universal-darwin-13 – GEM PATHS: – /Library/Ruby/Gems/2.0.0 – /Users/fongster/.gem/ruby/2.0.0 […]

您的Ruby版本是2.1.0,但您的Gemfile指定为2.0.0

在我的Gemfile中,我指定了ruby版本2.0.0: ruby ‘2.0.0’ 但是我的控制台告诉我我有2.1.0dev: $ ruby -v ruby 2.1.0dev (2013-09-16 trunk 42951) [x86_64-darwin12.4.0] 我正在使用rbenv它告诉我我没有安装2.1.0, $ rbenv versions system * 2.0.0-dev 捆绑更新或捆绑安装说: “Your Ruby version is 2.1.0, but your Gemfile specified 2.0.0″ 但使用’rbenv local 2.0.0-dev’再次给我留下ruby 2.1.0dev。 此外: $ rbenv global 2.0.0-dev $ cat ~/.bash_profile: export PATH=”$HOME/.rbenv/bin:$PATH” if which rbenv > /dev/null; then eval “$(rbenv init -)”; […]

Bundler找不到gem“bundler”的兼容版本:

在这里完成Ruby和Rails的新人…过去曾尝试过一些教程,但那是关于它的。 我正在尝试遵循“Ruby on Rails 3 Tutorial”一书,并找到了一个障碍,在搜索到Google和Google之后我找不到任何帮助。 我还没有做过任何事情; 只要: rails new first_app 然后将Gemfile sqlite3更改为 gem ‘sqlite3-ruby’, ‘1.2.5’, :require => ‘sqlite3′ 当我运行’bundle install’时,我得到以下内容: Fetching gem metadata from http://rubygems.org/……… Bundler could not find compatible versions for gem “bundler”: In Gemfile: rails (= 3.0.1) ruby depends on bundler (~> 1.0.0) ruby Current Bundler version: bundler (1.1.3) This Gemfile requires […]

在gemfile中使用“:platforms =>”工作吗?

我有一个Rails应用程序,我正在Windows上开发并部署到Linux。 我怀疑我将来会完全切换到Linux。 无论如何,在Linux上我需要’execjs’和’therubyracer’,但我不需要Win7中的那些。 所以我将这些行放在我的gemfile中: gem ‘therubyracer’, :platforms => :ruby gem ‘execjs’, :platforms => :ruby 在Linux VM上运行bundle install ,应用程序启动正常。 但在Windows上我得到: Uncaught exception: Could not find execjs-1.2.11 in any of the sources 现在,根据我的阅读( 这里在PLATFORMS下),它告诉我“如果一个gem只能用于特定平台或一组平台,你可以指定它们”,样本是这样的: gem “weakling”, :platforms => :jruby 它说“ ruby C Ruby (MRI) or Rubinius, but NOT Windows ”。 所以对我来说,捆绑者应该忽略Windows上的execjs行。 但是在Windows上运行bundle install我看到了这个: Installing execjs (1.2.11) 所以这对我说我错过了关于docs的东西,或者bundler忽略了platform命令。 […]

bundler安装获取“i18n需要Ruby版本> = 1.9.3”

我怎么能纠正这个“i18n需要Ruby版本> = 1.9.3”我在运行“bundler install”时得到了什么? 背景:需要在dreamhost上使用ruby 1.8.7,所以为此针对Rails v3.2。 命令行 Gregs-MacBook-Pro:weekends Greg$ ruby -v ruby 1.8.7 (2013-12-22 patchlevel 375) [i686-darwin14.1.0] Gregs-MacBook-Pro:weekends Greg$ bundler -v Bundler version 1.9.2 Gregs-MacBook-Pro:weekends Greg$ bundler install Fetching gem metadata from https://rubygems.org/………. Fetching version metadata from https://rubygems.org/… Fetching dependency metadata from https://rubygems.org/.. Resolving dependencies………… Using rake 10.4.2 Gem::InstallError: i18n requires Ruby version >= […]

脱机服务器上的Ruby gem依赖项

我有一个完全与Internet断开连接的服务器(出于一些奇怪的安全原因)。 如何使Ruby依赖于各种gems在该环境中工作? 它可能适用于Bundler ,但如何在没有Internet连接的情况下使用gem安装Bundler?

如何添加Mac特定的gem在Mac上捆绑但不在Linux上捆绑?

我正在Mac上开发一个Rails应用程序,我是新手测试,所以我只是将这些gem添加到我的Gemfile中 : group :test, :development do gem ‘rspec-rails’ gem ‘rb-fsevent’ gem ‘growl’ end 但是我的生产服务器运行Linux,所以即使它们没有分组:production ,bundler( v1.0.21 )仍然会尝试安装它们。 ……显然失败了! extconf.rb:19:in ”: Only Darwin (Mac OS X) systems are supported (RuntimeError) 在运行bundle install之前将RAILS_ENV设置为production 不起作用 。 它运行bundle install –without development test ,但是如何仅通过基于您的操作系统的捆绑器来考虑这些gem? 编辑: bundler wiki提供有关如何使用platform作为参数的详细信息。 在捆绑问题#663中给出了相同的解决方案,所以我尝试了: group :test, :development do gem ‘rspec-rails’ platforms :darwin do gem ‘rb-fsevent’ gem […]

安装Atomic时出错

我正在尝试使用bundle install将gem安装到我的新Ruby项目中。 我在OS X 10.8.4框中使用rbenv设置了Ruby版本。 我收到以下错误: An error occurred while installing atomic (1.1.13), and Bundler cannot continue. Make sure that `gem install atomic -v ‘1.1.13’` succeeds before bundling. Kikime:jazzcatalog curt$ gem install atomic Building native extensions. This could take a while… Successfully installed atomic-1.1.13 1 gem installed Kikime:jazzcatalog curt$ rbenv rehash Kikime:jazzcatalog curt$ bundle install […]

Travis报告了Gemfile.lock损坏的奇怪消息

我使用bundler来安装东西,因为我已经添加了Gemfile.lock ,travis开始抱怨: Your Gemfile.lock is corrupt. The following gem is missing from the DEPENDENCIES section: ‘echoe’ 当然,一切都在当地运作。 它也可以使用DeployBot 。 我甚至安装了docker ubuntu并尝试过,还可以。 我的Gemfile.lock没有损坏。 使用相同版本的ruby和bundler。 到底是怎么回事? 更新 这与bundler版本有关。 我使用的是1.11.0,但得到报告称它与例如。 1.8.3。 ??

使用$ sudo bundle exec …引发’bundle:command not found’错误

我在Ubuntu服务器上安装了rbenv。 我可以进入我的应用程序目录并运行$ bundle而不会出现问题,但是我需要运行$ sudo bundle exec …这会给我一个错误: bundle:找不到命令 为什么这样,我该如何解决?