gpt4 book ai didi

ruby-on-rails-3 - 为什么 Rails & Bundler 包消失了?

转载 作者:行者123 更新时间:2023-12-04 19:21:53 26 4
gpt4 key购买 nike

我正在关注 Michael Hartl 的 Ruby on Rails 教程,一切正常,直到我到达 this stage .

出于某种原因,当我尝试运行 bundle 程序或 rails 命令时,它说它们没有安装,即使它们之前正在工作并且我试图重新安装它们。

这可能与我的 rvm gemset 有关吗?我不确定如何检查 rvmrc 文件。

或者可能与我的操作系统有关。我正在 Windows 7 中托管的虚拟盒子上开发 ubuntu 12.10。

在此先感谢您的帮助。

如果这里有帮助,请点击 repo为应用程序。

控制台读出

first_app: $ bundle install --without production
ERROR: Gem bundler is not installed, run `gem install bundler` first.

first_app: $ bundle update
ERROR: Gem bundler is not installed, run `gem install bundler` first.

first_app: $ gem install bundler
Successfully installed bundler-1.3.2
1 gem installed

first_app: $ bundle install --without production
ERROR: Gem bundler is not installed, run `gem install bundler` first.

first_app: $ ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]


first_app: $ rails -v
The program 'rails' can be found in the following packages:
* rails
* ruby-railties-3.2
Try: sudo apt-get install <selected package>

first_app: $ gem install rails -v 3.2.12
Successfully installed rails-3.2.12
1 gem installed
first_app: $ rails -v
The program 'rails' can be found in the following packages:
* rails
* ruby-railties-3.2
Try: sudo apt-get install <selected package>

first_app: $ sudo apt-get install rails -v 3.2.12
[sudo] password for ross:
apt 0.9.7.5ubuntu5.1 for amd64 compiled on Dec 12 2012 13:50:19
Supported modules:
*Ver: Standard .deb
*Pkg: Debian dpkg interface (Priority 30)
Pkg: Debian APT solver interface (Priority -1000)
S.L: 'deb' Standard Debian binary tree
S.L: 'deb-src' Standard Debian source tree
Idx: Debian Source Index
Idx: Debian Package Index
Idx: Debian Translation Index
Idx: Debian dpkg status file
Idx: EDSP scenario file

first_app: $ rails -v
The program 'rails' can be found in the following packages:
* rails
* ruby-railties-3.2
Try: sudo apt-get install <selected package>
first_app: $

~: $ gem list bundler

*** LOCAL GEMS ***


~: $ rvm gemset list

gemsets for ruby-1.9.3-p392 (found in /home/ross/.rvm/gems/ruby-1.9.3-p392)
(default)
global
=> rails3tutorial2ndEd

~: $ which gem
/home/ross/.rvm/bin/gem

first_app: $ gem uninstall bundler && rvm @global do gem install bundler && bundle -v

You have requested to uninstall the gem:
bundler-1.3.2
bundle-0.0.1 depends on [bundler (>= 0)]
multi_json-1.6.1 depends on [bundler (~> 1.0)]
rails-3.2.12 depends on [bundler (~> 1.0)]
uglifier-1.3.0 depends on [bundler (~> 1.0)]
uglifier-1.2.3 depends on [bundler (~> 1.0)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] y
Remove executables:
bundle

in addition to the gem? [Yn] y
Removing bundle
Successfully uninstalled bundler-1.3.2
Successfully installed bundler-1.3.2
1 gem installed
ERROR: Gem bundler is not installed, run `gem install bundler` first.

用户/.rvm/bin/gem
#!/usr/bin/env bash

if [[ -s "/home/ross/.rvm/environments/ruby-1.9.3-p392@rails3tutorial2ndEd" ]]
then
source "/home/ross/.rvm/environments/ruby-1.9.3-p392@rails3tutorial2ndEd"
exec gem "$@"
else
echo "ERROR: Missing RVM environment file: '/home/ross/.rvm/environments/ruby-1.9.3-p392@rails3tutorial2ndEd'" >&2
exit 1
fi

/home/ross/.rvm/environments/ruby-1.9.3-p392@rails3tutorial2ndEd
export PATH ; PATH="/home/ross/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/bin:/home/ross/.rvm/gems/ruby-1.9.3-p392@global/bin:/home/ross/.rvm/rubies/ruby-1.9.3-p392/bin:/home/ross/.rvm/bin:$PATH"
export rvm_env_string ; rvm_env_string='ruby-1.9.3-p392@rails3tutorial2ndEd'
export rvm_path ; rvm_path='/home/ross/.rvm'
export rvm_ruby_string ; rvm_ruby_string='ruby-1.9.3-p392'
export rvm_gemset_name ; rvm_gemset_name='rails3tutorial2ndEd'
export RUBY_VERSION ; RUBY_VERSION='ruby-1.9.3-p392'
export GEM_HOME ; GEM_HOME='/home/ross/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd'
export GEM_PATH ; GEM_PATH='/home/ross/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd:/home/ross/.rvm/gems/ruby-1.9.3-p392@global'
export MY_RUBY_HOME ; MY_RUBY_HOME='/home/ross/.rvm/rubies/ruby-1.9.3-p392'
export IRBRC ; IRBRC='/home/ross/.rvm/rubies/ruby-1.9.3-p392/.irbrc'
unset MAGLEV_HOME
unset RBXOPT

最佳答案

看来你错过了last step of rvm install section of the tutorial :

$ rvm use 1.9.3@rails3tutorial2ndEd --create --default
Using /Users/mhartl/.rvm/gems/ruby-1.9.3 with gemset rails3tutorial2ndEd

关于ruby-on-rails-3 - 为什么 Rails & Bundler 包消失了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15312221/

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