我正在关注Michael Hartl的Ruby on Rails教程&一切都运转良好,直到我到达this stage。
出于某种原因,当我尝试运行一个bundler或者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.
#!/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
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
答案 0 :(得分:1)
看起来你错过了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
答案 1 :(得分:0)
此问题是由我对〜/ .bashrc文件所做的修改,以自定义终端中的提示。我已将PS1='\[\033[01;31m\]\W: \[\033[01;33m\]\$ \[\033[01;37m\]'
放在〜/ .bashrc文件的底部。
我必须删除PS1='\[\033[01;31m\]\W: \[\033[01;33m\]\$ \[\033[01;37m\]'
&amp;完全卸载&amp;删除RVM&amp; Ruby来自我的系统&amp;重新安装它们。我尝试rvm implode
删除所有内容,但这一开始没有用,它说没有安装rvm!当我尝试source ~/.rvm/scripts/rvm
时,我能够成功运行rvm implode
。
我可以通过输入:
来自定义我的提示PS1='\[\033[01;31m\]\W: \[\033[01;33m\]\$ \[\033[01;37m\]'
source ~/.rvm/scripts/rvm
进入我的〜/ .bash_profile