简体   繁体   中英

Rails bundle install fails

I am trying to make a new rails app when typing:

rails new app

I then get the error:

Could not find sqlite3-1.3.8 in any of the sources
Run `bundle install` to install missing gems.

I then run bundle install and get this error:

An error occurred while installing sqlite3 (1.3.8), and Bundler cannot      continue.
Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundling.

I have
sqlite3 (1.3.10) sqlite3-full (1.3.9.3) sqlite3-ruby (1.3.3)

I have no idea why the install wants to use 1.3.8 when I have 1.3.10 installed. I am new to rails but I have made a few small apps in the past few weeks, This is the first time this has happened to me. Is there A local Gem file that I could edit so when I create A new app it doesn't try to use this old gem. I have also tried to create a new app use postgres with the same error.

I am using mac osx 10.10.1. ruby version 2.2.1.

Thanks for any help.

EDIT: when I run

gem install sqlite3 -v '1.3.8'

this is the result:

./sqlite3_ruby.h:16:36: note: expanded from macro 'RBIGNUM_LEN' #define RBIGNUM_LEN(x) RBIGNUM(x)->len

~~~~~~~~~~ ^

statement.c:261:32: error: use of undeclared identifier 'SIZEOF_BDIGITS' if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) { ^ 1 warning and 2 errors generated. make: *** [statement.o] Error 1

make failed, exit code 2

Check your Gemfile and GemFile.lock to see if the versions are fixed. Remove the version or change it as necessary.

Do the following:

Delete your gemfile.lock Run bundle install .

If bundle install still fails, run gem uninstall sqlite3 and run bundle install

Gemfile and Gemfile.lock is located in the root folder of your file

Compare your app folder structure to this:

在此处输入图片说明

Note the folder structure and where the Gemfile is located. Inside the Gemfile , there are several gems or plugins for the different software dependencies that are typically required in a new Rails app. Open the Gemfile and inspect the file and look for sqlite3. Modify the version number next to the sqlite3 to match '1.3.8' . Example:

gem 'sqlite3', '1.3.8'

EDIT:

I suggest uninstalling/removing all instances of sqlite3 and following these instructions:

  1. Ensure you have latest version of rubygems: gem update --system
  2. Uninstall sqlite3
  3. Install sqlite3: gem install sqlite3
  4. Check install version: gem list sqlite3
  5. Run rails new appappapp

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