Rails 2.0.2 contains a bunch of smaller fixes to various bugs, no show-stopping action, just further polish. But it also contains a few new defaults.
Riding Rails: Rails 2.0.2: Some new defaults and a few fixes
Rails 2.0.2 contains a bunch of smaller fixes to various bugs, no show-stopping action, just further polish. But it also contains a few new defaults.
Riding Rails: Rails 2.0.2: Some new defaults and a few fixes
The rails core team has released ruby on rails 1.2.6 to address a bug in the fix for session fixation attacks (CVE-2007-5380). The CVE Identifier for this new issue is CVE-2007-6077.
You should upgrade to this new release if you do not take specific session-fixation counter measures in your application. 1.2.6 also fixes some regressions when working with has_many associations on unsaved ActiveRecord objects.
Riding Rails: Ruby on Rails 1.2.6: Security and Maintenance Release
We started coding about 3.5 to 4 weeks before Open World. At that point, we still didn’t have hardware and there were a ton of unknowns surrounding jRuby running on the Oracle AppServer (and if it did, what performance would be like). We bit the bullet and went for it. Rails was an essential ingredient to this project. I don’t know of other frameworks that would have enabled us to build this particular application so rapidly.
Oracle AppsLab » Mix, jRuby on Rails, Small Teams, Agile, and it’s Effects on the World
Ruby on Rails is the shit! ;)
In the comments to the 37signals post about how they test their software I found a link to Shoulda. At first glance it looks amazing. The test are suddenly a piece of art!
I’m definitely going to try this in one of my projects.
David writes about how they at 37signals test their software.
The slides from Craig R. McClanahan’s presentation at RailsConf Europe can be read here.
In this article I describe how to go about installing Ruby on Rails and Mongrel for use with Nginx or Apache on a linux machine. In my case the machine had Ubuntu Feisty installed but these instructions should be equally applicable on other linux distributions, like Red Hat, Fedora or Suse.
Please give feedback in the comments in case something didn’t work for you and how you solved it so that next person won’t have to go through the same problems. Improvements are also welcome.
We’ll do it by compiling from source, like real men and women do. This gives us complete control of which version of Ruby that is used.
On Ubuntu make sure you have the build-essential, zlib1g-dev, openssl and libssl-dev packages installed. If you are using another distribution make sure similar things are installed.
$ mkdir src$ cd src$ mkdir ruby-1.8.6$ wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.6.tar.gz$ tar xzf ruby-1.8.6.tar.gz$ cd ruby-1.8.6$ ./configureIf you get a checking size of int… configure: error: cannot compute sizeof (int) error first try to install the build-essential package. If that doesn’t help, you, like me, might have a busted libc6-dev installation. Reinstall that package ($ sudo apt-get –reinstall install libc6-dev). That fixed the problem for me.
The checkinstall package is a smart thing. If you build something from source it will create a distribution package for you so that you easily can remove the package later on. Install the package with apt-get install checkinstall. On a Debian or Ubuntu system checkinstall will create a dpkg package but if used on a Red Hat, Fedora or Suse system you will get a rpm package.
Now we can continue with installing ruby.
$ make$ sudo checkinstall$ sudo dpkg -i ruby_1.8.6-1_i386.deb$ cd ../..$ mkdir rubygems-0.9.4$ cd rubygems-0.9.4$ wget http://rubyforge.org/frs/download.php/20989/rubygems-0.9.4.tgz$ tar xzf rubygems-0.9.4.tgz$ cd rubygems-0.9.4$ sudo ruby setup.rbIf you get no such file to load -- zlib (LoadError) you don't have the zlib1g-dev package installed, which gave you a ruby without zlib support when you compiled it. Install the package and start over from the beginning.
$ sudo gem install rails --include-dependenciesIf you get the following error:
ERROR: While executing gem ... (Gem::GemNotFoundException) Could not find rails (> 0) in any repository
Just run the command again.
$ sudo gem install mongrel$ sudo gem install mongrel_cluster$ sudo cp /usr/local/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.2/resources/mongrel_cluster /etc/init.d/Test your Mongrel install by running Mongrel in the root of a Rails application. If it works you should be able to access your application at http://localhost:3000.
$ cd rails_app$ mongrel_rails start -d$ mongrel_rails stopNow we need to do the cluster specific setup, do that by following these Using Mongrel Cluster instructions.
$ sudo gem install capistrano$ cd rails_app$ capify .Edit the config/deploy.rb script and set the :application, :repository, :deploy_to, :user, :app, :web, :db variables$ cap deploy:setup$ cap -q deploy:checkIf you don't get You appear to have all necessary dependencies installed fix the errors you get and execute the command again.
If you get connection failed for: hostname (LoadError: no such file to load -- openssl) you need to install the openssl and libssl-dev packages and then recompile ruby.
set :group_writable, false
set :keep_releases, 2
set :mongrel_conf, "#{deploy_to}/current/config/mongrel_cluster.yml"
after "deploy:symlink", :fix_session_permissions
task :fix_session_permissions, :roles => :web do
run "chmod 777 #{current_path}/tmp/sessions"
end
Alright, let's do the first deploy.
$ cap deploy
Naturally it won't work. You might remember that we configured the mongrel servers to run as the mongrel user. For the servers to be able to write log files the shared/log directory has to be either world writable (not really wanted) or owned by the mongrel user (the preferred choice). So fix that on the deploy machine. At the same time do the same for the shared/pids directory.
Now create the needed database user, create the database and make sure the database.yml configuration file is correct. Then do another deploy and pray that it works!
If you followed the Using Mongrel Cluster instructions you were told to copy a file to /etc/init.d/mongrel_cluster and then link to your mongrel_cluster.yml in the /etc/mongrel_cluster directory. That should be all the magic that is needed.
After you verified that it works run sudo update-rc.d mongrel_cluster defaults so it will be added to the services that are automatically started when the machine boots.
On this wiki page you can find a working site configuration. This is my /etc/nginx/sites-available/host file.
upstream host_mongrel {
server 127.0.0.1:9100;
server 127.0.0.1:9101;
}
server {
listen 80;
server_name host.se www.host.se;
access_log /var/log/nginx/host.se.access.log;
root /u/host.se/www/current/public;
index index.html index.htm;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect false;
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
if (!-f $request_filename) {
proxy_pass http://host_mongrel;
break;
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
<
p>I haven't done this myself but it should be fairly easy to follow the instructions in the Configuring Apache 2.2, Mongrel and mongrel_cluster section in this Deploying Rails on Ubuntu Dapper article.
<
p>You might need to do the following to the get the needed apache2 modules enabled.
Behold, behold, Rails 2.0 is almost here. But before we can slap on the final stamp, we’re going to pass through a couple of trial release phases. The first is this preview release, which allows you to sample the goodies in their almost finished state. We might change a few things or add something else, but by and large, this is how Rails 2.0 is going to look and feel. After this release have had a chance to be tried out, we’re going to move to a release candidate or two (or three, depending on how many we need). Then, the final release. Before the release of 2.0, we’re also going to be putting out 1.2.4, which will include a variety of bug fixes and the last deprecation warnings to get you ready for upgrading an existing application to 2.0 standards. Enough about process. Let me tell you a little bit about what’s new in Rails 2.0:
Riding Rails: Rails 2.0: Preview Release
Not too many bigger changes but a lot of small improvements.
Crain’s Chicago Business recently posted a video interview with Jason where he discusses avoiding structure, how interruption is the enemy of productivity, why it’s a good idea to emulate drug dealers, the secret to competing with free stuff, and more. Check it out.
Crain’s Chicago Business interviews Jason – (37signals)
Not really any surprises for us readers of their blog but if you're not sure who 37signals are and what they do. Watch this video!
If you are wondering how to get your Rails application to play together with the rest of the kids in the SOA playground this SOA and Rails article by Russ Miles over at the SOA Ranch will give you a nice introduction.
Recent Comments