Search Results

Search found 220 results on 9 pages for 'activesupport'.

Page 7/9 | < Previous Page | 3 4 5 6 7 8 9  | Next Page >

  • Re-using unit tests for models using STI

    - by TenJack
    I have a number of models that use STI and I would like to use the same unit test to test each model. For example, I have: class RegularList < List class OtherList < List class ListTest < ActiveSupport::TestCase fixtures :lists def test_word_count list = lists(:regular_list) assert_equal(0, list.count) end end How would I go about using the test_word_count test for the OtherList model. The test is much longer so I would rather not have to retype it for each model. Thanks.

    Read the article

  • Broken pipe error in rails with memcached

    - by abronte
    I keep running into this error MemCacheError (Broken pipe): Broken pipe on my Rails app and I can't figure out why. When I access memcached via Rails.cache in my controller, the first 1 or 2 read/writes always seems to throw the broken pipe error. But when I access memcached by creating a new object, ActiveSupport::Cache::MemCacheStore.new, I don't seem to get this error. I also access memcached in another ruby process, and the first read always has this error regardless of the way I access memcached. I did implement a work around just by retrying the read but id rather have a better long term solution. Currently the only time I see this problem is after I restart memcached. I'm using Rails 2.3.5 and memcached 1.4.4 (I've also tried this with memcached 1.2.2).

    Read the article

  • MongoMapper - undefined method `keys'

    - by nimnull
    I'm trying to create a Document instance with params passed from the post-submitted form: My Mongo mapped document looks like: class Good include MongoMapper::Document key :title, String key :cost, Float key :description, String timestamps! many :attributes validates_presence_of :title, :cost end And create action: def create @good = Good.new(params[:good]) if @good.save redirect_to @good else render :new end end params[:good] containes all valid document attributes - {"good"={"cost"="2.30", "title"="Test good", "description"="Test description"}}, but I've got a strange error from rails: undefined method `keys' for ["title", "Test good"]:Array My gem list: *** LOCAL GEMS *** actionmailer (2.3.8) actionpack (2.3.8) activerecord (2.3.8) activeresource (2.3.8) activesupport (2.3.8) authlogic (2.1.4) bson (1.0) bson_ext (1.0) compass (0.10.1) default_value_for (0.1.0) haml (3.0.6) jnunemaker-validatable (1.8.4) mongo (1.0) mongo_ext (0.19.3) mongo_mapper (0.7.6) plucky (0.1.1) rack (1.1.0) rails (2.3.8) rake (0.8.7) rubygems-update (1.3.7) Any suggestions how to fix this error?

    Read the article

  • Google Maps integration with JSON - CircularReferenceError

    - by JZ
    I'm working on Rails 3.0.0.beta2, following Advanced Rails Recipes "Recipe #32, Mark locations on a Google Map" and I hit a road block. The following code is returning a "ActiveSupport::JSON::Encoding::CircularReferenceError" "object references itself" at line 3. This code represents the /layouts/maps.html.erb file <% if @maps -%> <script type="text/javascript"> var maps = <%= @maps.to_json %>; </script> <% end -%> This is my first attempt at rendering JSON, and I don't know how to debug this problem. Do you have experience with this? What could cause this problem? Thank you in advance!

    Read the article

  • 'uninitialized constant ActionPack' when starting rails

    - by TheDeeno
    When starting my rails server I'm getting an 'uninitialized constant ActionPack' error. raw stack trace I'm using blunder with rails 2.3.8 running 'bundle list' shows: * actionmailer (2.3.8) * actionpack (2.3.8) * activerecord (2.3.8) * activeresource (2.3.8) * activesupport (2.3.8) * acts-as-taggable-on (2.0.6) * authlogic (2.1.5) * builder (2.1.2) * cucumber (0.7.3) * cucumber-rails (0.3.1) * database_cleaner (0.5.2) * diff-lcs (1.1.2) * faker (0.3.1) * gherkin (1.0.30) * haml (3.0.7) * hoe (2.6.0) * json_pure (1.4.3) * machinist (1.0.6) * nifty-generators (0.4.0) * nokogiri (1.4.2) * rack (1.1.0) * rack-test (0.5.4) * rails (2.3.8) * rake (0.8.7) * rr (0.10.11) * rspec (1.3.0) * rspec-rails (1.3.2) * rubyforge (2.0.4) * sqlite3-ruby (1.2.5) * term-ansicolor (1.0.5) * test-unit (1.2.3) * trollop (1.16.2) * webrat (0.7.1) Any idea what's going on here?

    Read the article

  • time difference on heroku server

    - by railsnew
    There seems to be a time difference on heroku server. >> Customer.last.id => 584 >> Customer.last.created_at => Thu, 06 May 2010 01:43:20 UTC +00:00 >> Time.zone => #<ActiveSupport::TimeZone:0x2b1dec47e5c0 @utc_offset=0, @tzinfo=#<TZInfo::DataTimezone: Etc/UTC>, @name="UTC"> >> Time.now => Wed May 05 19:05:15 -0700 2010 >> Time.now.zone => "PDT" Notice that current time is May 05 19...however, created_at date for last record is May 06 01:43. This does not make any sense. What can be causing this and how would I go about fixing this?

    Read the article

  • Stop Rails from unloading a module in development mode

    - by Gareth
    I have a module in my Rails app that lives in /lib module MyModule mattr_accessor :the_variable class << self def setup yield this end end end From my environments/#{RAILS_ENV}.rb file I can then set an environment-specific value for the_variable: MyModule.setup do |my_module_config| my_module_config.the_variable = 42 end This is lovely, and it seems to work (almost) fine. The problem is that in development mode, Rails via ActiveSupport::Dependencies unloads a load of modules, and reloads them in time for the new request. This is usually a great behaviour because it means you don't need to restart your localhost server when you make a code change. However, this also clears out my initialised the_variable variable, and when the next request comes in the initialiser (obviously) isn't run again. The net effect is that subsequent requests end up having MyModule.the_variable set to nil rather than the 42 that I'm looking for. I'm trying to work out how to stop Rails unloading my module at the end of the request, or alternatively find another way to cleanly provide environment specific configuration for my modules. Any ideas? :-/

    Read the article

  • NameError in CompetitorsController#index

    - by manish nautiyal
    Hi all I am getting this problem when I run this code in server. In my localhost everything is running fine. But when I deploy my code in the server it shows me the error. I am using FERRET SERARCH IN MODEL. NameError in CompetitorsController#index uninitialized constant CompetitorsController::Competitor /opt/ruby_enterprise/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:102:in `const_missing' /home/troche/mrecip_tool/releases/20091219131859/app/controllerscompetitors_controller .rb :19:in `index' My controller is class CompetitorsController < ApplicationController include AuthenticatedSystem layout 'application' auto_complete_for :proscribed, :competitor auto_complete_for :fee_earner, :fee_earner protect_from_forgery :only = [:tag] before_filter :login_required, :only = [:index, :show, :new, :edit] @@total_company = 70 def index @compet = Competitor.find(:all) ### GETTING ERROR IN THIS LINE respond_to do |format| format.html # index.html.erb format.xml { render :xml => @compet } end end def show @competitor = Competitor.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @competitor } end end end My Model is class Competitor < ActiveRecord::Base validates_presence_of :fee_earner_id, :notes belongs_to :fee_earner belongs_to :country belongs_to :state belongs_to :user acts_as_ferret :fields =[:competitor, :client, :subject_matter],:remote = true end

    Read the article

  • Rails: How do I run a before_save only if certain conditions are met?

    - by Shpigford
    I have a before_save method that I call that renames an uploaded image. before_save :randomize_file_name def randomize_file_name extension = File.extname(screen_file_name).downcase key = ActiveSupport::SecureRandom.hex(8) self.screen.instance_write(:file_name, "#{key}#{extension}") end That method is part of my Item model. That works great when I create a new item or need to update the image associated with an item...but the problem is that if I need to update an item but NOT the image, the randomize_file_name method still gets run and renames the file in the database (though not the file itself, obviously). So, I'm thinking I need to figure out a way to only run randomize_file_name if a file is included in the form submission...but I'm not sure how to pull that off.

    Read the article

  • rails large amount of data in single insert activerecord gave out

    - by Nik
    So I have I think around 36,000 just to be safe, a number I wouldn't think was too large for a modern sql database like mysql. Each record has just two attributes. So I do: so I collected them into one single insert statement sql = "INSERT INTO tasks (attrib_a, attrib_b) VALUES (c1,d1),(c2,d2),(c3,d3)...(c36000,d36000);" ActiveRecord::Base.connection.execute sql from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract_adapter.rb:219:in `log' from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/mysql_adapter.rb:323:in `execute_without_analyzer from c:/r/projects/vendor/plugins/rails-footnotes/lib/rails-footnotes/notes/queries_note.rb:130:in `execute' from C:/Ruby/lib/ruby/1.8/benchmark.rb:308:in `realtime' from c:/r/projects/vendor/plugins/rails-footnotes/lib/rails-footnotes/notes/queries_note.rb:130:in `execute' from (irb):53 from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/time_or_datetime.rb:242 I don't know if the above info is enough, please do ask for anything that I didn't provide here. So any idea what this is about? THANK YOU!!!!

    Read the article

  • Ruby On Rails : db:migrate do not run

    - by user332219
    Hi, When i run this command i have an error : rake db:migrate --trace rake aborted! NoMethodError: undefined method `ord' for 0:Fixnum: SET NAMES 'utf8' see the log file here : http://patxi.mayol.free.fr/public/trace.txt my database.yml file is here : MySQL. Versions 4.1 and 5.0 are recommended. # development: adapter: mysql encoding: utf8 reconnect: false database: annuaire_development pool: 5 username: root password: host: 127.0.0.1 test: adapter: mysql encoding: utf8 reconnect: false database: annuaire_test pool: 5 username: root password: host: 127.0.0.1 production: adapter: mysql encoding: utf8 reconnect: false database: annuaire_production pool: 5 username: root password: host: 127.0.0.1 Thanks My config : WampServer 2.0 with MySQL 5.0.51a Aptana 2.0.4 Ruby 1.8.5 Gems: actionmailer (2.3.4, 2.3.2) actionpack (2.3.4, 2.3.2) activerecord (2.3.4, 2.3.2) activeresource (2.3.4, 2.3.2) activesupport (2.3.4, 2.3.2) cgi_multipart_eof_fix (2.5.0) fastthread (1.0.1) gem_plugin (0.2.3) linecache (0.43) mongrel (1.1.5) mysql (2.8.1, 2.7.3) rack (1.0.0) rails (2.3.4, 2.3.2) rake (0.8.7) ruby-debug-base (0.10.3) ruby-debug-ide (0.4.5) sqlite3-ruby (1.2.1)

    Read the article

  • "rake test" doesn't load fixtures?

    - by Pavel K.
    when i run rake test --trace here's what happens ** Invoke test (first_time) ** Execute test ** Invoke test:units (first_time) ** Invoke db:test:prepare (first_time) ** Invoke db:abort_if_pending_migrations (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:abort_if_pending_migrations ** Execute db:test:prepare ** Invoke db:test:load (first_time) ** Invoke db:test:purge (first_time) ** Invoke environment ** Execute db:test:purge ** Execute db:test:load ** Invoke db:schema:load (first_time) ** Invoke environment ** Execute db:schema:load ** Execute test:units /usr/bin/ruby1.8 -I"lib:test".... (and after that fails because there's no fixtures loaded) why doesn't it load fixtures (i thought that would be default behaviour) and how do i make it load fixtures before executing tests??? p.s. my test/test_helper.rb content is: ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'test_help' class ActiveSupport::TestCase self.use_transactional_fixtures = true self.use_instantiated_fixtures = false fixtures :all end (rails 2.3.4)

    Read the article

  • How to validate inclusion of time zone?

    - by LearningRoR
    When I try: validates_inclusion_of :time_zone, :in => TimeZone validates_inclusion_of :time_zone, :in => Time.zone This error appears: "<class:User>": uninitialized constant User::TimeZone (NameError) I'm trying to let users select any time zone of the world but since I'm based in the U.S.A. my select menu is this: <%= f.time_zone_select :time_zone, ActiveSupport::TimeZone.us_zones, {:prompt => "Select Your Time Zone *"}, {:id => "timezone"} %> What's the correct way to do this? Thank you.

    Read the article

  • Ruby Hash.merge with specified keys only

    - by ba
    I'm pretty sure I saw on a Rails related site something along the lines of: def my_function(*opts) opts.require_keys(:first, :second, :third) end And if one of the keys in require_keys weren't specified, or if there were keys that weren't specified, an exception was raised. I've been looking through ActiveSupport and I guess I might be looking for something like the inverse of except. I like to try and use as much of the framework as possible compared to writing my own code, that's the reason I'm asking when I know how to make the same functionality on my own. :) At the moment I'm doing it through the normal merge routine and making sure that I have what I need with some IFs.

    Read the article

  • rake test fails

    - by Pavel K.
    i have a model (simplified) class Myfile < ActiveRecord::Base validates_attachment_size :body, :less_than => AdminOptions.first.max_file_size.megabytes end max_file_size is defined in AdminOptions fixture, but when i try to run "rake test", i get: /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:52:in `method_missing': undefined method `max_file_size' for nil:NilClass (NoMethodError) from /myapp/app/models/myfile.rb:1 if i run ruby test/unit/myfile_test.rb i get same mistake. if i run: RAILS_ENV=test rake db:load:fixtures ruby test/unit/myfile_test.rb tests execute properly. if i try to RAILS_ENV=test rake db:load:fixtures rake test it fails with same mistake. does anyone know how to fix that?

    Read the article

  • Cannot call struct properties from HAML file

    - by Lander
    I have the following code in my controller: @nav_items = ActiveSupport::OrderedHash.new @nav_items[:home] = Struct::NavItem.new("Home", nil, "/", "icon-home") @nav_items[:about] = Struct::NavItem.new("About", nil, "/about", "icon-heart") @nav_items[:contact] = Struct::NavItem.new("Contact", nil, "/contact", "icon-envelope") if (current_user != nil && current_user.admin?) @nav_items[:admin_divider] = Struct::NavItem.new(nil, "divider-vertical", nil, nil) @nav_items[:admin] = Struct::NavItem.new("Admin", nil, "/admin", "") end And the following in my view: - @nav_items.each do |nav_item| %li{ :class => nav_item[:class] } %a{ :href => nav_item[:link] }= nav_item[:text] And my struct definition: Struct.new("NavItem", :text, :class, :link, :icon_class) I'm relatively new to Ruby, Rails, and HAML, but in another project using ERB rendering, code like that worked fine. I've tried referencing properties by doing something like nav_item.link as well, but that still does not work. The error I get with my current code is: Symbol as array index By using code like nav_item.link: undefined method `link' for #< Array:0x126970ff0 As this is my first time using HAML, I'm not too sure what I'm doing wrong.

    Read the article

  • I18n translation problem

    - by kshchepelin
    I'm about to translate all time zones to Russian and I've done such things: model: # lib/i18n_time_zone.rb class I18nTimeZone < ActiveSupport::TimeZone def self.all super.map { |z| create(z.name, z.utc_offset) } end def to_s translated_name = I18n.t(name, :scope => :timezones, :default => name) "(GMT#{formatted_offset}) #{translated_name}" end end view: <%= time_zone_select :user, :time_zone, nil, :model => I18nTimeZone %> locale file (/config/locales/ru.yml): ru: timezones: "Midway Island": "??????" "Samoa": "?????" .... But there are cases when original string includes some dots (".") Like "St. Petersburg" And I18n.t() tells me that translation is missing. How can I avoid it?

    Read the article

  • Javascript not executing (I included format.js)

    - by Brandon
    I added format.js to my controller, yet I still cannot get the js in index.js.erb to execute when I view my index page. The only thing I can figure out is that it must be because of the model name. I had to add ActiveSupport::Inflector.inflections do |inflect| inflect.irregular 'business', 'businesses' end to my inflections.rb file...because my model is called Business. my views/js are located at views/businesses/* Please help before I pull my hair out! All I have in the index.js.erb file is: alert(1); Obviously the goal is that I will get an alert when I finally get the issue fixed, letting me know it is working.

    Read the article

  • Exception with RubyAMF and Ruby 1.9 although code works

    - by Tam
    I'm getting an exception with RubyAMF using Ruby 1.9 and Rails 2.3.5. Although code afterward executes normally I'm not very comfortable with seeing such exception in the log file. Do you know what is causing it: >>>>>>>> RubyAMF >>>>>>>>> #<RubyAMF::Actions::PrepareAction:0x0000010139ff48> took: 0.00020 secs >>>>>>>> RubyAMF >>>>>>>>> #<RubyAMF::Actions::RailsInvokeAction:0x0000010139ff10> took: 0.29973 secs You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.include? /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:142:in `create_time_zone_conversion_attribute?' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:75:in `block in define_attribute_methods' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:71:in `each' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:71:in `define_attribute_methods' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:242:in `method_missing' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-2.3.5/lib/active_record/base.rb:2832:in `hash' /Users/tammam56/lal/vendor/plugins/ruby_amf/io/amf_serializer.rb:366:in `hash' /Users/tammam56/lal/vendor/plugins/ruby_amf/io/amf_serializer.rb:366:in `hash' /Users/tammam56/lal/vendor/plugins/ruby_amf/io/amf_serializer.rb:366:in `[]=' /Users/tammam56/lal/vendor/plugins/ruby_amf/io/amf_serializer.rb:366:in `store_object' /Users/tammam56/lal/vendor/plugins/ruby_amf/io/amf_serializer.rb:234:in `write_amf3_object' /Users/tammam56/lal/vendor/plugins/ruby_amf/io/amf_serializer.rb:154:in `write_amf3' /Users/tammam56/lal/vendor/plugins/ruby_amf/io/amf_serializer.rb:78:in `write' /Users/tammam56/lal/vendor/plugins/ruby_amf/io/amf_serializer.rb:70:in `block in run' /Users/tammam56/lal/vendor/plugins/ruby_amf/io/amf_serializer.rb:56:in `upto' /Users/tammam56/lal/vendor/plugins/ruby_amf/io/amf_serializer.rb:56:in `run' /Users/tammam56/lal/vendor/plugins/ruby_amf/app/filters.rb:91:in `block in run' /Users/tammam56/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/benchmark.rb:309:in `realtime' /Users/tammam56/lal/vendor/plugins/ruby_amf/app/filters.rb:91:in `run' /Users/tammam56/lal/vendor/plugins/ruby_amf/app/filters.rb:12:in `block in run' /Users/tammam56/lal/vendor/plugins/ruby_amf/app/filters.rb:11:in `each' /Users/tammam56/lal/vendor/plugins/ruby_amf/app/filters.rb:11:in `run' /Users/tammam56/lal/vendor/plugins/ruby_amf/app/rails_gateway.rb:28:in `service' /Users/tammam56/lal/app/controllers/rubyamf_controller.rb:19:in `gateway' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `perform_action' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in `call_filters' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in `perform_action_with_filters' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `block in ms' /Users/tammam56/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/benchmark.rb:309:in `realtime' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in `perform_action_with_flash' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in `process_with_filters' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:in `process' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in `dispatch' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `block in call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.0.1/lib/rack/head.rb:9:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.0.1/lib/rack/lock.rb:11:in `block in call' <internal:prelude>:8:in `synchronize' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in `block in call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in `run' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `block in call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.0.1/lib/rack/chunked.rb:15:in `call' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:in `process' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `block in process_client' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client' /Users/tammam56/.rvm/gems/ruby-1.9.1-p378/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `block (2 levels) in run '

    Read the article

  • Rails3 server and bundler error: uninitialized constant Bundler (NameError)

    - by .yandex.rurap-kasta
    I just install rails 3 and all gems that it need, but when I try to start server, it says about problem in boot script. [rap-kasta@acerAspire testR3]$ script/rails server /home/rap-kasta/tmp/testR3/config/boot.rb:7:in `rescue in <top (required)>': uninitialized constant Bundler (NameError) from /home/rap-kasta/tmp/testR3/config/boot.rb:2:in `<top (required)>' from script/rails:9:in `require' from script/rails:9:in `<main> So, I tried to reinstall Bundler, install "pre"-version (but really it has version number lower then i install by gem install bundler Now there are next gems in system: abstract (1.0.0) actionmailer (3.0.0.beta, 2.3.5, 2.3.4) actionpack (3.0.0.beta, 2.3.5, 2.3.4) activemodel (3.0.0.beta) activerecord (3.0.0.beta, 2.3.5, 2.3.4) activeresource (3.0.0.beta, 2.3.5, 2.3.4) activesupport (3.0.0.beta, 2.3.5, 2.3.4) arel (0.2.1, 0.2.pre) builder (2.1.2) bundler (0.9.5) erubis (2.6.5) fxri (0.3.7) fxruby (1.6.20) i18n (0.3.3) jemini (2010.1.24, 2010.1.5) mail (2.1.2) memcache-client (1.7.8) mime-types (1.16) mysql (2.8.1) nifty-generators (0.3.2, 0.3.0) rack (1.1.0, 1.0.1, 1.0.0) rack-mount (0.5.1, 0.4.0) rack-openid (0.2.3, 0.2.2) rack-test (0.5.3) rails (3.0.0.beta, 2.3.5, 2.3.4) railties (3.0.0.beta) rake (0.8.7) rawr (1.3.8) RedCloth (4.2.2) ruby-mysql (3.0.2) ruby-openid (2.1.7) rubygems-update (1.3.5) rubyzip (0.9.4, 0.9.1) rubyzip2 (2.0.1) sqlite3-ruby (1.2.5) text-format (1.0.0) text-hyphen (1.0.0) thor (0.13.2, 0.13.1) tzinfo (0.3.16) Also, there is same error with rails console and similar with bundle check: [rap-kasta@acerAspire testR3]$ bundle check /usr/lib/ruby/gems/1.9.1/gems/bundler-0.9.5/bin/bundle:12:in `rescue in <top (required)>': uninitialized constant Bundler::BundlerError (NameError) from /usr/lib/ruby/gems/1.9.1/gems/bundler-0.9.5/bin/bundle:10:in `<top (required)>' from /usr/bin/bundle:19:in `load' from /usr/bin/bundle:19:in `<main>'

    Read the article

  • Autodetect timezone in Rails given UTC offset and DST

    - by Jose
    I basically want to autodetect a user's timezone using Rails. I can use this JS code at the user's browser (http://www.onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/) to send a form with the UTC offset and the fact that the time zone observes DST during summer or not, in the user's time zone. Once I have that info in the server, I want to select the matching time zone. In Rails, I can get a list of time zones with ActiveSupport::TimeZone.all. Also, I can filter zones by utf offset thanks to the utc_offset method. However, I don't know how to filter the timezones that do/don't observe DST. E.g. suppose a user lives in Amsterdam. Filtering by UTC offset will return Berlin, Belgrado, Madrid, etc timezones, as well as West Central Africa. All of them, but West Central Africa, would be appropriate timezones for a user in Amsterdam (as they provide the same time/date), but I need to filter West Central Africa, which does not perform DST in summer. How can I do this in Rails? Also, are any of my assumptions wrong?

    Read the article

  • Newly installed Ruby gems not showing up in $LOAD_PATH

    - by randombits
    I'm using MacPorts in order to manage my Ruby/Rails/Gems installations. Recently after doing a gem install wirble, wirble fails to load when I start an instance of irb. Here's the output: $ irb --simple-prompt Couldn't load Wirble: no such file to load -- wirble The Wirble gem doesn't show up in my $LOAD_PATH: >> puts $: /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionmailer-2.3.5/lib /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.5/lib /opt/local/lib/ruby1.9/gems/1.9.1/gems/activeresource-2.3.5/lib /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.5/lib /opt/local/lib/ruby1.9/gems/1.9.1/gems/mysql-2.8.1/lib /opt/local/lib/ruby1.9/gems/1.9.1/gems/mysql-2.8.1/ext /opt/local/lib/ruby1.9/gems/1.9.1/gems/mysql-2.8.1/bin /opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.1/bin /opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.1/lib /opt/local/lib/ruby1.9/gems/1.9.1/gems/rails-2.3.5/bin /opt/local/lib/ruby1.9/gems/1.9.1/gems/rails-2.3.5/lib /opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.8.7/bin /opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.8.7/lib /opt/local/lib/ruby1.9/gems/1.9.1/gems/rubygems-update-1.3.7/hide_lib_for_update /opt/local/lib/ruby1.9/gems/1.9.1/gems/rubygems-update-1.3.7/bin /opt/local/lib/ruby1.9/site_ruby/1.9.1 /opt/local/lib/ruby1.9/site_ruby/1.9.1/i386-darwin10 /opt/local/lib/ruby1.9/site_ruby /opt/local/lib/ruby1.9/vendor_ruby/1.9.1 /opt/local/lib/ruby1.9/vendor_ruby/1.9.1/i386-darwin10 /opt/local/lib/ruby1.9/vendor_ruby /opt/local/lib/ruby1.9/1.9.1 /opt/local/lib/ruby1.9/1.9.1/i386-darwin10 . => nil >> The gem is definitely installed: $ gem list |grep -i wirble wirble (0.1.3) It is located in /opt/local/lib/ruby/gems/1.9.1/gems/wirble-0.1.3/ How do I get this and future gems I installed appended to my $LOAD_PATH?

    Read the article

  • rails test.log is always empty

    - by Raiden
    All the log entries generated when running tests with 'rake' are written to my development.log instead of test.log file Do I have to explicitly enable logging for test in enviornments/test.config?? (I'm using 'turn' gem to format test output, Can that cause an issue?) I'm running rails 2.3.5, ruby 1.8.7 I've all these gems installed for RAILS_ENV=test. Any help is appreciated. -[I] less -[I] treetop = 1.4.2 - [I] polyglot = 0.2.5 - [I] mutter = 0.4.2 - [I] mysql - [I] authlogic - [R] activesupport - [I] turn - [I] ansi = 1.1.0 - [I] facets = 2.8.0 - [I] rspec = 1.2.0 - [I] rspec-rails = 1.2.0 - [I] rspec = 1.3.0 - [R] rack = 1.0.0 - [I] webrat = 0.4.3 - [I] nokogiri = 1.2.0 - [R] rack = 1.0 - [I] rack-test = 0.5.3 - [R] rack = 1.0 - [I] cucumber = 0.2.2 - [I] term-ansicolor = 1.0.4 - [I] treetop = 1.4.2 - [I] polyglot = 0.2.5 - [I] polyglot = 0.2.9 - [R] builder = 2.1.2 - [I] diff-lcs = 1.1.2 - [R] json_pure = 1.2.0 - [I] cucumber-rails - [I] cucumber = 0.6.2 - [I] term-ansicolor = 1.0.4 - [I] treetop = 1.4.2 - [I] polyglot = 0.2.5 - [I] polyglot = 0.2.9 - [R] builder = 2.1.2 - [I] diff-lcs = 1.1.2 - [R] json_pure = 1.2.0 - [I] database_cleaner = 0.2.3 - [I] launchy - [R] rake = 0.8.1 - [I] configuration = 0.0.5 - [I] faker - [I] populator - [R] flog = 2.1.0 - [R] flay - [I] rcov - [I] reek - [R] ruby_parser ~ 2.0 - [I] ruby2ruby ~ 1.2 - [R] sexp_processor ~ 3.0 - [R] ruby_parser ~ 2.0 - [R] sexp_processor ~ 3.0 - [I] roodi - [R] ruby_parser - [I] gruff - [I] rmagick - [I] ruby-prof - [R] jscruggs-metric_fu = 1.1.5 - [I] factory_girl - [I] notahat-machinist

    Read the article

  • undefined method `content_type' for nil:NilClass /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2

    - by Y Kamesh Rao
    Strange error in diagnostics.erb file about _set_controller_content_type. Please help. NoMethodError in Timelines#public_timeline Showing /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/templates/rescues/diagnostics.erb where line # raised: undefined method `content_type' for nil:NilClass Extracted source (around line #): RAILS_ROOT: /Volumes/DATA/Source/Rails/tvider Application Trace | Framework Trace | Full Trace /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:52:in method_missing' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/base.rb:331:in_set_controller_content_type' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/renderable.rb:32:in block in render' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/base.rb:306:inwith_template' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/renderable.rb:30:in render' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/template.rb:205:inrender_template' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/base.rb:265:in render' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:134:inrescue_action_locally' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:152:in rescue_action_without_handler' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:74:inrescue_action' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:162:in rescue in perform_action_with_rescue' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:inperform_action_with_rescue' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in perform_action_with_flash' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:inprocess' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in process_with_filters' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:inprocess' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in call' /opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:incall' Request Parameters: None Show session dump Response Headers: {"Cache-Control"="no-cache", "Content-Type"=""}

    Read the article

  • vestal_versions : problem with column named changes

    - by arkannia
    Hi, I am working with vestal version for 2 months. Everything was fine until this afternoon. I didn't done anything special(or i don't remembered...) but the code works fine on others computers... The problem is that i'm not able to save my model anymore: rails give me this error : ActiveRecord::DangerousAttributeError: changes is defined by ActiveRecord changes field is by default an activerecord method. With the console, the message is the next : ActiveRecord::DangerousAttributeError: changes is defined by ActiveRecord Here are my local gem files: abstract (1.0.0) actionmailer (3.0.0.beta3) actionpack (3.0.0.beta3) activemodel (3.0.0.beta3) activerecord (3.0.0.beta3) activeresource (3.0.0.beta3) activesupport (3.0.0.beta3) arel (0.3.3) builder (2.1.2) bundler (0.9.25, 0.9.24) crack (0.1.7) erubis (2.6.5) god (0.9.0) haml (3.0.1, 2.2.23) i18n (0.3.7) mail (2.2.0) memcache-client (1.8.3) memcached (0.17.7) mime-types (1.16) polyglot (0.3.1) rack (1.1.0) rack-mount (0.6.3) rack-test (0.5.3) rails (3.0.0.beta3) railties (3.0.0.beta3) rake (0.8.7) savon (0.7.8, 0.7.6) text-format (1.0.0) text-hyphen (1.0.0) thor (0.13.6, 0.13.4) treetop (1.4.5) tzinfo (0.3.20) And here my Gemfile source 'http://gemcutter.org' gem "rails", "3.0.0.beta3" gem "will_paginate", "3.0.pre" #gem 'nokogiri' #gem 'curb' #gem 'handsoap' gem 'savon' gem 'mysql' gem 'haml', '2.2.23' #gem 'haml', '3.0.1' gem 'hpricot' gem 'i18n', '> 0.3.5' gem 'i18n_routing' gem 'i18n_auto_scoping' gem 'handler301', :git => 'http://github.com/kwi/handler301.git' gem 'seo_meta_builder' gem 'vestal_versions' #gem 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git', :branch => 'rails3' ## Bundle edge rails: gem "rails", :git => "git://github.com/rails/rails.git" ## Bundle the gems you use: # gem "bj" # gem "hpricot", "0.6" # gem "sqlite3-ruby", :require => "sqlite3" # gem "aws-s3", :require => "aws/s3" ## Bundle gems used only in certain environments: # gem "rspec", :group => :test # group :test do # gem "webrat" # end If you have any suggestions to solve this issue, i'll be glad to hear them ! Thanks

    Read the article

< Previous Page | 3 4 5 6 7 8 9  | Next Page >