no such file to load -- sqlite3 WITH mysql2

And I've told you twice how to fix it. Seriously, WTF?

Steve Mills wrote in post #964810:

Colin Law wrote in post #964799:

I seriously suggest considering switching to Ubuntu (or similar). You would not regret it...

I am doing the tutorials in parallel on Ubuntu. Unfortunately the "test functionals" issue I mentioned above that started me down this path occurs there too.

My primary development platform has to be Windows I'm afraid - that's what my customers want - but I do as much as possible on Ubuntu as well. :slight_smile:

Your development environment is no concern of your customers. What do you mean by "that's what my customers want"? Why do you think you need to work on Windows? Remember, you're developing *server-side* applications here that have nothing to do with the client OS.

Best,

Marnen Laibow-Koser wrote in post #964825:

Your development environment is no concern of your customers. What do you mean by "that's what my customers want"? Why do you think you need to work on Windows? Remember, you're developing *server-side* applications here that have nothing to do with the client OS.

That's true for just this one aspect of development. I also use OutSystems which runs on Windows, .NET which requires Windows, Prolog which runs best on Windows, and build free-standing apps that target Windows, I build Fusion:Gen apps where the case tools run on Windows, and Android apps where the tools that I use are Windows based.

But I guess this is wandering off the point of this thread :slight_smile:

Hassan Schroeder wrote in post #964823:

The line above is *wrong* -- look at your config/database.yml entries and compare. That is simply not a valid MySQL entry.

I know that line is wrong - Rails tells me that - what I don't know is how to fix it, or even why the store.rb file exists at all in the app folder.

And I've told you twice how to fix it. Seriously, WTF?

-- Hassan Schroeder ------------------------ hassan.schroeder@gmail.com twitter: @hassan

I have followed the advice but it didn't help...

Database.yml contains entries like:-

development:   adapter: mysql2   encoding: utf8   reconnect: false   database: depot_v_development   pool: 5   username: <uname>   password: <pw>   host: localhost

which is a database specification broken into multiple elements.

Clearly what is required is a single parameter which specifies the database, something like, localhost:<uname>@<pw>/depot_v_development

Unfortunately I don't know the required syntax and database.yml doesn't provide it.

So yes, the advice appears good, but for me it's incomplete.

If I delete that section of code then the db:migrate works. So now I'm going to see if everything else still works with it deleted.

I'll report back.

Steve Mills wrote in post #964833:

Marnen Laibow-Koser wrote in post #964825:

Your development environment is no concern of your customers. What do you mean by "that's what my customers want"? Why do you think you need to work on Windows? Remember, you're developing *server-side* applications here that have nothing to do with the client OS.

That's true for just this one aspect of development. I also use OutSystems which runs on Windows, .NET which requires Windows, Prolog which runs best on Windows, and build free-standing apps that target Windows,

Well, Rails runs best on a *nix system. I highly recommend at least a VM.

I build Fusion:Gen apps where the case tools run on Windows, and Android apps where the tools that I use are Windows based.

Uh...WTF? Android development is not platform-specific.

Besides, the less you use Windows, the better. If your tools are tying you to Windows, you really need better tools.

But I guess this is wandering off the point of this thread :slight_smile:

Slightly. But you seem to be under a misapprehension as to how much you *need* to use Windows.

Best,

Uh, "clearly"? Actually, "clearly" that's not true -- and which would be quite "clear" if you read the documentation for the method in question:

   ActiveRecord::Base.establish_connection

which, at least in the 2.3.8 version I just glanced at, has examples for both SQLite and MySQL...

Hassan Schroeder wrote in post #964841:

Are you using fixtures? I think most now would advise against fixtures, suggesting factories instead. See #158 Factories not Fixtures - RailsCasts for example. So if you can't get fixtures to work (or even if you can) then forget them and move to something better.

Colin

Colin Law wrote in post #964874:

[...] Following the book, and creating my own project, I don't encounter this problem. But I do encounter a serious problem on "test functionals" where the db tables are created, seeded, and then promptly dropped prior to the first test running so all the tests fail. The application itself works fine.

Are you using fixtures? I think most now would advise against fixtures, suggesting factories instead. See #158 Factories not Fixtures - RailsCasts for example. So if you can't get fixtures to work (or even if you can) then forget them and move to something better.

Agreed. Also forget about functional tests and use Cucumber instead. In fact, forget about Test::Unit and go for RSpec.

The Rails core team made a wonderfully testable framework, but provided poor testing tools to actually do that testing.

Colin

Best,

Colin Law wrote in post #964874:

The tutorial at http://railstutorial.org/ is good and uses factories and rspec if I remember correctly. I think you can buy the book or work through it online for free.

Colin Colin