[英]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.编辑:您必须使用rvm或rbenv来设置 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.