I had a hard time with selinux with this until I found some information on stackoverflow. http://stackoverflow.com/questions/2054554/passenger-mod-rails-fails-to-initialize-in-fedora-12-when-starting-apache 1. Go into permissive mode by running setenforce 0 2. Restart apache, and hit your site and use it for a while as normal 3. Run grep httpd /var/log/audit/audit.log | audit2allow -M passenger 4. semodule -i passenger.pp 5. Go back to enforcing mode by running setenforce 1 6. Restart apache and test your [ Read More ]
Heres a rough test function for doing this conversion by reading the EXIF data on an image. More to come… def process_lat_lon if self.photo.to_s.match(“jpg$”) or self.photo.to_s.match(“JPG$”) or self.photo.to_s.match(“JPEG$”) or self.photo.to_s.match(“jpeg$”) a = EXIFR::JPEG.new(Rails.root.to_s + “/public” + “#{self.photo}”) #converts to ‘geopoint’ if(a.exif[0].gps_latitude and a.exif[0].gps_longitude) lat = a.exif[0].gps_latitude[0].to_f + (a.exif[0].gps_latitude[1].to_f / 60) + (a.exif[0].gps_latitude[2].to_f / 3600) long = a.exif[0].gps_longitude[0].to_f + (a.exif[0].gps_longitude[1].to_f / 60) + (a.exif[0].gps_longitude[2].to_f / 3600) long = long * -1 [ Read More ]
I was attempting to do high level integration testing in Ruby on Rails. This processes involves Capybara calling selenium (through selenium-webdriver) to bring up firefox in order to do some manipulation of the user interface to test my web app. I ran into an issue where Firefox4 would not start from the command line. The packages involved along with selenium are capybara 0.4.1.2, selenium webdriver 0.1.4, Rails 3.0.3, RSpec 2.4.0, [ Read More ]
After watching the Railscast about Capybara I decided to give it a try. As the Railscast says Capybara fills in the missing functionality in rspec/webrat integration testing where javascript calls are not testable. Initially I was planning on trying cucumber first, but I preferred to use Capybara because the syntax was very similar to webrat which I was already familiar with. Also the ability to open the browser Requires: RSpec [ Read More ]
In my recent attempt to use Devise as an authentication/authorization module with my Rails3 app I created some tests for testing a user controller as well as some integration tests. Here they are… Specs describe UsersController do include Devise::TestHelpers render_views describe "User functions" do before(:each) do @user1 = Factory(:user) @user2 = Factory(:user, :email => 'a2@b.com') @user3 = Factory(:user, :email => 'a3@b.com') @users = [@user1, @user2, @user3] @attr = { :email [ Read More ]
I was trying to migrate my wordpress instance from one of our test servers to our production server which has a different name and IP address. I found that simply copying the wordpress directory and moving the database wasn’t enough to perform a full migration. I wanted to be able to migrate multiple databases with a single button click, without having to log into each system and modify values. After [ Read More ]
I installed Rails3 and encountered one main error. After using rails to create a new project doing a rails -v caused an error with sqlite3. After searching around, I found that some people were using an old version of Xcode maybe the culprit. It would have taken too long for me to download Xcode so instead I installed an older version of sqlite. I’ll leave installing the newest version [ Read More ]
Simple instructions to root your Motorola Droid 1 phone and setup tethering in order to get wireless 3G internet from your Droid phone. Tethering in this context creates a wireless hotspot for all your devices to use. This was done on Froyo 2.2 FRG22D build. Instructions should work for all other Froyo builds. These instructions were adapted for MAC from this original post. Thanks to OMJ for putting together the [ Read More ]







