Re: [sqlite3-ruby] rails server => sqlite3-ruby problem => gem install activerecord-sqlite3-adapter

3,533 views
Skip to first unread message

Luis Lavena

unread,
Apr 21, 2013, 11:53:27 AM4/21/13
to sqlite...@googlegroups.com
Hello,

Please see below for my response...

On Sun, Apr 21, 2013 at 6:32 AM, satya kunal <satya...@gmail.com> wrote:
Hi,

I am using windows-7 64-bit OS.
After digging up several posts, finally I was able to install ruby, sqlite3 and rails.

But I am receiving below error while starting rails.
Error message::
>rails server
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/rubygems_integ
ration.rb:214:in `block in replace_gem': Please install the sqlite3 adapter: `ge
m install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add
it to Gemfile.) (LoadError)



The gem "sqlite3" is not in your Gemfile, please add it:

gem "sqlite3"

And then do "bundle check"

Please note that you're trying to use Ruby 2.0 in 64bits mode, so you might require to install and compile others gems too.

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

satya kunal

unread,
Apr 24, 2013, 1:37:06 PM4/24/13
to sqlite...@googlegroups.com
Hi Luis,

Thanks for your reply.

while adding sqlite gem to gemfile.
I am getting error as unknown command sqlite.
I am running below command from my application directory :: ****\MyApp>

>bundle check
The Gemfile's dependencies are satisfied

>bundle install
Using rake (10.0.4)
Using i18n (0.6.1)
Using multi_json (1.7.2)
Using activesupport (3.2.13)
Using builder (3.0.4)
Using activemodel (3.2.13)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.5)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.2)
Using tilt (1.3.7)
Using sprockets (2.2.2)
Using actionpack (3.2.13)
Using mime-types (1.23)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.5.3)
Using actionmailer (3.2.13)
Using arel (3.0.2)
Using tzinfo (0.3.37)
Using activerecord (3.2.13)
Using activeresource (3.2.13)
Using coffee-script-source (1.6.2)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.3)
Using json (1.7.7)
Using rdoc (3.12.2)
Using thor (0.18.1)
Using railties (3.2.13)
Using coffee-rails (3.2.2)
Using jquery-rails (2.2.1)
Using bundler (1.3.5)
Using rails (3.2.13)
Using sass (3.2.7)
Using sass-rails (3.2.6)
Using uglifier (2.0.1)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

content of gemfile::
source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'


Still starting server fails (rails server) with above mentioned error.

I do not have much experience over Ruby on Rails.
Please guide.

Thanks in advance.

Sarang Rao

unread,
Sep 25, 2013, 11:33:40 AM9/25/13
to sqlite...@googlegroups.com
Hi,
Were you able to resolve this? I'm stuck at the same point and can't find a resolution.

Thanks
Sarang

Luis Lavena

unread,
Sep 25, 2013, 11:35:56 AM9/25/13
to sqlite...@googlegroups.com
On Wed, Sep 25, 2013 at 12:33 PM, Sarang Rao <sara...@gmail.com> wrote:
Hi,
Were you able to resolve this? I'm stuck at the same point and can't find a resolution.

Thanks
Sarang


Have you added sqlite3 gem to your Gemfile and then done "bundle install"?

Can you provide information about version of Ruby, Rails and Bundler used?

ruby -v
rails -v
bundle -v

Sarang Rao

unread,
Sep 25, 2013, 11:41:53 AM9/25/13
to sqlite...@googlegroups.com
Hi Luis,
Yes sqlite3 is in the gemfile. Below is the content of the gem file

ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.0'

group :development do
  gem 'sqlite3', '1.3.8'
end

gem 'sass-rails', '4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.0'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end


Also the info you requested

$ ruby -v
ruby 2.0.0p195 (2013-05-14) [i386-mingw32]

$ rails -v
Rails 4.0.0

$ bundle -v
Bundler version 1.3.5

Appreciate your help

Sarang

Luis Lavena

unread,
Sep 25, 2013, 11:45:32 AM9/25/13
to sqlite...@googlegroups.com
Hello Sarang,

If the sqlite3 is in the bundle, can you confirm you're getting exactly the same error message?

