Browsing all articles in Ruby

Kansas City Ruby Users: Ryan Smith on Heroku

Posted Posted by Wes in Kansas City Ruby User Group, Ruby, Ruby on Rails, Videos     Comments 2 comments
Mar
12

Ryan Smith presents to the Kansas City Ruby Users Group on Heroku: why it’s wonderful for deploying Ruby on Rails applications, how to set up a new application and deploy it to Heroku in minutes, and how to use Heroku add-ons to support search.

Kansas City Ruby Users Group | March 2010 | Ryan Smith | Heroku | kcrug.org from Wes Garrison on Vimeo.

Installing sqlite headers on ubuntu (sqlite3.h not found)

Posted Posted by Wes in Ruby, Ruby on Rails     Comments 9 comments
Mar
5

I was setting up Integrity for the first time and ran into this on my server when bundling gems:

~$ bundle install
...
Installing do_sqlite3 (0.10.0) from rubygems repository at
  http://gemcutter.org/ with native extensions
  /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:482:in
  `build_extensions':
ERROR: Failed to build gem native extension.
  (Gem::Installer::ExtensionBuildError)

/usr/bin/ruby1.8 extconf.rb
checking for sqlite3.h... no
*** extconf.rb failed ***
...

The key is the line: checking for sqlite3.h... no
The do_sqlite3 gem gets compiled natively, but the development headers weren’t installed on the system and so the compilation won’t work.

Install them:

~$ sudo apt-get install sqlite3
~$ sudo apt-get install libsqlite3-dev

Then, re-bundle:

~$ bundle install

Kansas City Ruby User Group: Kyle J Ginavan on Progressive Enhancement

Posted Posted by Wes in Kansas City Ruby User Group, Ruby, Ruby on Rails, Videos     Comments No comments
Feb
12

Presentation: Kyle Ginivan on Progressive Enhancement

Progressive enhancement is a strategy for web design that emphasizes accessibility, semantic markup, and external stylesheet and scripting technologies. Progressive enhancement uses web technologies in a layered fashion that allows everyone to access the basic content and functionality of a web page, using any browser or Internet connection, while also providing those with better bandwidth or more advanced browser software an enhanced version of the page.
read more

Clearing a stuck POP mailbox with Ruby Net::Telnet

Posted Posted by Wes in Ruby     Comments No comments
May
18

A client’s mailbox was full. Outlook tried to download all messages before deleting them, and I don’t know a setting to make it retrieve/delete a set number.
read more

RubyGems error on update: undefined local variable or method `remote_gemspecs'

Posted Posted by Wes in Ruby     Comments 4 comments
Nov
23

I updated rubygems:

>sudo gem update --system
Password:
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.3.1
ERROR:  While executing gem ... (NameError)
    undefined local variable or method `remote_gemspecs' for
   #<gem ::Commands::UpdateCommand:0x14df818>

… but received this error:

undefined local variable or method `remote_gemspecs'

Reading the release notes prompted me to install the rubygems-update gem separately:

>sudo gem install rubygems-update
Successfully installed rubygems-update-1.3.1

Finally, run the update_rubygems command to actually update:

>sudo update_rubygems
Installing RubyGems 1.3.1
mkdir -p /usr/local/lib/ruby/site_ruby/1.8
mkdir -p /usr/local/bin
install -c -m 0644 rbconfig/datadir.rb /usr/local/lib/ruby/site_ruby/1.8/rbconfig/datadir.rb
.... more installation

> gem -v
1.3.1

Finally!

Rake list tasks

Posted Posted by Wes in Ruby, Ruby on Rails     Comments 1 comment
Aug
3

I can never remember the exact name of a rake task, so I use this all the time:

> rake -T

You can also filter the list of tasks that’s shown. For instance, if you only want to see the database tasks:

> rake -T db

The -T option is handy when you just need to remember the exact wording. It’s not so handy when you’re trying to figure out what the rake task list description is. For that, use -D:

> rake -D
....
rake test:units
    Run tests for units / Run the unit tests in test/unit
....

