2010-11-09 144 views
10

我無法在我的Rails應用程序中設置一個Gem。我做了以下內容:Rails |安裝country_select gem

gem 'country_select', :git => 'git://github.com/rails/country_select.git' 

試圖利用寶石這裏找到:

https://github.com/rails/country_select 

我收到以下錯誤:

Could not find gem 'country_select (>= 0, runtime)' in git://github.com/rails/country_select.git (at master). 
Source does not contain any versions of 'country_select (>= 0, runtime)' 
+0

嘗試使用'carmen'gem> https://github.com/jim/carmen。 – xpepermint 2012-04-13 16:00:26

回答

10

它不安裝作爲寶石因爲它不是寶石,它是一個插件。

下面是Rails的

Rails3中

rails plugin install https://github.com/rails/country_select.git 

Rails2

ruby script/plugin install https://github.com/rails/country_select.git 
+2

Rails 4將不再支持插件,現在更好地使用寶石。 – thekingoftruth 2012-06-27 08:17:55

30

我只是forked and gemified這個插件的安裝方向,如果它是任何使用你的。

# Gemfile 
gem "country-select" 
+0

不錯!答案加上資源。 – Troy 2011-12-12 22:52:56

+2

截至此評論日期,寶石正在定期更新。使用它而不是插件。 – Gavin 2012-01-08 23:36:11