简体   繁体   English

Bundle 不想安装 gem(尚未签出)

[英]Bundle doesn't want to install a gem (not yet checked out)

I want to run a Ruby on rails server, but a certain gem doesn't want to install.我想在 Rails 服务器上运行 Ruby,但不想安装某个 gem。 This rails program is not compatible with ruby 2.0, so I want to use ruby 1.9.3, which I installed, but I can't bundle install anymore...这个rails程序与ruby 2.0不兼容,所以我想使用我安装的ruby 1.9.3,但我不能再捆绑安装了……

$ bundle install
# ...
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
$ bundle exec rails s
git://github.com/goodtouch/jbuilder.git (at master) is not yet checked out. Run `bundle install` first.
$ bundle show jbuilder
/Users/julien/.bundler/ruby/2.0.0/jbuilder-7fb0eae924c7
$ ruby --version
ruby 1.9.3p545 (2014-02-24 revision 45159) [x86_64-darwin13.1.0]

In the Gemfile , I specified ruby "1.9.3" , then I ran bundle install again and got:Gemfile中,我指定了ruby "1.9.3" ,然后我再次运行bundle install并得到:

Your Ruby version is 2.0.0, but your Gemfile specified 1.9.3

The Gemfile line for this specific gem:此特定 gem 的Gemfile行:

gem 'jbuilder', git: "git://github.com/goodtouch/jbuilder.git"

And what I get in the Gemfile.lock :我在Gemfile.lock中得到了什么:

GIT
  remote: git://github.com/goodtouch/jbuilder.git
  revision: 7fb0eae924c77318ede344f32a5c208b91cdbaac
  specs:
    jbuilder (0.4.1)
      activesupport (>= 3.0.0)
      blankslate (>= 2.1.2.4)

I really don't understand what's going on.我真的不明白发生了什么事。 I'm under Mac OS X.我在 Mac OS X 下。

Thank you.谢谢你。

Edit : You have to use rvm or rbenv to set ruby version.编辑:您必须使用rvmrbenv来设置 ruby​​ 版本。 This is not set in the gem file.这不是在 gem 文件中设置的。 Ruby is not a gem.红宝石不是宝石。

This error might have one of many reasons.此错误可能有多种原因之一。

From the Bundler issues来自Bundler 问题

# remove user-specific gems and git repos
rm -rf ~/.bundle/ ~/.gem/bundler/ ~/.gems/cache/bundler/

# remove system-wide git repos and git checkouts
rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/

# remove project-specific settings
rm -rf .bundle/

# remove project-specific cached gems and repos
rm -rf vendor/cache/

# remove the saved resolve of the Gemfile
rm -rf Gemfile.lock

# uninstall the rubygems-bundler and open_gem gems
rvm gemset use global # if using rvm
gem uninstall rubygems-bundler open_gem

# try to install one more time
bundle install

My issue was because my gemfile.lock was using the different我的问题是因为我的 gemfile.lock 使用了不同的

BUNDLED WITH捆绑

check the version and see if they match检查版本并查看它们是否匹配

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 宝石没有签出。 请在Heroku中运行`bundle install` - Gem is not checked out. Please run `bundle install` in Heroku 捆绑软件安装有效,但是捆绑软件显示错误“ rails.git尚未签出。 请运行“捆绑安装” - bundle install works, but bundle-show gives error “rails.git is not yet checked out. Please run `bundle install`” gem install pg有效,但bundle安装无效 - gem install pg works but bundle install doesn't gem install sqlite3有效,捆绑安装不起作用吗? - gem install sqlite3 works, bundle install doesn't? “ gem install bundler --version = 0.8.1”未安装可执行文件 - “gem install bundler --version=0.8.1” doesn't install the bundle executable 捆绑安装后,为什么gem不会出现在本地gem中? - Why gem doesn't appear in local gems after bundle install? 如果未检出“来自git存储库的gem”,如何解决错误。 请运行“捆绑安装” - How to resolve error where gem from git repository “is not checked out. Please run `bundle install`” 捆绑安装不会在本地安装gem - Bundle install won't install gem locally 没有检查出''宝石(在主人身上)。 首先运行'bundle install'“每次运行rake db:migrate - Getting “'gem (at master) is not checked out. Run 'bundle install' first” every time I run rake db:migrate gem install pg 不会捆绑 - gem install pg won't bundle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM