导轨| 安装country_select gem

joh*_*nix 10 gem rubygems ruby-on-rails github

我在rails应用程序中设置gem时遇到问题.我正在做以下事情:

gem 'country_select', :git => 'git://github.com/rails/country_select.git'
Run Code Online (Sandbox Code Playgroud)

试图利用这里发现的宝石:

https://github.com/rails/country_select
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

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)'
Run Code Online (Sandbox Code Playgroud)

Jam*_*sDS 30

我只是这个插件进行分叉和创作,如果对你有用的话.

# Gemfile
gem "country-select"
Run Code Online (Sandbox Code Playgroud)

  • 截至此评论日期,宝石正在定期更新.使用它而不是插件. (2认同)

rwi*_*ams 10

它不是作为宝石安装的,因为它不是宝石,它是一个插件.

以下是Rails的安装方向

Rails3中

rails plugin install https://github.com/rails/country_select.git
Run Code Online (Sandbox Code Playgroud)

Rails2

ruby script/plugin install https://github.com/rails/country_select.git
Run Code Online (Sandbox Code Playgroud)

  • Rails 4将不再支持插件,现在最好使用gem. (2认同)