0

我已经在 Linux Mint v14 Nadia 上安装了 rails 4.0.0.rc1。

当我跑

rails new something

它给了我错误(我将只放最后几行):

创建 vendor/assets/stylesheets/.keep 运行 bundle install /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/ui.rb:36:in initialize': undefined method[]' for # (NoMethodError)来自 /usr/lib/ruby/vendor_ruby/bundler/cli.rb:12:in new' from /usr/lib/ruby/vendor_ruby/bundler/cli.rb:12:ininitialize' 来自 /usr/lib/ruby/vendor_ruby/bundler/vendor/thor.rb:263:in new' from /usr/lib/ruby/vendor_ruby/bundler/vendor/thor.rb:263:indispatch' 来自 /usr/lib/ ruby/vendor_ruby/bundler/vendor/thor/base.rb:386:in start' from /var/lib/gems/1.9.1/gems/bundler-1.3.5/bin/bundle:20:inblock in '来自/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:在with_friendly_errors' from /var/lib/gems/1.9.1/gems/bundler-1.3.5/bin/bundle:20:in'

然后我更改目录以检查依赖项:

cd something
bundle check

它说:

解决依赖关系... Bundler 无法满足您的 Gemfile 的依赖关系。使用bundle install.

然后我运行:

捆绑安装

它显示:

Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Enter your password to install the bundled RubyGems to your system: 
Installing rake (10.0.4) 
Using i18n (0.6.4) 
Using minitest (4.7.4) 
Using multi_json (1.7.3) 
Using atomic (1.1.9) 
Using thread_safe (0.1.0) 
Using tzinfo (0.3.37) 
Using activesupport (4.0.0.rc1) 
Using builder (3.1.4) 

......等等,这需要一个多小时并且仍在运行。

我认为这里发生了一些奇怪的事情。也许我的安装不正确...

4

1 回答 1

0

我找到了解决方案。我补充说:

source ~/.bash_profile

.bashrc

.bash_profile 的内容:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # 将 RVM作为函数加载到 shell 会话中

于 2013-05-10T06:53:06.930 回答