Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql error message with ruby on rails
    primarykey
    data
    text
    <p>I'm using the Lynda.com tutorial to learn Ruby on Rails. In Chapter 6, they go through creating a mysql database and then configuring it for Rails. After we create and configure the database, the instructor tests the connection with this command from the root of our rails application</p> <pre><code>rake db:schema:dump </code></pre> <p>which created a schema.rb file in the "db" folder of the rails application. </p> <p>However, for me, I got this error message when I ran the rake command</p> <pre><code>rake aborted! syntax error on line 18, col 2: ` socket: /tmp/mysql.sock' Tasks: TOP =&gt; db:schema:dump =&gt; db:load_config (See full trace by running task with --trace) </code></pre> <p>I tried to do <code>--trace</code> to check the error but it didn't do anything.</p> <p>My database.yml file (where we configured the database for rails) is the same as the instructors, except his uses <code>mysql</code> and mine says <code>mysql2</code> for the adapter attribute</p> <pre><code>development: adapter: mysql2 encoding: utf8 reconnect: false database: simple_cms_development pool: 5 username: simple_cms password: secretpassword socket: /tmp/mysql.sock &lt;&lt;---this is line 18 as referred to in error </code></pre> <p>Anyways, the error message said syntax error in line 18, but my line 18 is exactly the same as the instructors...</p> <p>Any ideas how I can fix this problem?</p> <p>UPDATE -- this command <code>rake db:schema:dump --trace</code> gave me this output</p> <pre><code>** Invoke db:schema:dump (first_time) ** Invoke db:load_config (first_time) ** Invoke rails_env (first_time) ** Execute rails_env ** Execute db:load_config rake aborted! syntax error on line 18, col 2: ` socket: /tmp/mysql.sock' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `load' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `load' /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/application/configuration.rb:100:in `database_configuration' /Library/Ruby/Gems/1.8/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:6 /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:176:in `invoke_prerequisites' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:174:in `each' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:157:in `invoke_with_call_chain' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run' /Library/Ruby/Gems/1.8/gems/rake-0.9.2/bin/rake:32 /usr/bin/rake:19:in `load' /usr/bin/rake:19 Tasks: TOP =&gt; db:schema:dump =&gt; db:load_config </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload