2014-04-12 80 views
1

當我在Ubuntu 13.10運行rails new [application],我得到以下錯誤:railis新的失敗在Ubuntu

Resolving dependencies... 
Could not find gem 'coffee-rails (~> 3.2.1) ruby' in the gems available on this machine. 

它看起來像我有,雖然安裝了這種寶石:什麼是

$ gem list | grep coffee-rails 
coffee-rails (4.0.1) 

任何想法繼續?

回答

5

根據the Bundler page

The specifier ~> has a special meaning, best shown by example. ~> 2.0.3 is identical to >= 2.0.3 and < 2.1. ~> 2.1 is identical to >= 2.1 and < 3.0. ~> 2.2.beta will match prerelease versions like 2.2.beta.12.

因此,版本4.0.1你的寶石仍然不指定一個,那就是3.2.1和3.3 <之間。

只要運行

bundle install

或者,如果你無法獲得項目目錄具有有效的Gemfile:

gem install coffee-rails --version 3.2.1

它應該安裝兼容的版本。

2

我想通了。我得到那個錯誤之後,我繼續在新創建的應用程序文件夾上運行bundle install。它安裝了缺失的依賴關係,並且rails new正在工作。