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

ruby-on-rails – Bundle不想安装gem(尚未检出)

发布时间:2020-12-16 19:23:49 所属栏目:百科 来源:网络整理
导读:我想在rails服务器上运行 Ruby,但某个gem不想安装.这个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 installe
我想在rails服务器上运行 Ruby,但某个gem不想安装.这个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]

在Gemfile中,我指定了ruby“1.9.3”,然后我再次运行bundle install并得到:

Your Ruby version is 2.0.0,but your Gemfile specified 1.9.3

此特定gem的Gemfile行:

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

我在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)

我真的不明白发生了什么.我在Mac OS X下.

谢谢.

解决方法

编辑:您必须使用 rvm或 rbenv来设置ruby版本.这不是在gem文件中设置的. Ruby不是宝石.

此错误可能有多种原因之一.

从Bundler issues

# 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

(编辑:李大同)

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

    推荐文章
      热点阅读