Tagged Questions
3
votes
0answers
659 views
Use MariaDB instead of MySQL in my Rails project
How can I use MariaDB instead of MySQL in my Rails project?
When I try to install mysql2 gem it returns error,because mysqlclient was not found.
Here some solution, but I didn't found any ...
3
votes
0answers
482 views
Rails doesn't recreate mysql views in the test database, even when config.active_record.schema_format = :sql
We have some mysql Views in our development and test databases that were created via an execute(sql) statement in a migration. Rails' default schema.rb creates these views as tables. When ...
2
votes
0answers
584 views
Rails change column to mediumtext
I need to change a column from type TEXT to MEDIUMTEXT. As per this discussion: How to store long text to MySql DB using Rails?, I will need to specify a limit on size as half of the allowable range ...
2
votes
0answers
145 views
Batch inserts with resque
I am currently trying to set up a task that collects a bunch of objects, and then queues a background task to batch insert them to a database.. and then repeats.
I have been working a little bit ...
2
votes
0answers
408 views
Mysql server has gone away in rails when the database is in a faraway data center
We have two data centers located across the globe. if we run the rails app in one datacenter and point to the database located in the other data center. The app throws
MySQL server has gone away
...
1
vote
0answers
22 views
Trouble with loading a csv from a migration script in rails
When trying to load a csv from a migration script using something like this:
ActiveRecord::Base.connection.execute(
"load data local infile 'my_data.csv' into table my_table fields terminated by ...
1
vote
0answers
53 views
Rails 3 activerecord query where clause with timezone
I have a problem with my rails application (rails 3.2.x, MySQL 5.x). Sample case to produce:
set time_zone='Hanoi' in application.rb
model Post
new post created at 2013-06-28 01:00:00 (date of ...
1
vote
0answers
447 views
Can't connect to MySQL server on '127.0.0.1' (61)
This is really hard to explain and I have no clue why I am getting a 'database' error.
Can't connect to MySQL server on '127.0.0.1' (61) error
when I click to my link here after I start the ...
1
vote
0answers
131 views
Rails 3: “Schema migrations table does not exists yet”
So some months ago, for some reason I got a weird git message and was afraid to deploy. So I started making changes to the production application directly and trying to also manually make the same ...
1
vote
0answers
76 views
Is there a way to export partial data from MySQL to SQlite using rails/ruby?
I know that yaml_db gem can export the whole MySQL database into SQlite, but I have too many things and I only need some tables.
Is there an easy way to define which tables and which records to ...
1
vote
0answers
88 views
How to design bill table with dynamic bill details
I have different module such as painting, chasis_repair, over_oiling sections
Each module have seperate bill table for example painting_bills, chasis_repair_bills, over_oiling_bills
Now I have to ...
1
vote
0answers
71 views
how to store the session value in table in ruby on rails
i have an application in which books are sold. the customer add it to his cart and a session is created for that. now i want to add the items in cart to the order table so that admin can see what ...
1
vote
0answers
130 views
ActiveRecord with MySQL-Adapter: really slow INSERTs
A Rails 2 application has been upgraded to Rails 3.2.11. Everything runs just fine, except for one thing:
In production mode on two different servers with brand new hardware, MySQL INSERTs from ...
1
vote
0answers
100 views
Can't connect to MySQL for single dyno on restart occasionally
Every once in a while, when we either restart the app or a dyno gets cycled/restarted automatically, a dyno restarts but comes back up with Can't connect to MySQL server on (url) (110) error. In then ...
1
vote
0answers
139 views
An ActiveRecord has its `id` == nil after saving
It is really awkward that the id of an ActiveRecord is still nil after save.
My command in console is as follows:
irb(main):003:0> c = Comment.new
=> #<Comment id: nil, commentable_id: nil, ...