Make a quick dump of a mysql database:
You can then read that dump file back into the server like this
or like this:
Make a quick dump of a mysql database:
You can then read that dump file back into the server like this
or like this:
operand | what it does |
---|---|
<< | append (in context of strings, arrays, IO); shift position of bits in Bignum and Fixnum |
>> | shift position of bits in Bignum and Fixnum |
~ | bitwise NOT (high-presendence) |
& | bitwise AND (medium-presendence) |
| | bitwise OR (medium-presendence) |
^ | bitwise XOR (medium-presendence) |
** | exponent |
+ | addition |
– | subtraction |
* | multiplication |
/ | division |
% | modulo operator |
(The -f flag keeps the tail process running and will show you anything that is written to your log file as it is written.)
You can see lots of info in the development log of course: all the actions that Rails is trying to render as well as all the SQL it is executing. Like I said above, use logger.debug to explicitly send stuff you want to see to this log.
This only works in controllers:
But this works everywhere:
(You might want to try this):
y myVar
* assigns Any objects that are stored as instance variables in actions for use in views.
* cookies Any cookies that are set.
* flash Any objects living in the flash.
* session Any object living in session variables.
Also, you can look at the response you’re getting with @response. Also keep in mind:
* @controller The controller processing the request
* @request The request
* @response The response
I like to use inspect on these, and surround them with big markers so that I can see them clearly when I’m running my test.
Using Mac ports
If you have an existing ImageMagick installed, you will get this error:
To remove the old version, try:
USING IMAGEMAGICK WITH PAPERCLIP WITH PASSENGER:
set this in config/initializers/paperclip.rb
1) be sure to put in your environment file (inside your initializer)
2) make sure your form_form has multipart set to true like this:
3) if using passenger, you must put this in config/initializers/paperclip.rb:
(Make sure your imagemagick binaries are really in /opt/local/bin/. You can type /opt/local/bin/convert -v to check. I would recommend the MacPorts installation of ImageMagick and re-install if you are unsure.)
4) If you’re having trouble getting it to generate thumbnails, try setting Paperclip.options[:log_commands] = true and see what it’s trying to run.
Sometimes you’re in script/console and you make a change to your model files, but since Ruby on reads the models when the environment loads, your change isn’t reflected right away in your script/console environment. This will explicitly tell Ruby to reload the environment from scratch. Unfortunately you’ll loose any local variables which were assigned too.
***** I think this syntax only works in controllers and outside of a controller you have to use rails_default_debugger ******
(where WHAT_TO_OUTPUT is a string or interpolated to be a string)
The log is in your rails app: log/development.log
A method defined on a model that ends with = is an assignment method, so when ActiveRecord is trying to save an attribute to this model, you can define a custom action to perform the save. Useful, for example, when passing a hash to this model for some list of things that is not part of active record.
When running Passenger (module for running Rails on Apache), the console log (output from puts) goes into the apache error log (see /var/log/apache2/error_log)