I get this error message when running rake db:create
Could not find gem 'sqlite3 (>= 0, runtime)' in any of the gem sources listed in your Gemfile.
Any ideas on what I should do?
Open Gemfile from the root of your Rails application
Add this line gem 'sqlite3-ruby', :require => 'sqlite3'
run bundle install
run rake db:create
I'm totally new to Rails development, but I had this same problem this week. Eventually, I replaced the line gem 'sqlite-ruby, :require => 'sqlite3' with gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3' (in the Gemfile)
I had to do this because I'm running Mac OS 10.5.8 rather than 10.6
Maybe that will help.
Related
Here is a link to my screen cap. http://imgur.com/bbLud (SO doesn't allow noobs to post pics)
The problem.
Trying to bundle install and it keeps throwing the 'this version requires a different version of bundler' error. So I uninstall the current version, check my versions of bundler and it still appears. I go to uninstall it again and it tell me it doesn't exist. Can someone please lend a thought.
EDIT: Contents of Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', '1.0.0', :require => 'sqlite3'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
Try to manually install bundler 1.0.0 using gem install bundler --version "1.0.0" and then run again bundle install.
UPDATE: Looking at the screenshot in the other answer it seems you already have bundler 1.0.0, BTW give it a try anyway. It seems the bundle command still points to the newer version, what do you get if you run bundle -v?
The error is at it says in the screenshot, you are using rails 3.0.1.
do uninstall without version
gem uninstall bundler
it will ask you which version you want to remove then remove it, select 1.3.1 to uninstall, do a bundle install again and if it still shows error post it back here.
I have read tutorials and several stack overflow posts that suggest I should use
gem 'ruby-debug19', "~> 0.11.6"
or
gem 'ruby-debug19', :require => 'ruby-debug', :platforms => :mri_19
gem 'ruby-debug', :platforms => :mri_18
After doing a bundle install, I attempt to use this by executing
rails s --debugger
and get the error message
"You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug' Exiting
if I type
gem install ruby-debug
I get: ERROR: Error installing ruby-debug:
rbx-require-relative requires Ruby version ~> 1.8.7.
gem install ruby-debug19
does execute, but still the error message above is reported when I attempt to start the server.
I must be missing something obvious, because there are no other comments on the original stack overflow question.
thanks for any help!
Just put the line gem 'ruby-debug19', :require => 'ruby-debug' in your Gemfile should do. Then run bundle install
For the past few months I've been learning and coding successful apps and websites in RoR, I recently upgraded from rails 3.0.9 to rails 3.1.1 and since then I can't get sqlite3 to work, I'm guessing because OSX 10.5.8.
Can anyone please assist with this problem as it's kinda' putting a dint in my learning and stopping my Rails progress. (Many thanks in advance if anyone can help with this problem)
I have searched all over the internet and Google and found several possible solutions to this problem but none have helped so far, I have also browsed the Rails forums and found someone with a similar problem but again no one posted replies on how to solve it. Please find specific details below:
Link to rails forums where someone has the exact same problem:
http://railsforum.com/viewtopic.php?pid=146751#p146751
command :
$ rake db:create
Error message:
Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.)
/Users/rubyadmin/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in `rescue in establish_connection'
/Users/rubyadmin/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:68:in `establish_connection'
When I try to gem install activerecord-sqlite3-adapter I get the following error:
ERROR: Could not find a valid gem 'activerecord-sqlite3-adapter' (>= 0) in any repository
I seems to be caused by the following SQLite version which as far to my knowledge is the only one which works on this version of MAC OSX:
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
If anyone can help with this problem I'd be extremely grateful.
Gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.1'
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
gem 'will_paginate'
group :development do
gem 'rspec-rails'
gem 'annotate'
end
group :test do
gem 'rspec-rails'
gem 'webrat'
gem 'spork'
end
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
When gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3' is changed to gem 'sqlite3' i get the following errors:
MHcomp-2:test_app rubyadmin$ rake db:create dyld: lazy symbol binding failed: Symbol not found: _sqlite3_open_v2 Referenced from: /Users/rubyadmin/.rvm/gems/ruby-1.9.3-p0/gems/sqlite3-1.3.4/lib/sqlite3/sqlite3_native.bundle Expected in: flat namespace dyld: Symbol not found: _sqlite3_open_v2 Referenced from: /Users/rubyadmin/.rvm/gems/ruby-1.9.3-p0/gems/sqlite3-1.3.4/lib/sqlite3/sqlite3_native.bundle Expected in: flat namespace
Fixed, if anyone needs help with this it's a curl problem with mac.
sudo port -f upgrade curl +ssl
fixed the issue I was having.
Replace. "gem 'sqlite3-ruby', '1.2.5'. :require => 'sqlite3' "
with
gem 'sqlite3'
Then run "bundle update"
Have you try to remove this bundle?
sudo rm -f /Users/rubyadmin/.rvm/gems/ruby-1.9.3-p0/gems/sqlite3-1.3.4/lib/sqlite3/sqlite3_native.bundle
I'm a beginner programmer and I'm trying to run the Rails Server through my command line. I type in "rails server" in my command line, and receive this error:
Could not find gem 'sqlite3-ruby (= 1.2.5, runtime)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
After receiving this error, I run 'bundle install'. Once I run 'bundle install', I type in "rails server" in my command line and receive the same error:
Could not find gem 'sqlite3-ruby (= 1.2.5, runtime)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
Here's a copy of my GemFile:
source 'http://rubygems.org'
gem 'rails', '3.0.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
Can someone help me get my rails server up and running? Thanks!
try deleting the "1.2.5" in your gemfile so the line looks like:
gem 'sqlite3-ruby', :require => 'sqlite3'
then run
bundle install
again
I think I once got this error a long time ago - it had something to do with having sqlite.dll in my bin or lib folder in my computer's ruby dir or something like that. I think Michael Hartl's tutorial mentions something about it.
Have you tried just
gem 'sqlite3'
You might also want to confirm that your gem is properly installed in your environment:
gem list
You can also get more information about a specific gem:
gem specification sqlite3-ruby
I am assuming that you have no issues with installing other gems - that is, you don't need to set up a http_proxy environment variable for bundle install.
I ran a bundle install on my Gemfile recently, and tried to rake:db:migrate. This migration didn't work, and outputs:
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method SampleApp::Application#task called at /Users/joshuaballoch/.rvm/gems/ruby-1.9.2-p180#rails3tutorial3/gems/railties-3.0.3/lib/rails/application.rb:214:in `initialize_tasks'
I read on another post that I should uninstall 0.9.1, but for some reason some gem I have requires 0.9.1 after the uninstall, so I don't know how to fix this. Any suggestions?
FYI my gemfile is:
source 'http://rubygems.org'
gem 'rails', '3.0.3'
gem 'sqlite3-ruby', '1.3.2', :require => 'sqlite3'
gem 'gravatar_image_tag', '1.0.0.pre2'
gem 'will_paginate', '3.0.pre2'
group :development do
gem 'rspec-rails', '2.3.0'
gem 'annotate-models', '1.0.4'
gem 'faker', '0.3.1'
end
group :test do
gem 'rspec', '2.3.0'
gem 'webrat', '0.7.1'
gem 'factory_girl_rails', '1.0'
end
Have you tried running it like so: bundle exec rake db:migrate
the bundle exec command runs your request in the environment defined by the bundle, so if your global gems differ this may help.
If not, you can add gem "rake", "0.8.7" to your gemfile, bundle install then try again. Your other dependency should still be met as you aren't removing 0.9.1, just asking bundle exec to use a different version.
Rails 3.0.8 was released yesterday, and includes "Fixing Rake 0.9.x integration". Worth a try.