Can you create a gist (http://gist.github.com/) with the output of "bundle install" and another gist with the contents of Gemfile.lock?



--
You received this message because you are subscribed to the Google Groups "sqlite3-ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlite3-ruby...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Sarang Rao

unread,
Sep 25, 2013, 11:58:18 AM9/25/13
to sqlite...@googlegroups.com
Hi Luis,
This is the error I get. When I run rails server the console doesnt show any error. When I click on "About your application environment" link on the screen I get the below error

LoadError (Could not load 'active_record/connection_adapters/sqlite3_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql', 'mysql2', 'postgresql' o
r 'sqlite3' add the necessary adapter gem to the Gemfile.):

Below are the links to the gists:

Thanks
Sarang

Sarang Rao

unread,
Sep 25, 2013, 12:07:47 PM9/25/13
to sqlite...@googlegroups.com
Hi Luis,
I actually get the error as soon as I go to the URL.

I created another gist with the startup log for you to look.

Thanks
Sarang

Luis Lavena

unread,
Sep 25, 2013, 12:09:25 PM9/25/13
to sqlite...@googlegroups.com

What are the contents of database.yml?

Sorry for top posting. Sent from mobile.

--

Sarang Rao

unread,
Sep 25, 2013, 12:11:54 PM9/25/13
to sqlite...@googlegroups.com

Sarang Rao

unread,
Sep 26, 2013, 9:44:25 AM9/26/13
to sqlite...@googlegroups.com
Hi Luis,
Just wanted to check with you if you had a chance to look at the files and see if you could identify the problem?

Thanks
Sarang

Luis Lavena

unread,
Sep 26, 2013, 12:11:44 PM9/26/13
to sqlite...@googlegroups.com
On Thu, Sep 26, 2013 at 10:44 AM, Sarang Rao <sara...@gmail.com> wrote:
Hi Luis,
Just wanted to check with you if you had a chance to look at the files and see if you could identify the problem?


I'm bafled that this is happening since I tested a few times and it worked.

Today going to setup a new installation and attempt to get the exact same gemfile running.

Will report later today.

Sarang Rao

unread,
Sep 26, 2013, 12:14:51 PM9/26/13
to sqlite...@googlegroups.com
Thanks Luis,
I'll wait for your response.
BTW, my windows environment is a 64 bit one. Not sure if that makes any difference.

Thanks
Sarang

Luis Lavena

unread,
Sep 26, 2013, 9:37:42 PM9/26/13
to sqlite...@googlegroups.com
On Thu, Sep 26, 2013 at 1:14 PM, Sarang Rao <sara...@gmail.com> wrote:
Thanks Luis,
I'll wait for your response.
BTW, my windows environment is a 64 bit one. Not sure if that makes any difference.


Hello Sarang,

I tried several times to replicate what you get, all without avail.

First, a bit of *my* environment:

Windows 7 x64 Ultimate

Prior installing Ruby, I have installed NodeJS:

C:\Users\Luis>node --version
v0.10.12

Next, I proceed to the installation of:

Ruby 2.0.0-p247 (from RubyInstaller website)

C:\Users\Luis>ruby -v
ruby 2.0.0p247 (2013-06-27) [i386-mingw32]

Installed DevKit (extracted DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe into C:\Ruby2000\devkit, executed dk.rb init and dk.rb install, as DevKit documentation says)

Then, I took your Gemfile, created a new directory and placed it there. Installed bundler (gem install bundler) and proceed to bundle all the gems (bundle install)

Once it completed, I executed:

C:\Users\Luis\Code\myapp>rails new . -d sqlite3

Which asked me to replace my Gemfile, and I said no.

After it completed, I was able to load the console, load the application and execute basic commands from the console:

irb(main):001:0> ActiveRecord::Base.connection.execute "SELECT 1+1"
   (1.0ms)  SELECT 1+1
=> [{"1+1"=>2, 0=>2}]

Just to confirm that is indeed using sqlite3 adapter:

irb(main):002:0> ActiveRecord::Base.connection.class
=> ActiveRecord::ConnectionAdapters::SQLite3Adapter

And the output of the server log was the following:


Compared to the output of your server execution:


It is clear that your application is not a Rails 4.0 application, or at least not fully migrated and updated the deprecations.

I did a comparison of the generated Gemfile locks, but there is nothing, which might indicate something at the code level that you aren't tell me.

Perhaps one of those settings is interfering and we don't know which one.

Might I suggest you create a new application in a different directory, with Rails 4.0 and test again?

Then perhaps you can compare the generated configuration files and see the differences.

Hope that helps.
-- 

Sarang Rao

unread,
Oct 1, 2013, 10:15:10 AM10/1/13
to sqlite...@googlegroups.com
Hi Luis,
Sorry about the late reply. I actually cleaned up my complete environment and reinstalled everything. Now it works without any issue.
Not sure what was wrong as the versions and path were showing up correct.
I have it working now.

Thanks for your help.

Thanks
Sarang
Reply all
Reply to author
Forward
0 new messages