Your Gemfile looks fine to me (in terms of sqlite).
I think we need someone with more Rails experience than me. I’m sure you’ll get some advice soon
P.S. I might try
gem install sqlite3 (perhaps with
gem uninstall sqlite3 first) and
bundle install again, just to see if that fixes it, but I have a feeling it won’t.
I get the same error. This sucks.
I’m here as I’m trying to help my wife who has just started to dig into TOP.
It shouldn’t be this hard to configure a simple dev environment.
I’m watching for any resolutions to this issue.
Having just tried to setup my own Mac with the guide here on TOP, this worked for me:
my_first_rails_app and change
gem 'sqlite3' to
gem 'sqlite3', '~> 1.3.6'
Save the file.
From Terminal, run
rails generate scaffold car make:string model:string year:integer then you should see something like
First Rails Application (Part 2.3) Error: rails generate scaffold car make:string model:string year:integer
Error rails db:migrate
I tried this and I got the same output as above, but when running the server with
rails server and opening the page http://localhost:3000/cars, I get the following error message:
Clearly I must be missing something.
First Rails Application
I am having issues with generating templates from Rails
Some success! I overcame the issue by running the command
rails db:migrate after:
Thanks @1stevengrant !!
You’re welcome. As I said, this exact thing put me off years ago and, in my humble opinion, why PHP is a language to learn as a beginner because it’s much simpler to setup.
When you say “Open the Gemfile inside my_first_rails_app”, what is the command to do that? I’m struggling to find an answer anywhere…lol. I’m VERY new at this. Thanks for your help.
Gem::LoadError: can’t activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0. Make sure all dependencies are added to Gemfile.
<top (required)>' /home/cesar/odin_on_rails/my_third_rails_app/bin/spring:15:in<top (required)>’
Tasks: TOP => db:migrate => db:load_config
(See full trace by running task with --trace)
@bbates22 the answer (as with most development things) is it depends. Are you on Mac, Linux or Windows?
You need to find that file in your code editor, open and edit it.
I’m using Xubuntu…it appears that sqlite3 may not have even installed w/ the bundler. Fascinating.
I think I may have figured it out. I’ll come back if I’m still stuck. Thank you!
I am working on a Mac and have not been able to find the file in my code editor. If you know the commands for this, it would be of great help! Thanks!
Nevermind, figured it out! Fixed my error, thanks man!
I’m using Ubuntu 18.04 and ran into the same problem but @1stevengrant’s solution also worked for me.
Hi @bbates22, I’m using Ubuntu and was able to edit the Gemfile by:
cdto enter the directory that the app is in (for me it was
ls -ato list the files in the directory and make sure the
xdg-open Gemfileto open the Gemfile (you may need to use a different command depending on your OS)
- in the Gemfile, use “ctrl+f” to locate
'sqlite3'and change it as @1stevengrant suggested
hope this helps
I opened the my_first_rails_app and have opened the gem file document. What specifically do I change?