rvm / ruby​​ - 在尝试创建gem骨架时,bundler无法正常工作

时间:2013-09-09 23:50:21

标签: ubuntu rubygems rvm bundler

我将我的ubuntu版本从12.04更新到13.04,因此不得不重新安装所有内容......大部分内容现在正在运行......但是,'bundler'不是。

即。运行以下内容以创建新的gem骨架时:

bundle gem np_search

它给了我以下错误:

在rvm ruby​​ v.2.0.0下(与1.9.3相同的错误)

Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/home/ismail/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/cli.rb:689:in ``': No such file or directory - git (Errno::ENOENT)
from /home/ismail/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/cli.rb:689:in `gem'
from /home/ismail/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
from /home/ismail/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
from /home/ismail/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
from /home/ismail/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
from /home/ismail/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/bin/bundle:20:in `block in <top (required)>'
from /home/ismail/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
from /home/ismail/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/bin/bundle:20:in `<top (required)>'
from /home/ismail/.rvm/gems/ruby-2.0.0-p247@global/bin/bundle:23:in `load'
from /home/ismail/.rvm/gems/ruby-2.0.0-p247@global/bin/bundle:23:in `<main>'

在系统ruby下运行(即没有rvm)ruby版本2.0.0

-bash: /usr/local/bin/bundle: /usr/bin/ruby1.8: bad interpreter: No such file or directory

我已在第一条错误消息中执行了链接中的所有步骤,但仍然存在问题。另外,看看谷歌和stackoverflow但找不到任何解决问题的方法......

这是我输入“bundle env”

时得到的

在rvm中:

Bundler 1.3.5
Ruby 2.0.0 (2013-06-27 patchlevel 247) [x86_64-linux]
Rubygems 2.0.7
rvm 1.22.5 (stable)
GEM_HOME /home/ismail/.rvm/gems/ruby-2.0.0-p247
GEM_PATH /home/ismail/.rvm/gems/ruby-2.0.0-p247:/home/ismail/.rvm/gems/ruby-2.0.0-p247@global

Gemfile
<No Gemfile found>

Gemfile.lock
<No Gemfile.lock found>

使用系统ruby 2.0.0时,'bundle env'只是给了我

-bash: /usr/local/bin/bundle: /usr/bin/ruby1.8: bad interpreter: No such file or directory

我确实尝试通过输入以下内容将ruby路径导出到.bashrc(我在线阅读的内容)......

sudo ln -s /usr/bin/ruby /usr/local/bin/ruby

但它没有任何区别。

非常感谢你的帮助......

1 个答案:

答案 0 :(得分:2)

这是因为Bundler需要git才能安装此命令 - 来自上述代码行:

git_user_name = `git config user.name`.chomp

安装git然后它应该可以正常工作......至少对于这部分。