简体   繁体   中英

rails gem Simple_form installation is not working

I am using rails 4.2.4 and I am trying to use simple_form

Right now my view gives the error:

undefined method `simple_form_for' for #<#<Class:0xbbc2748>:0xbbc1460>

Gem list returns a list of gems and it includes simple_form. I installed simple_form by typing gem install simple_form

$gem list 

returns

simple_form (3.2.1)

I have also tried and got this:

rails generate simple_form:install --bootstrap
Could not find generator 'simple_form:install'. Maybe you meant 'responders:install', 'rspec:install' or 'devise:install'
Run `rails generate --help` for more options.

Does anyone know how to fix this issue?

If you just installed it via gem install you didn't add it to your Rails application. Instead, you need to add it to your Gemfile , look at the documentation .

Gemfile:

gem 'simple_form'

Then run bundle install and continue with the installation from the Github page.

You need to add it to your Gemfile, and then bundle. Rails uses bundler for gem management, and will only include gems that are included in your Gemfile.

I had exactly the same problem. But I putted a gem 'simple_form' in my Gemfile. I fixed the problem with a spring stop command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM