2

I'm trying to create a Rails 5 project on Mac OSX (El Capitan)

rails new myproject

but then I get this error:

Could not find gem 'turbolinks-source (~> 5)'

Can someone help me to fix this issue?

Thanks a lot,

Anthony

Toontje
  • 1,415
  • 4
  • 25
  • 43
  • Do you have that gem mentioned in Gemfile ? If so can you post that line here ? – Sajan Oct 18 '16 at 06:41
  • no, I have only this line in my Gemfile: gem 'turbolinks', '~> 5' – Toontje Oct 18 '16 at 06:44
  • Ok, then can you try adding `gem "turbolinks-source", "~> 5"` after `gem 'turbolinks', '~> 5'` ? – Sajan Oct 18 '16 at 06:50
  • I have tried that, but then I get the error: Could not find gem 'turbolinks-source (~> 5)' in any of the gem sources listed in your Gemfile or available on this machine. – Toontje Oct 18 '16 at 06:52
  • 2
    I fixed the issue by running: gem install "turbolinks-source" – Toontje Oct 18 '16 at 07:00
  • Thats great, sometimes these messages can be hard to interpret :) – Sajan Oct 18 '16 at 07:03
  • 3
    I'm not sure why you got downvoted. I have the same situation creating a new Rails 5 app, and `gem install turbolinks-source` fixed it for me, too, but I'm not sure why that worked where Bundler doesn't. – Steve Oct 24 '16 at 16:05

3 Answers3

1

Try removing ~/.bundle/cache/. That fixed this issue for me.

Steve
  • 6,618
  • 3
  • 44
  • 42
  • Worked perfectly. Thanks! In my case I was resetting my Ruby install by removing `~/.gem` `~/.rubies` and `~/.src` but forgot `~/.bundle`. – Jared Fine Oct 31 '16 at 01:26
0

On Windows: Try to reinstall rubyinstaller-devkit.

Honzik
  • 53
  • 4
0

How do I install sqlite3 for Ruby on Windows?

it was here my solution !

You can also download ruby on rails with devkit https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.3-1/rubyinstaller-devkit-2.6.3-1-x64.exe

Even though the question has been answered, I want to post my research to help others. I found a lot of information online, but being a Ruby newbie I had a tough time following all. The basic answer comes from the following post https://github.com/luislavena/sqlite3-ruby/issues/82 with instructions by "paulwis" on how to properly install sqlite3 for ruby 2.0.0-p0 and some comments on https://github.com/rails/rails/issues/10150 . So here it is:

  1. Install the Ruby Devkit for your setup (DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe for me since I use a x64 machine)
  2. Download and extract the autoconf package from Sqlite.org
  3. Run msys.bat (it is inside the ruby devkit root folder)
  4. cd into the path where you downloaded the sqlite source (for example: "cd /c/dev/sqlite3" for path "c:\dev\sqlite3" if you are new to MSYS/MINGW32)
  5. "./configure"
  6. Run "make"
  7. Run "make install"
  8. Get the sqlite3 gem again, this time specifying the platform and the path to the newly compiled binaries:

    gem install sqlite3 --platform=ruby -- --with-sqlite3-include=[path\to\sqlite3.h] --with-sqlite3-lib=[path\to\sqlite3.o]
    

For example:

gem install sqlite3 --platform=ruby -- --with-sqlite3-include=/c:/dev/sqlite3/ --with-sqlite3-lib=/c:/dev/sqlite3/.libs/

(from the paths given in step 4)

Check the Gemfile.lock of your rails app and make sure that it points to the correct sqlite3 version. Mine was "sqlite3 (1.3.7-x86-mingw32)" and manually changed it to "sqlite3 (1.3.7-x64-mingw32)". Removing the platform also works: "sqlite3 (1.3.7)".

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129