1

I'm a Ruby on Rails newbie, and am having some trouble. Currently I'm following a video guided course on beginning RoR app development.

I'm using Aptana Studio 3 on Windows 7, Ruby 2.2 and Rails 4.2. x64 machine and Windows, but 32-bit Ruby and DevKit installs. I installed Rails by typing gem install rails at the CLI.

I seem to not be able to create a basic model, as it causes an error which is as follows after attempting the command rails g model Company:

C:/Ruby22/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in require: cannot load such file -- sqlite3/sqlite3_native (LoadError)
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in block in require
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in load_dependency
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in require
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10-x86-mingw32/lib/sqlite3.rb:6:in rescue in <top (required)>
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10-x86-mingw32/lib/sqlite3.rb:2:in <top (required)>
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:76:in require
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:76:in block (2 levels) in require
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:72:in each
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:72:in block in require
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:61:in each
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler/runtime.rb:61:in require
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.8.4/lib/bundler.rb:134:in require
from C:/Ruby22/timetracker/config/application.rb:7:in <top (required)>
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:141:in require
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:141:in require_application_and_environment!
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:128:in generate_or_destroy
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:50:in generate
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in run_command!
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in <top (required)>
from bin/rails:4:in require
from bin/rails:4:in <main>`

I did some Googling, and saw that for many people, editing the s.require_paths value in the sqlite3 gemspec file did the trick, so I tried that. I changed the value from s.require_paths = ["lib"] to s.require_paths = ["lib/sqlite3_native"]. That appears to have solved one issue and brought up another. Now when trying to run the same model creation command, I get a different error:

C:/Ruby22/lib/ruby/gems/2.2.0/gems/web-console-2.1.1/lib/web_console/railtie.rb:32:in block in <class:Railtie>: uninitialized constant WebConsole::Railtie::Middleware (NameError)
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in instance_exec
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in run
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:55:in block in run_initializers
from C:/Ruby22/lib/ruby/2.2.0/tsort.rb:226:in block in tsort_each
from C:/Ruby22/lib/ruby/2.2.0/tsort.rb:348:in block (2 levels) in each_strongly_connected_component
from C:/Ruby22/lib/ruby/2.2.0/tsort.rb:429:in each_strongly_connected_component_from
from C:/Ruby22/lib/ruby/2.2.0/tsort.rb:347:in block in each_strongly_connected_component
from C:/Ruby22/lib/ruby/2.2.0/tsort.rb:345:in each
from C:/Ruby22/lib/ruby/2.2.0/tsort.rb:345:in call
from C:/Ruby22/lib/ruby/2.2.0/tsort.rb:345:in each_strongly_connected_component
from C:/Ruby22/lib/ruby/2.2.0/tsort.rb:224:in tsort_each
from C:/Ruby22/lib/ruby/2.2.0/tsort.rb:203:in tsort_each
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:54:in run_initializers
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:352:in initialize!
from C:/Ruby22/timetracker/config/environment.rb:5:in <top (required)>
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:328:in require_environment!
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:142:in require_application_and_environment!
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:128:in generate_or_destroy
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:50:in generate
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in run_command!
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in <top (required)>
from bin/rails:4:in require
from bin/rails:4:in <main>

The gems I'm using outside of what is generated by default in my Gemfile are as follows:

gem devise
gem will_paginate
gem thin

Of course, the gem names have single quotes around them in my actual file, but I removed them due to the formatting of this site. It seems that particular error can mean a number of things after doing quite a bit of searching, and I'm a bit too new to Ruby debugging to know where to look next.

Any help in determining what is actually the culprit here, or any advice on what to try would be sincerely appreciated.

If any other technical details are needed, please ask and I'll upload the information here.

Thanks in advance!

Paweł Dawczak
  • 9,519
  • 2
  • 24
  • 37
trebleCode
  • 2,134
  • 19
  • 34
  • Can you try reinstalling Rails with `gem install rails` and then run `bundle install`? – Beartech Mar 11 '15 at 02:26
  • I think it can help you http://stackoverflow.com/questions/17643897/cannot-load-such-file-sqlite3-sqlite3-native-loaderror-on-ruby-on-rails – Arvind Mar 11 '15 at 08:35

0 Answers0