Author Archive
Rails 3 Finally
by Matt on Jul.08, 2010, under Ruby on Rails
To setup a new rails 3 app with cucumber, no prototype and mysql database using ruby 1.9.2
This guide assumes you have ruby 1.9.2, rubygems and bundler gem installed
[msimpson@dakota ~] $ mkdir rails3 [msimpson@dakota ~] $ cd rails3 [msimpson@dakota rails3] $ git clone git://github.com/rails/rails.git rails3 . [msimpson@dakota rails3] (master) $ ruby bin/rails new /path/to/my/new/app --dev -d mysql -J [msimpson@dakota rails3] $ cd /path/to/my/new/app
Open and edit Gemfile so that it looks like this:
source 'http://rubygems.org' gem 'rails', :path => '/Users/mattsimpson/Projects/_resources/Code/Rails3' gem 'arel', :git => 'git://github.com/rails/arel.git' gem 'mysql' group :cucumber do gem 'cucumber-rails' gem 'cucumber' gem 'factory_girl' gem 'webrat' gem 'ruby-debug19' end
Install your gems
[msimpson@dakota rails3] $ bundle install
Install Cucumber with webrat and test unit
[msimpson@dakota rails3] $ rails generate cucumber:install --webrat --testunit
Open and edit config/database.yml and create your database by running the following:
[msimpson@dakota app] $ rake db:create:all
You are good to go!
Originally I was having troubles with rake test and rake cucumber, but after recreating my rails app this way it all worked great. Hope it works for you.
Rails 3 Updates
by Matt on Jul.07, 2010, under Ruby on Rails
In this I will explore and solve issues I had in upgrading rails 3 to the latest rails 3 version.
Following the rails 3 update saga continues. After taking a break to make some leaps in the design process on an application, I came back to programming the app. After writing some cucumber tests I received a series of deprecated messages. One thing I would like to note is that rails 3 is very good at letting you know what is going on and what you need to do. Let’s get started:
My gemfile for cucumber looks like this:
group :cucumber do gem 'capybara' gem 'database_cleaner' gem 'cucumber-rails' gem 'cucumber' gem 'spork' gem 'launchy' # So you can do Then show me the page gem 'factory_girl' gem 'webrat' end
When I tried to run my cucumber test I got this message: ”undefined method `config’ for nil:NilClass (NoMethodError)”
So I updated my gems via bundle:
[msimpson@dakota Code] $ bundle install
and I got the message:
No compatible versions could be found for required dependencies: Conflict on: "bundler": * bundler (0.9.25) activated by bundler (= 0.9.25, runtime) * bundler (>= 1.0.0.beta.2, runtime) required by rails (>= 0, runtime) All possible versions of origin requirements conflict.
so I installed the new bundler
[msimpson@dakota Code] $ sudo gem install bundler -v 1.0.0.beta.2
reran the cucumbers and got this:
Rails 3 doesn't officially support Ruby 1.9.1 since recent stable releases have segfaulted the test suite. Please upgrade to Ruby 1.9.2 before Rails 3 is released! You're running ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10.3.0]so I noticed I needed to install the new ruby 1.9.2 release candidate. Since I use rvm I had to update rvm, remove my old ruby 1.9.2, re-install it and reinstall bundler:
[msimpson@dakota Code] $rvm update [msimpson@dakota Code] $rvm reload [msimpson@dakota Code] $rvm remove 1.9.2 [msimpson@dakota Code] $rvm install 1.9.2 [msimpson@dakota Code] $rvm use 1.9.2 [msimpson@dakota Code] $sudo gem install bundler -v 1.0.0.beta.2 [msimpson@dakota Code] $ bundle installI didn't get all the way through but I'm pretty sure I got closer
, currently I'm working on getting cucumber to install and run. Hope this helps, if anyone gets any further let me know.
Rails 3 update
by Matt on May.25, 2010, under Ruby on Rails
I’ve had to revert from ruby 1.9.2-preview to ruby 1.9.1 p378.
[msimpson@dakota Code] (master) $ rvm install 1.9.1
[msimpson@dakota Code] (master) $ rvm use 1.9.1
Install rails 3 with the new ruby install
[msimpson@dakota Code] (master) $ sudo gem install rails --prerelease
Create a new rails app using mysql
[msimpson@dakota Code] (master) $ rails myapp --edge -d mysql
Now you will be able to create your db and start your app
[msimpson@dakota Code] (master) $ rake db:create:all [msimpson@dakota Code] (master) $ rails server
Yay!! Rails 3, here we go!
Starting Rails 3 with Ruby 1.9.2
by Matt on May.22, 2010, under Ruby on Rails
[msimpson@dakota Code] (master) $ rvm install 1.9.2 [msimpson@dakota Code] (master) $ rvm use 1.9.2
[msimpson@dakota Code] (master) $ irb
> RUBY_VERSION
=> "1.9.2"
> hash = { :first => "the first value", :second => "the second value" }
=> {:second=>"the second value", :first=>"the first value"}
> hash.each_with_index.collect{|array, index| "key: #{array[0]} | value: #{array[1]} | index: #{index}"}
=> ["key: second | value: the second value | index: 0", "key: first | value: the first value | index: 1"]
[msimpson@dakota Code] (master) $ sudo gem install rails --prerelease
[msimpson@dakota Code] (master) $ rails . --edge
Linux Media Server – The Groundwork
by Matt on Apr.26, 2010, under Media
What I’m Looking For
Use
Management
Accessibility
Growth
Firefly
Features
- Unix or Linux, Windows (Beta), and soon to support Mac OSX
- OGG, FLAC, Apple Lossless, WMA (Beta) and streaming radio stations
- Configurable for web access
- Smart playlists (Beta), iTunes Playlists
- iTunes
- Active community
- Open Source, it’s free!
Accommodation
Draw backs / Things to consider
Above and Beyond
MediaTomb
Features
- Uses UPnP
- mp3, ogg, flac, jpeg, etc. files.
- Meta extraction
- Thumbnail support
- Both audio and video support
- Automatic directory rescans
- Plugin support
- Web UI
- Supports external URL’s for internet sources
- Custom scripting capabilities
- Support for Linux, FreeBSD, Mac OS X
Accommodation
Draw backs / Things to consider
Above and Beyond
I am looking forward to trying the two out, if you have any recommendations please throw them in the comments, I’ve decided to try these 2 out and if they do not satisfy I will look in to more options.