Skip to content Skip to sidebar Skip to footer

Select2 Js Lib Not Working On Rails App

I was given this Rails app that utilizes the select2 JS library and can't figure out why it's not styling my select list. It's working in production. I created a staging server fro

Solution 1:

I found the issue being a different ruby, bundler, and gem versions. I'm not sure which gem was causing the issue but I fixed the issue with the following steps. You're environment may be a little different but this should get you on the right path:

  1. Copied from the production server, line for line, the Gemfile and Gemfile.lock to my local machine
  2. On my local machine I installed the same version of ruby (2.2.1) as production using rvm.
  3. Installed bundler 1.14.0 using gem install bundler -v 1.14.0 (1.14.0 is what the production server has on it.)
  4. Ran bundle _1.14.0_ install, it failed because local mysql was to new
  5. Since my local version of mysql was to new I had to downgrade that using homebrew. See Multiple MySQL Versions with Homebrew
  6. Ran bundle _1.14.0_ install again, success.
  7. Since the Gemfiles have now changed I committed those changes
  8. I git pulled those changes to my server
  9. Staging server ruby version wasn't matching production 2.2.1
  10. Had to install rvm on staging server, luckily i'm using ubuntu so I simply used these instructions RVM package for Ubuntu. Make sure to follow Terminal ouput.
  11. Installed ruby via rvm install 2.2.1
  12. Ran bundle install on server, success. All gems matching production.
  13. Ran rake assets:clobber && rake assets:precompile on staging server.
  14. Restarted web server.

Post a Comment for "Select2 Js Lib Not Working On Rails App"