更新 country_state_select gem
update country_state_select gem
我要更新country_state_selectgem...
这是我的 Gemfile
gem 'country_state_select'
gem 'chosen_rails'
gem 'compass-rails'
在 bundle
之后,我将启动我的 rails 应用程序 rails s
我有错误,看起来像
NoMethodError - undefined method `state_options' for CountryStateSelect:Module:
app/views/shared/users/_light_box_login.html.erb:101:in `block in _app_views_shared_users__light_box_login_html_erb___390633241__632173138'
actionview (4.2.7.1) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionview (4.2.7.1) lib/action_view/helpers/capture_helper.rb:202:in `with_output_buffer'
actionview (4.2.7.1) lib/action_view/helpers/capture_helper.rb:38:in `capture'
actionview (4.2.7.1) lib/action_view/helpers/form_helper.rb:444:in `form_for'
simple_form (3.3.1) lib/simple_form/action_view_extensions/form_helper.rb:26:in `block in simple_form_for'
simple_form (3.3.1) lib/simple_form/action_view_extensions/form_helper.rb:45:in `with_simple_form_field_error_proc'
simple_form (3.3.1) lib/simple_form/action_view_extensions/form_helper.rb:25:in `simple_form_for'
app/views/shared/users/_light_box_login.html.erb:44:in `_app_views_shared_users__light_box_login_html_erb___390633241__632173138'
actionview (4.2.7.1) lib/action_view/template.rb:145:in `block in render'
我发现 solution
我的意思是gem 'country_state_select', '3.0.1'
但是当添加这个 gem 和捆绑包时,我有另一个问题..
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "compass-rails":
In snapshot (Gemfile.lock):
compass-rails (= 3.0.2)
In Gemfile:
compass-rails
country_state_select (= 3.0.1) was resolved to 3.0.1, which depends on
compass-rails (~> 2.0.4)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
任何人都可以帮助我..如何更新 gem 版本..
删除 gemfile.lock
文件并在您的 gemfile 中使用 gem 'country_state_select'
,然后在终端中使用 bundle install
。
尝试bundle update
。这已经在你的问题中了。
或者如果您想更新特定的 gem 使用,
bundle update gem-name
我要更新country_state_selectgem...
这是我的 Gemfile
gem 'country_state_select'
gem 'chosen_rails'
gem 'compass-rails'
在 bundle
之后,我将启动我的 rails 应用程序 rails s
我有错误,看起来像
NoMethodError - undefined method `state_options' for CountryStateSelect:Module:
app/views/shared/users/_light_box_login.html.erb:101:in `block in _app_views_shared_users__light_box_login_html_erb___390633241__632173138'
actionview (4.2.7.1) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionview (4.2.7.1) lib/action_view/helpers/capture_helper.rb:202:in `with_output_buffer'
actionview (4.2.7.1) lib/action_view/helpers/capture_helper.rb:38:in `capture'
actionview (4.2.7.1) lib/action_view/helpers/form_helper.rb:444:in `form_for'
simple_form (3.3.1) lib/simple_form/action_view_extensions/form_helper.rb:26:in `block in simple_form_for'
simple_form (3.3.1) lib/simple_form/action_view_extensions/form_helper.rb:45:in `with_simple_form_field_error_proc'
simple_form (3.3.1) lib/simple_form/action_view_extensions/form_helper.rb:25:in `simple_form_for'
app/views/shared/users/_light_box_login.html.erb:44:in `_app_views_shared_users__light_box_login_html_erb___390633241__632173138'
actionview (4.2.7.1) lib/action_view/template.rb:145:in `block in render'
我发现 solution
我的意思是gem 'country_state_select', '3.0.1'
但是当添加这个 gem 和捆绑包时,我有另一个问题..
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "compass-rails":
In snapshot (Gemfile.lock):
compass-rails (= 3.0.2)
In Gemfile:
compass-rails
country_state_select (= 3.0.1) was resolved to 3.0.1, which depends on
compass-rails (~> 2.0.4)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
任何人都可以帮助我..如何更新 gem 版本..
删除 gemfile.lock
文件并在您的 gemfile 中使用 gem 'country_state_select'
,然后在终端中使用 bundle install
。
尝试bundle update
。这已经在你的问题中了。
或者如果您想更新特定的 gem 使用,
bundle update gem-name