gpt4 book ai didi

ruby-on-rails - 在任何来源中都找不到 rake-0.9.2.2 (Bundler::GemNotFound)

转载 作者:行者123 更新时间:2023-12-04 05:33:51 25 4
gpt4 key购买 nike

在尝试更新需要安装新 gem 的 Rails 应用程序时,我在服务器 (Apache2) 上运行 Rails 时出现以下错误

Could not find rake-0.9.2.2 in any of the sources (Bundler::GemNotFound)

/home/server/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/spec_set.rb 90 in `block in materialize'
1 /home/server/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/spec_set.rb 83 in `map!'
2 /home/server/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/spec_set.rb 83 in `materialize'
3 /home/server/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/definition.rb 127 in `specs'
4 /home/server/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/definition.rb 172 in `specs_for'
5 /home/server/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/definition.rb 161 in `requested_specs'
6 /home/server/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/environment.rb 23 in `requested_specs'
7 /home/server/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb 11 in `setup'
8 /home/server/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler.rb 107 in `setup'

当我这样做时 bundle install , 或 gem list --local它列出了很好的 gem :
actionmailer (3.2.3)
actionpack (3.2.3)
activemodel (3.2.3)
activerecord (3.2.3)
activeresource (3.2.3)
activesupport (3.2.3)
arel (3.0.2)
bcrypt-ruby (3.0.1)
builder (3.0.0)
bundler (1.1.4)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.3.3)
devise (2.1.2)
dynamic_form (1.1.4)
erubis (2.7.0)
execjs (1.4.0)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
jquery-rails (2.0.2)
json (1.7.3)
mail (2.4.4)
mime-types (1.18)
multi_json (1.3.6)
orm_adapter (0.3.0)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.3)
railties (3.2.3)
rake (0.9.2.2)
rdoc (3.12)
sass (3.1.19)
sass-rails (3.2.5)
sprockets (2.1.3)
sqlite3 (1.3.6)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.33)
uglifier (1.2.4)
warden (1.2.1)

但是当我执行 ruby​​ -v 时,它显示 ruby​​ 1.8.7,错误日志显示 .rvm/gems/ruby-1.9.2-p320 ...
我如何告诉它使用已安装的 1.8.7,因为这一直有效(我对升级不感兴趣)

我找到了这篇文章 -[ Why am I getting this Passenger error Could not find rake-0.9.2.2 in any of the sources?

[1]: Why am I getting this Passenger error Could not find rake-0.9.2.2 in any of the sources? - 尝试没有成功!

最佳答案

为了简单起见,创建一个 gemset

rvm gemset first_app


  • 在项目文件夹中创建一个 .rvmrc 文件并输入 rvm use 1.8.7@first_app

  • 当你进入项目时,通过输入检查,

    ruby -v

    rails -v

    rvm use first_app



    现在做 bundle install 然后 rails server, 你应该不会在这之后遇到问题,如果有任何问题回复

    关于ruby-on-rails - 在任何来源中都找不到 rake-0.9.2.2 (Bundler::GemNotFound),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12237762/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com