The output is longer, but you can see the full description. You can also filter by the task name to limit the output so you don’t have to scroll through the full list of tasks.

On Rails 2.1.0, here’s the full rake -T output:

rake db:abort_if_pending_migrations  # Raises an error if there are pending...
rake db:charset                      # Retrieves the charset for the curren...
rake db:collation                    # Retrieves the collation for the curr...
rake db:create                       # Create the database defined in confi...
rake db:create:all                   # Create all the local databases defin...
rake db:drop                         # Drops the database for the current R...
rake db:drop:all                     # Drops all the local databases define...
rake db:fixtures:identify            # Search for a fixture given a LABEL o...
rake db:fixtures:load                # Load fixtures into the current envir...
rake db:migrate                      # Migrate the database through scripts...
rake db:migrate:redo                 # Rollbacks the database one migration...
rake db:migrate:reset                # Resets your database using your migr...
rake db:reset                        # Drops and recreates the database fro...
rake db:rollback                     # Rolls the schema back to the previou...
rake db:schema:dump                  # Create a db/schema.rb file that can ...
rake db:schema:load                  # Load a schema.rb file into the database
rake db:sessions:clear               # Clear the sessions table
rake db:sessions:create              # Creates a sessions migration for use...
rake db:shell                        # Launches the database shell using th...
rake db:structure:dump               # Dump the database structure to a SQL...
rake db:test:clone                   # Recreate the test database from the ...
rake db:test:clone_structure         # Recreate the test databases from the...
rake db:test:prepare                 # Prepare the test database and load t...
rake db:test:purge                   # Empty the test database
rake db:version                      # Retrieves the current schema version...
rake doc:app                         # Build the app HTML Files
rake doc:clobber_app                 # Remove rdoc products
rake doc:clobber_plugins             # Remove plugin documentation
rake doc:clobber_rails               # Remove rdoc products
rake doc:plugins                     # Generate documentation for all insta...
rake doc:rails                       # Build the rails HTML Files
rake doc:reapp                       # Force a rebuild of the RDOC files
rake doc:rerails                     # Force a rebuild of the RDOC files
rake log:clear                       # Truncates all *.log files in log/ to...
rake notes                           # Enumerate all annotations
rake notes:fixme                     # Enumerate all FIXME annotations
rake notes:optimize                  # Enumerate all OPTIMIZE annotations
rake notes:todo                      # Enumerate all TODO annotations
rake rails:freeze:edge               # Lock to latest Edge Rails or a speci...
rake rails:freeze:gems               # Lock this application to the current...
rake rails:unfreeze                  # Unlock this application from freeze ...
rake rails:update                    # Update both configs, scripts and pub...
rake rails:update:configs            # Update config/boot.rb from your curr...
rake rails:update:javascripts        # Update your javascripts from your cu...
rake rails:update:scripts            # Add new scripts to the application s...
rake routes                          # Print out all defined routes in matc...
rake secret                          # Generate a crytographically secure s...
rake stats                           # Report code statistics (KLOCs, etc) ...
rake test                            # Test all units and functionals
rake test:functionals                # Run tests for functionalsdb:test:pre...
rake test:integration                # Run tests for integrationdb:test:pre...
rake test:plugins                    # Run tests for pluginsenvironment / R...
rake test:recent                     # Run tests for recentdb:test:prepare ...
rake test:uncommitted                # Run tests for uncommitteddb:test:pre...
rake test:units                      # Run tests for unitsdb:test:prepare /...
rake tmp:cache:clear                 # Clears all files and directories in ...
rake tmp:clear                       # Clear session, cache, and socket fil...
rake tmp:create                      # Creates tmp directories for sessions...
rake tmp:pids:clear                  # Clears all files in tmp/pids
rake tmp:sessions:clear              # Clears all files in tmp/sessions
rake tmp:sockets:clear               # Clears all files in tmp/sockets

blog Categories

about databasically

We live and work in Kansas City, USA.

We're passionate about helping small businesses succeed and want to help you use technology to get more done.

From server, desktop, network management to programming custom web applications in Ruby on Rails, we're here to lend a hand.

Contact us if you have any questions!