I had a lot of trouble with some rubygem warnings after upgrading to Ruby 1.9.1 and Rails 3.0 on Mac OS x Snow Leopard. They always occurred when I started the server within the project with the command
rails server |
At first, when running on bundler 0.9.3, I had two types of errors. The first NoMethodError populated the terminal with hundreds lines of code, like …
WARNING: # NoMethodError: undefined method ` ' for nil:NilClass # -*- encoding: utf-8 -*- ... WARNING: Invalid .gemspec format in \ '.rvm/gems/ruby-1.9.1-p378/specifications/spec.gemspec' |
The bundler-team around Carlhuda fixed that issue within bundler 0.9.4. So that problem will not occur any more.
The other problem was quite persistent. When starting the server via
rails server |
or doing a test via
rake |
within the rails-3-project resulted in a bunch of warnings:
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:14: \ warning: already initialized constant VERSION /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:14: \ warning: already initialized constant RubyGemsVersion /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:194: \ warning: already initialized constant MUTEX /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:196: \ warning: already initialized constant RubyGemsPackageVersion /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:202: \ warning: already initialized constant WIN_PATTERNS /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1079:\ warning: already initialized constant MARSHAL_SPEC_DIR /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1084: \ warning: already initialized constant YAML_SPEC_DIR /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/version.rb:72: \ warning: already initialized constant VERSION_PATTERN /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/requirement.rb:20: \ warning: already initialized constant OPS /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/requirement.rb:30: \ warning: already initialized constant OP_RE /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/version.rb:246: \ warning: already initialized constant Requirement /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:18: \ warning: already initialized constant TYPES /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/platform.rb:171: \ warning: already initialized constant RUBY /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/platform.rb:177: \ warning: already initialized constant CURRENT /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:39: \ warning: already initialized constant NONEXISTENT_SPECIFICATION_VERSION /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:50: \ warning: already initialized constant CURRENT_SPECIFICATION_VERSION /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:56: \ warning: already initialized constant SPECIFICATION_VERSION_HISTORY /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:72: \ warning: already initialized constant MARSHAL_FIELDS /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:75: \ warning: already initialized constant TODAY /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:593: \ warning: already initialized constant Cache /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:14: \ warning: already initialized constant DEFAULT_BACKTRACE /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:15: \ warning: already initialized constant DEFAULT_BENCHMARK /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:16: \ warning: already initialized constant DEFAULT_BULK_THRESHOLD /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:17: \ warning: already initialized constant DEFAULT_VERBOSITY /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:18: \ warning: already initialized constant DEFAULT_UPDATE_SOURCES /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:24: \ warning: already initialized constant OPERATING_SYSTEM_DEFAULTS /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:30: \ warning: already initialized constant PLATFORM_DEFAULTS /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:53: \ warning: already initialized constant SYSTEM_WIDE_CONFIG_FILE |
Jeremy Kemper from the Rails core team pointed out that this is not a Rails problem, but a RubyGems issue. Ruby 1.9 ships with an outdated RubyGems … like 1.9.1p378 ships with RubyGems 1.3.1. I did update RubyGems to Version 1.3.5 by
sudo gem update --system |
but this resulted in some duplicated rubygem files, which cause the error.
So how can the problem be solved? Deleting and reinstalling Ruby 1.9.1 does not have any effect … but the solution is quite simple:
1. Be sure that you do NOT install RubyGems 1.3.5 separately after the installation of Ruby 1.9.1 – this would result in a double installation. So have that in mind when following the excellent instructions to installing Ruby, RubyGems, and Rails on Snow Leopard of Dan Benjamin.
2. If you already installed Ruby 1.9.1, updated to RubyGems 1.3.5 and bundler 0.9.4 and also installed Rails 3.0, the only thing you have to do is:
sudo gem uninstall rubygems-update |
That’s it. No errors any more!
1. You may start with Dan Benjamin’s recipe and modify it so you download, make and install the ruby-1.9.1-p378.tar.gz but NOT the rubygems-1.3.5.tgz.
2. Then update RubyGems with the command
sudo gem update --system |
3. Ensure that the rake and the sqlite3-ruby gems are installed, too.
4. Now install the needed gems and rails –pre as described in the Rails 3.0 beta release notes
5. After the successful installation of Rails 3.0 beta, you now have to do the vitally important step:
sudo gem uninstall rubygems-update |
6. Finally check, if any gem needs an update before diving into Rails 3.0 by
sudo gem update |
Hope this helps … and saves some time. Thx Andy for the hint
Pratik Naik from the Rails core team just published the announcement for a new Ruby on Rails hackfest: The person with the most patches merged into the core at the end of the month wins. In August, O’Reilly will handout a free pass to the RailsConf Europe. Keep on coding!
From Sept. 2nd to Sept. 4th 2008 the Ruby on Rails community will meet at the RailsConf Europe. It’s the third RailsConf in Europe and it will located in Berlin/Germany again. Last year, more than 800 Rails enthusiasts joined the conference – a great developer community event – and always the chance to drink your coffee besides one of the creative minds of the Rails Core team
There is nothing that can replace the face-to-face communication within the community. So, I can warmly recommend joining the conference in Berlin to every Rails developer who is able to get there. And all those, who want to develop elegant web applications and do not work with Ruby on Rails yet – they should join us more than ever.
But there is an other group I miss a lot on Ruby on Rails conferences: Designers. Why? Because great application and interaction design and good web-application usability can only be achieved if developers and designers work closely together. That is why developers need to know something about design and designers need to know something about development.
So, I’m really happy that my proposal, focussing on that issue, was accepted at the conference. In my double role as a designer and developer I’ll talk about
DESIGN ON RAILS FOR USABILITY … Or why designers should start to understand code and developers should start to sketch and use design methods.
I’m really glad be a part of the conferece in September – and to meet all these interesting people – and hopefully some codedifferent-blogreaders, too
And please don’t forget to join Bratwurst-on-Rails on the evening before the conference starts.
Looking back into an extremely successful year 2007 with 1,600 participants at the RailsConf 2007 and 800 participants at the RailsConf Europe 2007, the year 2008 will be the year of the Rails-2.0 conferences.
April 4th/5th 2008: ScotlandOnRails, Edinburgh, Scotland
http://scotlandonrails.com
conference language: English
May 29th – June 1st 2008: RailsConf 2008, Portland, Oregon, USA
http://en.oreilly.com/rails2008/
organized by O’Reilly – conference language: English
June 9th/10th 2008: Rails-Konferenz.de, Frankfurt, Germany
http://www.rails-konferenz.de
conference language: German
June 10th 2008: Ruby en Rails 2008, Amsterdam, Netherlands
http://2008.rubyenrails.nl
conference language: Dutch
September 2nd-4th 2008: RailsConf Europe, Berlin, Germany
http://en.oreilly.com/railseurope2008/
organized by O’Reilly – conference language: English
There are probably a lot more conferences focussing on Rails … just drop a comment so the list can grow
Zend Framework reached Version 1.5 since the last article about Zend or Rails. Ruby on Rails also did a big step towards version 2 – 2.0.2, too be precise ![]()
So, who is my personal winner in this race? Which framework suits best for fast and innovative web application development?
To say things first: My personal favorite is Ruby-on-Rails!
But the burning questions is: Why!
But there are some specific projects, which are not well suited for Rails Mehr …