Rails 4, Ruby 2.0 and SQLite3 windows, ruby 2, rails 4, sqlite3

After your successful Rails 4 install, you can’t run it (rails server), because your SQLite3 isn’t compatible with Ruby 2 yet.

Checking Google, I’ve found this : https://groups.google.com/forum/#!topic/rubyinstaller/gedIaMryCFQ/discussion and this https://gist.github.com/luislavena/5120722

So,

  1. uninstall the sqlite3 gem for cleaning : gem uni sqlite3

  2. download the knapsack found in the discussion, and place it in a temp repertory (ie c:/dev/temp).

  3. compile sqlite3 with the knapsack gem install sqlite3 --platform=ruby -- --with-opt-dir=C:/dev/temp

  4. Test it :

    irb
    require 'sqlite3'
    SQLite3::SQLITE_VERSION` => "3.7.15.2"
    

You’re good :) Thanks Luis.

PS : often Rails need to update some gem, but if you want to keep some special gem (like this sqlite3), don’t use bundle update but bundle update --local and install manually missing gem.


comments powered by Disqus