Ruby on Rails
Ruby on Rails is a first class citizen at Joyent, and many customers have succesfully developed and deployed web applications created with Rails.
Resources
Mongrel Rails separate log files per port
In your config/environments/production.rb add this below the config.logger line
# Use a different logger for distributed setups # config.logger = SyslogLogger.new ObjectSpace.each_object(Mongrel::HttpServer) { |i| @port = i.port } raise "Port could not be introspected!" unless @port and @port.to_i > 0 config.logger = Logger.new File.expand_path(RAILS_ROOT+"/log/#{ENV['RAILS_ENV']}.#{@port}.log")
Problems installing Gems
From time to time issues pop up when trying to update gems. First lets see where you currently are by asking gem for it's environment
# gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.1.0 (1.1.0)
- RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-solaris2]
- INSTALLATION DIRECTORY: /opt/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /opt/local/bin/ruby18
- RUBYGEMS PLATFORMS:
- ruby
- x86-unknown
- GEM PATHS:
- /opt/local/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org
To find out what is outdated you are able to use the following command:
# gem outdated
In this example let's say part of the output shows that rubygems itself needs to be updated. In the output from above you will something like the following line:
rubygems-update (1.1.0 < 1.2.0)
Getting current version of RubyGems
First lets try the easy button:
# gem update --system
Updating RubyGems
Bulk updating Gem source index for: http://gems.rubyforge.org/
Updating rubygems-update
ERROR: While executing gem ... (Gem::GemNotFoundException)
could not find rubygems-update locally or in a repository
OK that didn't work, so time to manually install. So we are going to use lynx to download the current version, which as of this writing is 1.2.0
# cd /root/src
# lynx http://rubyforge.org/frs/?group_id=126
# tar xvzf rubygems-1.2.0.tgz
# cd rubygems-1.2.0
# ruby setup.rb
# gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.2.0
- RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-solaris2]
- INSTALLATION DIRECTORY: /opt/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /opt/local/bin/ruby18
- EXECUTABLE DIRECTORY: /opt/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-unknown
- GEM PATHS:
- /opt/local/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/
ok so now we have the latest version of rubygem installed, in theory life is very good
# gem install any_gem_name_you_need
should just work.
To update all of the gems you have use:
# gem update
Help it still doesn't work
Sometimes the rubygem cache gets really out of wack, so to clear it out.
# gem sources --clear-all
And if the bulk update is the issue try this:
gem update --system -B 50000
Bite me ... still doesn't work
Time to pull out the –debug and post to our fourms
# gem install the_thing_which_is_not_working --debug