ruby-on-rails-4

db contianer is not started after moving data folder

可紊 提交于 2020-04-18 05:46:47
问题 So we had a problem with our Hard disk which contained the data folder for postgres after fixing the problem moved data folder into a new hard disk and change the docker_compose.yml we have following contents in the docker compose file db: image: postgres:9.4 volumes: - /mnt/hdd4/postgresql/data:/var/lib/postgresql/data - ./tmp:/tmp/docker ports: - "5432" now when I we try to start the db container I'm getting following error db_1 | db_1 | PostgreSQL Database directory appears to contain a

pg_dump issue in docker

柔情痞子 提交于 2020-04-11 06:27:53
问题 Here is my dockerfile and here is my docker-compose file. When I ran docker-compose run web rake db:migrate I got this err rake aborted! failed to execute: pg_dump -s -x -O -f /usr/src/app/db/structure.sql --schema=public --schema=partitioning docker_rails_dev Please check the output above for any errors and make sure that `pg_dump` is installed in your PATH and has proper permissions. /usr/local/bundle/gems/activerecord-4.2.7.1/lib/active_record/tasks/postgresql_database_tasks.rb:90:in `run

pg_dump issue in docker

半世苍凉 提交于 2020-04-11 06:26:07
问题 Here is my dockerfile and here is my docker-compose file. When I ran docker-compose run web rake db:migrate I got this err rake aborted! failed to execute: pg_dump -s -x -O -f /usr/src/app/db/structure.sql --schema=public --schema=partitioning docker_rails_dev Please check the output above for any errors and make sure that `pg_dump` is installed in your PATH and has proper permissions. /usr/local/bundle/gems/activerecord-4.2.7.1/lib/active_record/tasks/postgresql_database_tasks.rb:90:in `run

I cannot load my 'mysql2' gem.

主宰稳场 提交于 2020-03-25 19:14:46
问题 I am a beginner at Rails and when I typed in 'rails server' in Terminal, I received this error: Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). I am using OSX Yosemite 10.10.5. I've tried installing it: gem install mysql2 It still gave me the same error. I see that mysql2-0.4.0 is installed. Please help, thank you! 回答1: There is a bug in Rails 4.2.4 and previous, with

I cannot load my 'mysql2' gem.

别来无恙 提交于 2020-03-25 19:12:33
问题 I am a beginner at Rails and when I typed in 'rails server' in Terminal, I received this error: Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). I am using OSX Yosemite 10.10.5. I've tried installing it: gem install mysql2 It still gave me the same error. I see that mysql2-0.4.0 is installed. Please help, thank you! 回答1: There is a bug in Rails 4.2.4 and previous, with

Rails change column type and update column values

两盒软妹~` 提交于 2020-03-18 12:18:47
问题 I have a table called Users with a column Active that is type boolean. I will soon need to change the type of that column to string. I will also need to change all of the column values of Active from :true to "active" and :false to "inactive". To change the column type I would use Change a column type from Date to DateTime during ROR migration class ChangeColumnTypeInUsers < ActiveRecord::Migration def up change_column :users, :active, :string end def down change_column :users, :active,

Post returns 405 method not allowed

走远了吗. 提交于 2020-03-18 10:59:53
问题 I am having an issue with my Rails localhost Server, all Post calls started returning 405 method not allowed. However there are no problems on our staging and production servers . It is happening on all branches of code even ones that have not been updated. When debugging I see that it reaches the routes file but not the controller. I have tried removing my gems and reinstalling, switching from WEBrick to Pama, creating a new clone of my git project. Server Started POST "/assets" for ::1 at

Post returns 405 method not allowed

偶尔善良 提交于 2020-03-18 10:59:02
问题 I am having an issue with my Rails localhost Server, all Post calls started returning 405 method not allowed. However there are no problems on our staging and production servers . It is happening on all branches of code even ones that have not been updated. When debugging I see that it reaches the routes file but not the controller. I have tried removing my gems and reinstalling, switching from WEBrick to Pama, creating a new clone of my git project. Server Started POST "/assets" for ::1 at

No route matches [POST] “/sessions/new” (rails 4 in action)

混江龙づ霸主 提交于 2020-03-16 07:58:07
问题 I'm following the Rails 4 In action book and I'm running into the following error: No route matches [POST] "/sessions/new" I'm not sure why, as I've followed the tutorial to a T. Which leaves me to believe the tutorial itself is flawed. Anyhow, for some reason it's posting to sessions#new when it should be posting to sessions#create. What am I doing wrong? sessions_controller.rb class SessionsController < ApplicationController def new end def create user = User.where(:name => params[:signin][

How do you add a second column of 'children' without duplicating the 'parent' column entry in Active Admin?

霸气de小男生 提交于 2020-03-06 03:32:06
问题 This table, Raw Table with correct output, is the result I am looking for, but how do I translate this block of code into whatever Active Admin /app/admin/postal_code.rb index view requires to output the table correctly. Currently this block is rendered in a partial, /app/views/admin/postalcode/_showtable.html.erb <h1>Postal Code per Region</h1> <table> <tr> <th>Region</th> <th>Postal Code</th> </tr> <% @region.each do |region| %> <tr> <td><%= region.name %></td> <td> <table> <% list =