The internet is all about rake:db:sessions:create. But for the RAILS4 version, it doesn't work.
Here is my own operation for the RAILS4 version.
RAILS4 Session data Table creation: Please refer to this document: Http://www.cnblogs.com/heimirror/p/3536965.html.
1. Locate the project's Gemfile file to modify it:
Add Gem ' Activerecord-session_store '
Save exit, do not need the URL of the following GitHub
2. Execute under the project root path:
Rails Generate Active_record:session_migration
3. Modify the Config/initializers/session_store.rb file
Rails.application.config.session_store:active_record_store
Add this line and the rest can be dropped.
4. Execute the Database Migration command in command line mode: Rake db:migrate
You'll find a sesions table in your database.
Note here that the difference between 4 and previous versions is larger, and no longer rake db:sessions:create.
This article is from the "re-learn Java" blog, please be sure to keep this source http://3131854.blog.51cto.com/3121854/1558575
Ruby on RAILS4 Session database storage method