This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rails server -e production | |
=> Booting WEBrick | |
=> Rails 3.0.0.beta application starting in development on http://0.0.0.0:3000 | |
=> Call with -d to detach | |
=> Ctrl-C to shutdown server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bundle install | |
Fetching source index from http://rubygems.org/ | |
No compatible versions could be found for required dependencies: | |
Conflict on: "mongo": | |
* mongo (1.0.1) activated by plucky (= 0.1.2, runtime) | |
* mongo (= 0.15, runtime) required by mongo_mapper (>= 0, runtime) | |
All possible versions of origin requirements conflict. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bundle install | |
Fetching source index from http://rubygems.org/ | |
No compatible versions could be found for required dependencies: | |
Conflict on: "mongo": | |
* mongo (1.0.1) activated by mongo (= 1.0.1, runtime) | |
* mongo (= 0.15, runtime) required by mongo_mapper (>= 0, runtime) | |
All possible versions of origin requirements conflict. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Is: | |
<h1><img src="logo.png" alt="My Site Title" /></h1> | |
equivalent to: | |
<h1>My Site Title</h1> | |
in Google's eyes? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check process delayed_job_0 | |
with pidfile /home/poligraft/www/current/tmp/pids/delayed_job.0.pid | |
start program = "/bin/bash -c 'cd /home/poligraft/www/current/ && /usr/bin/env RAILS_ENV=production script/delayed_job start -i 0'" | |
as uid poligraft and gid poligraft | |
stop program = "/bin/bash -c 'cd /home/poligraft/www/current/ && /usr/bin/env RAILS_ENV=production script/delayed_job stop -i 0'" | |
as uid poligraft and gid poligraft | |
check process delayed_job_1 | |
with pidfile /home/poligraft/www/current/tmp/pids/delayed_job.1.pid | |
start program = "/bin/bash -c 'cd /home/poligraft/www/current/ && /usr/bin/env RAILS_ENV=production script/delayed_job start -i 1'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`pidof delayed_job.0 | xargs kill -9` if `pidof delayed_job.0` != `cat pids/delayed_job.0.pid` | |
`pidof delayed_job.1 | xargs kill -9` if `pidof delayed_job.1` != `cat pids/delayed_job.1.pid` | |
`pidof delayed_job.2 | xargs kill -9` if `pidof delayed_job.2` != `cat pids/delayed_job.2.pid` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gemfile | |
source 'http://rubygems.org' | |
gem 'rails', '>= 3.0.0.rc2' | |
gem 'json' | |
gem 'nokogiri' | |
gem 'calais' | |
gem 'bson' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a new Twitter app on Twitter.com - I called mine "Utwilities" and plan to use it for everything | |
# Get the Consumer Key and Consumer Secret from the app page | |
oauth = Twitter::OAuth.new('consumer key', 'consumer secret') | |
request = oauth.request_token | |
request_token = request.token | |
# Go to: http://twitter.com/oauth/authorize?oauth_token=#{request_token}&oauth_callback=oob | |
# That will give you the PIN | |
access = oauth.authorize_from_request(request.token, request.secret, 'THE_PIN') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Able to load bson_ext version 1.0.4, but >= 1.0.7 is required. | |
**Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance. | |
You can install the extension as follows: | |
gem install bson_ext | |
If you continue to receive this message after installing, make sure that the | |
bson_ext gem is in your load path and that the bson_ext and mongo gems are of the same version. | |
*** Exception NoMethodError in PhusionPassenger::Rack::ApplicationSpawner (undefined method `put_binary' for #<BSON::ByteBuffer:0x103f4fa20>) (process 323): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in mongoid.yml, set autocreate_indexes: true so that the index is created dynamically | |
$ bin/rails c | |
Loading development environment (Rails 3.0.0) | |
irb(main):001:0> class Person | |
irb(main):002:1> include Mongoid::Document | |
irb(main):003:1> field :name | |
irb(main):004:1> field :email | |
irb(main):005:1> index :name | |
irb(main):006:1> end |