Search Results

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

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

  • Rails Enterprise Edition crashes in gc_sweep

    - by Greg
    My Rails application crashes intermittently with the following message: /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/multibyte/utils.rb:52: [BUG] gc_sweep(): unknown data type 0x0(0xbdc2ca0) ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.01 I am running the app on Nginx / Passenger. Ruby 1.8.7, Rails Enterprise Edition 2.3.5, Ubuntu 9.10 32bit. Does anybody have an idea how to fix this?

    Read the article

  • Ruby Sqlite3 connection issues.

    - by James Moore
    Hello, I am receiving the error: uninitialized constant SQLite3::Driver::Native::Driver::API within my application, however I have installed: ctionmailer-2.3.5 activerecord-jdbcsqlite3-adapter-0.9.6-java jruby-openssl-0.6 rails-2.3.5 actionpack-2.3.5 activeresource-2.3.5 mysql-2.8.1 sqlite3-ruby-1.2.5 activerecord-2.3.5 activesupport-2.3.5 pcaprub activerecord-jdbc-adapter-0.9.6-java jdbc-sqlite3-3.6.3.054 rack-1.0.1 However, it still cannot connect am I missing something? Thank you very much.

    Read the article

  • Ruby Enterprise Edition crashes in gc_sweep

    - by Greg
    My Rails application crashes intermittently with the following message: /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/multibyte/utils.rb:52: [BUG] gc_sweep(): unknown data type 0x0(0xbdc2ca0) ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.01 I am running the app on Nginx / Passenger. Ruby 1.8.7 Enterprise Edition 2010.10, Rails 2.3.5, Ubuntu 9.10 32bit. Does anybody have an idea how to fix this?

    Read the article

  • rake: command not found

    - by Errol Siegel
    I'm trying to install rails on Ubuntu 9.10. gem list --local *** LOCAL 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) rack (1.0.1) rails (2.3.4, 2.3.2) rake (0.8.7) sqlite3-ruby (1.2.5) rake The program 'rake' is currently not installed. You can install it by typing: sudo apt-get install rake rake: command not found How do I solve this?

    Read the article

  • How do I convert Windows 7 file-name encoding to UTF-8 for Ruby on Rails?

    - by Reilly
    Hi (Ive looked at the other questions - none seemed to quite fit my problem.) I have some file-names under Windows 7 that need to be translated in to MySQL database (UTF-8) with Ruby on Rails. An example file-name includes "íéó" in some kind of Windows 7 file-system encoding. Ive tried many combinations of gsub and ActiveSupport::Multibyte::Chars. Thanks for the help

    Read the article

  • test_case files in rails components

    - by Joseph Misiti
    i noticed there are a bunch of test_case.rb files delivered in the rails components: ./actionmailer-2.3.5/lib/action_mailer/test_case.rb ./actionpack-2.3.5/lib/action_controller/test_case.rb ./actionpack-2.3.5/lib/action_view/test_case.rb ./activerecord-2.3.5/lib/active_record/test_case.rb ./activesupport-2.3.5/lib/active_support/test_case.rb i am wondering how to execute these files. I cant seem to figure out how to do it?

    Read the article

  • How to import RoR project to Netbeans

    - by user369759
    I have very simple (in fact empty ) project which i have created by rails new MyProject command from command-line. So, i want to import it to NetBeans IDE. I click "new project" - "RoR" - "from existing source", select Ruby 1.9.2 (instead of embedded JRuby) in the wizard form. After that i have got errors [see the picture below]: So.. i click OK. And then try to run the RoR application from NetBeans clicking on the run-button and i got the following error in the log-panel: /home/ses/.rvm/rubies/ruby-1.9.2-p136/bin/ruby: No such file or directory -- script/server (LoadError) So how to handle these two problems? and, replying the comment to my question. yes, i performed following commands: bundle install Using rake (0.8.7) Using abstract (1.0.0) Using activesupport (3.0.3) Using builder (2.1.2) Using i18n (0.5.0) Using activemodel (3.0.3) Using erubis (2.6.6) Using rack (1.2.1) Using rack-mount (0.6.13) Using rack-test (0.5.7) Using tzinfo (0.3.24) Using actionpack (3.0.3) Using mime-types (1.16) Using polyglot (0.3.1) Using treetop (1.4.9) Using mail (2.2.15) Using actionmailer (3.0.3) Using arel (2.0.7) Using activerecord (3.0.3) Using activeresource (3.0.3) Using bundler (1.0.10) Using mysql2 (0.2.6) Using thor (0.14.6) Using railties (3.0.3) Using rails (3.0.3) p.s. my application is working when i launch it from the console. i use ruby-1.9.2 and RoR 3.0 and Netbeans 6.9.1 and Ubuntu 10.10 bundle pack Using rake (0.8.7) Using abstract (1.0.0) Using activesupport (3.0.3) Using builder (2.1.2) Using i18n (0.5.0) Using activemodel (3.0.3) Using erubis (2.6.6) Using rack (1.2.1) Using rack-mount (0.6.13) Using rack-test (0.5.7) Using tzinfo (0.3.24) Using actionpack (3.0.3) Using mime-types (1.16) Using polyglot (0.3.1) Using treetop (1.4.9) Using mail (2.2.15) Using actionmailer (3.0.3) Using arel (2.0.7) Using activerecord (3.0.3) Using activeresource (3.0.3) Using bundler (1.0.10) Using mysql2 (0.2.6) Using thor (0.14.6) Using railties (3.0.3) Using rails (3.0.3) Updating .gem files in vendor/cache Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. Updating .gem files in vendor/cache

    Read the article

  • Can't destroy record in many-to-many relationship

    - by Dmart
    I'm new to Rails, so I'm sure I've made a simple mistake. I've set up a many-to-many relationship between two models: User and Group. They're connected through the junction model GroupMember. Here are my models (removed irrelevant stuff): class User < ActiveRecord::Base has_many :group_members has_many :groups, :through => :group_members end class GroupMember < ActiveRecord::Base belongs_to :group belongs_to :user end class Group < ActiveRecord::Base has_many :group_members has_many :users, :through => :group_members end The table for GroupMembers contains additional information about the relationship, so I didn't use has_and_belongs_to_many (as per the Rails "Active Record Associations" guide). The problem I'm having is that I can't destroy a GroupMember. Here's the output from rails console: irb(main):006:0> m = GroupMember.new => #<GroupMember group_id: nil, user_id: nil, active: nil, created_at: nil, updated_at: nil> irb(main):007:0> m.group_id =1 => 1 irb(main):008:0> m.user_id = 16 => 16 irb(main):009:0> m.save => true irb(main):010:0> m.destroy NoMethodError: undefined method `eq' for nil:NilClass from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.0.4/lib/active_support/whiny_nil.rb:48:in `method_missing' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-3.0.4/lib/active_record/persistence.rb:79:in `destroy' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-3.0.4/lib/active_record/locking/optimistic.rb:110:in `destroy' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-3.0.4/lib/active_record/callbacks.rb:260:in `destroy' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:413:in `_run_destroy_callbacks' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-3.0.4/lib/active_record/callbacks.rb:260:in `destroy' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-3.0.4/lib/active_record/transactions.rb:235:in `destroy' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-3.0.4/lib/active_record/transactions.rb:292:in `with_transaction_returning_status' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-3.0.4/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-3.0.4/lib/active_record/transactions.rb:207:in `transaction' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-3.0.4/lib/active_record/transactions.rb:290:in `with_transaction_returning_status' from /usr/local/lib/ruby/gems/1.8/gems/activerecord-3.0.4/lib/active_record/transactions.rb:235:in `destroy' from (irb):10 This is driving me crazy, so any help would be greatly appreciated.

    Read the article

  • Rails send mail with GMail

    - by Danny McClelland
    Hi Everyone, I am on rails 2.3.5 and have the latest Ruby installed and my application is running well, except, GMail emails. I am trying to setup my gmail imap connection which has worked previously but now doesnt want to know. This is my code: # Be sure to restart your server when you modify this file # Uncomment below to force Rails into production mode when # you don't control web/app server and can't set it the proper way # ENV['RAILS_ENV'] ||= 'production' # Specifies gem version of Rails to use when vendor/rails is not present RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') Rails::Initializer.run do |config| # Gems config.gem "capistrano-ext", :lib => "capistrano" config.gem "configatron" # Make Time.zone default to the specified zone, and make Active Record store time values # in the database in UTC, and return them converted to the specified local zone. config.time_zone = "London" # The internationalization framework can be changed to have another default locale (standard is :en) or more load paths. # All files from config/locales/*.rb,yml are added automatically. # config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')] #config.i18n.default_locale = :de # Your secret key for verifying cookie session data integrity. # If you change this key, all old sessions will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. config.action_controller.session = { :session_key => '_base_session', :secret => '7389ea9180b15f1495a5e73a69a893311f859ccff1ffd0fa2d7ea25fdf1fa324f280e6ba06e3e5ba612e71298d8fbe7f15fd7da2929c45a9c87fe226d2f77347' } config.active_record.observers = :user_observer end ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default => '%d/%m/%Y') ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(:default => '%d/%m/%Y') require "will_paginate" ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :enable_starttls_auto => true, :address => "smtp.gmail.com", :port => 587, :domain => "XXXXXXXX.XXX", :authentication => :plain, :user_name => "XXXXXXXXXX.XXXXXXXXXX.XXX", :password => "XXXXX" } But the above just results in an SMTP auth error in the production log. I have read varied reports of this not working in Rails 2.2.2 but nothing for 2.3.5, anyone got any ideas? Thanks, Danny

    Read the article

  • Uninstall Rails 3 with dependencies?

    - by Trevor Burnham
    I like that Rails 3 is so easy to install: gem install rails --pre, and all of the dependencies are automatically installed for you. But, what about uninstalling it? If I just do gem uninstall rails, I still have 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) which I want to get rid of. What's the easiest way to do so?

    Read the article

  • Rails 3 Initializers: No such file to load

    - by waveslider
    I am trying to use the Sunlight API gem with a Rails project. I have installed the gem and can successfully use it from irb. However, when I put the require statement (require 'sunlight') in sunlight.rb in config/initializers, I get the following error: /opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.0.beta3/lib/active_support/dependencies.rb:209:in `require': no such file to load -- sunlight (LoadError) I checked the permissions on the gems directory, and it is world readable/executable. Here is the code from sunlight.rb: require 'rubygems' require 'sunlight' Sunlight::Base.api_key = 'bb7b775755054c54aa9715d202f6785c'

    Read the article

  • Anyone using RailRoad diagrams generator?

    - by cnicolaou
    I recently installed RailRoad gem to generate an .svg diagram of my app's models and controllers. The rake task keeps breaking with a similar error: 1.8/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:263:in `load_missing_constant': uninitialized constant I tried the rake task on 2 seperate apps and the error keeps appearing with a different "constant" name. Anyone using it with similar problems?

    Read the article

  • Rails date format in form field

    - by Jack
    Hello I'd like my dates in the mm/dd/year format in text fields. However, they currently displays as 2010-03-26. Is there a global setting I can set to change this? I tried the following, which seems to update the .to_s method, but form fields stay the same. ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default => '%m/%d/%Y') Thanks

    Read the article

  • Rails won't install on Ubuntu because of builder

    - by Jason Swett
    Can someone explain why gem thinks I don't have builder = 2.1.2 even though I clearly have 3.0.0? jason@ve:~$ gem install rails --pre ERROR: Error installing rails: activemodel requires builder (~> 2.1.2, runtime) jason@ve:~$ gem list *** LOCAL GEMS *** abstract (1.0.0) activesupport (3.0.3, 3.0.0.rc2) builder (3.0.0) erubis (2.6.6) i18n (0.5.0) mail (2.2.13) memcache-client (1.8.5) mime-types (1.16) polyglot (0.3.1) rack (1.2.1) rack-mount (0.6.13) rack-test (0.5.6) text-format (1.0.0) text-hyphen (1.0.0) treetop (1.4.9) tzinfo (0.3.23) jason@ve:~$

    Read the article

  • delayed job problem in rails.

    - by krunal shah
    My controller data_files_controller.rb def upload_balances DataFile.load_balances(params) end My model data_file.rb def self.load_balances(params) # Pull the file out of the http request, write it to file system name = params['Filename'] directory = "public/uploads" errors_table_name = "snapshot_errors" upload_file = File.join(directory, name) File.open(upload_file, "wb") { |f| f.write(params['Filedata'].read) } # Remove the old data from the table Balance.destroy_all ------ more code----- end It's working fine. Now i want to use delayed job with my controller to call my model action like .. My controller data_files_controller.rb def upload_balances DataFile.send_later(:load_balances,params) end Is it possible?? What's the other way to do it? Is it create any problem? With this send_later i am getting this error in column last_error in delayed_job table. uninitialized stream C:/cyncabc/app/models/data_file.rb:12:in read' C:/cyncabc/app/models/data_file.rb:12:inload_balances' C:/cyncabc/app/models/data_file.rb:12:in open' C:/cyncabc/app/models/data_file.rb:12:inload_balances' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/performable_method.rb:35:in send' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/performable_method.rb:35:inperform' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/backend/base.rb:66:in invoke_job' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:120:inrun' c:/ruby/lib/ruby/1.8/timeout.rb:62:in timeout' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:120:inrun' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:10:in realtime' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:119:inrun' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:180:in reserve_and_run_one_job' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:104:inwork_off' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:103:in times' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:103:inwork_off' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:78:in start' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:10:inrealtime' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:77:in start' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:74:inloop' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/worker.rb:74:in start' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/command.rb:93:inrun' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/command.rb:72:in run_process' c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:215:incall' c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:215:in start_proc' c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:225:incall' c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:225:in start_proc' c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:255:instart' c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/controller.rb:72:in run' c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons.rb:188:inrun_proc' c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in call' c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:incatch_exceptions' c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons.rb:187:in run_proc' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/command.rb:71:inrun_process' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/command.rb:65:in daemonize' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/command.rb:63:intimes' c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/command.rb:63:in `daemonize' script/delayed_job:5 Without send_later it's working fine... Is there any solution?

    Read the article

  • What's the best way to refactor this Rails controller?

    - by Robert DiNicolas
    I'd like some advice on how to best refactor this controller. The controller builds a page of zones and modules. Page has_many zones, zone has_many modules. So zones are just a cluster of modules wrapped in a container. The problem I'm having is that some modules may have some specific queries that I don't want executed on every page, so I've had to add conditions. The conditions just test if the module is on the page, if it is the query is executed. One of the problems with this is if I add a hundred special module queries, the controller has to iterate through each one. I think I would like to see these module condition moved out of the controller as well as all the additional custom actions. I can keep everything in this one controller, but I plan to have many apps using this controller so it could get messy. class PagesController < ApplicationController # GET /pages/1 # GET /pages/1.xml # Show is the main page rendering action, page routes are aliased in routes.rb def show #-+-+-+-+-Core Page Queries-+-+-+-+- @page = Page.find(params[:id]) @zones = @page.zones.find(:all, :order => 'zones.list_order ASC') @mods = @page.mods.find(:all) @columns = Page.columns # restful params to influence page rendering, see routes.rb @fragment = params[:fragment] # render single module @cluster = params[:cluster] # render single zone @head = params[:head] # render html, body and head #-+-+-+-+-Page Level Json Conversions-+-+-+-+- @metas = @page.metas ? ActiveSupport::JSON.decode(@page.metas) : nil @javascripts = @page.javascripts ? ActiveSupport::JSON.decode(@page.javascripts) : nil #-+-+-+-+-Module Specific Queries-+-+-+-+- # would like to refactor this process @mods.each do |mod| # Reps Module Custom Queries if mod.name == "reps" @reps = User.find(:all, :joins => :roles, :conditions => { :roles => { :name => 'rep' } }) end # Listing-poc Module Custom Queries if mod.name == "listing-poc" limit = params[:limit].to_i < 1 ? 10 : params[:limit] PropertyEntry.update_from_listing(mod.service_url) @properties = PropertyEntry.all(:limit => limit, :order => "city desc") end # Talents-index Module Custom Queries if mod.name == "talents-index" @talent = params[:type] @reps = User.find(:all, :joins => :talents, :conditions => { :talents => { :name => @talent } }) end end respond_to do |format| format.html # show.html.erb format.xml { render :xml => @page.to_xml( :include => { :zones => { :include => :mods } } ) } format.json { render :json => @page.to_json } format.css # show.css.erb, CSS dependency manager template end end # for property listing ajax request def update_properties limit = params[:limit].to_i < 1 ? 10 : params[:limit] offset = params[:offset] @properties = PropertyEntry.all(:limit => limit, :offset => offset, :order => "city desc") #render :nothing => true end end So imagine a site with a hundred modules and scores of additional controller actions. I think most would agree that it would be much cleaner if I could move that code out and refactor it to behave more like a configuration.

    Read the article

  • ruby1.9.1 - sqlite3 problem on ubuntu 9.10 x64 (no such file to load -- sqlite3)

    - by doriath
    Hi, I have problem with sqlite3, because it is not working. irb(main):001:0> require 'sqlite3' LoadError: no such file to load -- sqlite3 from (irb):1:in `require' from (irb):1 from /usr/bin/irb:12:in `<main>' I have installed following packages: sudo apt-get install ruby1.9.1-full sudo apt-get install rubygems1.9.1 sudo gem update --system sudo apt-get install sqlite3 libsqlite3-dev sudo gem install sqlite3-ruby sudo apt-get install libopenssl-ruby1.9.1 The applications has following versions: $ ruby --version ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux] $ sqlite3 --version 3.6.16 $ gem --version 1.3.6 and $ gem list --local *** LOCAL GEMS *** actionmailer (2.3.5) actionpack (2.3.5) activerecord (2.3.5) activeresource (2.3.5) activesupport (2.3.5) ffi (0.6.2) rack (1.0.1) rails (2.3.5) rake (0.8.7) rubygems-update (1.3.6) sqlite3-ruby (1.2.5) What have I missed?

    Read the article

  • Memcached broken pipe in rails

    - by abronte
    I seem to run into some random broken pipe errors if I try to access memcached a specific way. When I try to access memcached via Rails.cache, the first one or two reads/writes will result in a "MemCacheError (Broken pipe): Broken pipe" and return nil. But if I access memcached through a new object (ActiveSupport::Cache::MemCacheStore.new) I don't get the broken pipe error at all. I've tried upgrading to memcached 1.4.4 (was previously using 1.2.2) and I still got the error. I'm using rails 2.3.5. I would prefer to access memcached through Rails.cache because I takes namespaces into account. Any ideas?

    Read the article

  • Big Ruby/Rails 3 problems

    - by Oluf Nielsen
    Hey i got an White Macbook and, has to go in 10 hours to a Conf. and i having a lot of problems.. First, i wnated to have rails 3.. so i used MacPorts to install Ruby 1.8.7, it worked well ;) So now i was thinking i should nstall rails 3.. but no, no!.. it says.. $ sudo gem install rails --pre ERROR:   Error installing rails:                  activesupport requires Ruby version = 1.8.7. So what can i do? i have 1.8.7 !...

    Read the article

  • How can I prevent Rails from "pluralizing" a column name?

    - by Mike
    I'm using dwilkie's foreigner plugin for rails. I have a table creation statement that looks like: create_table "agents_games", :force => true, :id => false do |t| t.references :agents, :column => :agent_id, :foreign_key => true, :null => false t.references :games, :column => :game_id, :foreign_key => true, :null => false end However, this generates the following SQL: [4;35;1mSQL (2.7ms)[0m [0mCREATE TABLE "agents_games" ("agents_id" integer NOT NULL, "games_id" integer NOT NULL) [0m I want the columns to be called agent_id and game_id - not agents_id and agent_id. How can I prevent Rails from pluralizing the columns? I tried the following in my enviornment.rb file, which didn't help: ActiveSupport::Inflector.inflections do |inflect| inflect.uncountable "agent_id", "game_id" end

    Read the article

  • How can I install Ruby on Rails 3 on OSX?

    - by Oluf Nielsen
    Hey i got an White Macbook and, has to go in 10 hours to a conference. And I'm having a lot of problems. First, I wanted to have Rails 3, so I used MacPorts to install Ruby 1.8.7. Tt worked well ;) So now I was thinking I should install Rails 3.. but no, no!.. it says.. $ sudo gem install rails --pre ERROR:   Error installing rails:                  activesupport requires Ruby version = 1.8.7. So what can I do? I have 1.8.7 !

    Read the article

  • ruby on rails language problem "invalid byte sequence in GBK"

    - by user357203
    This is definitely a language issue, both of our code and our database contains Chinese characters. **This is my environment: About your application's environment Ruby version 1.9.1 (i386-mingw32) RubyGems version 1.3.5 Rack version 1.0 Rails version 2.3.5 Active Record version 2.3.5 Active Resource version 2.3.5 Action Mailer version 2.3.5 Active Support version 2.3.5 Application root C:/path_to_my_root Environment development Database adapter mysql Database schema version 20100327010640 **This is my localhost;3000 after running my ruby server: ArgumentError in HomeController#construction invalid byte sequence in GBK RAILS_ROOT: C:/path_to_my_root Application Trace | Framework Trace | Full Trace C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/ template_error.rb:43:in `split' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/ template_error.rb:43:in `source_extract' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/ template_error.rb:86:in `compute_backtrace' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/ template_error.rb:11:in `initialize' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/ template.rb:212:in `new' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/ template.rb:212:in `rescue in render_template' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/ template.rb:205:in `render_template' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/ base.rb:265:in `render' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/ base.rb:352:in `_render_with_layout' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/ base.rb:262:in `render' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/base.rb:1250:in `render_for_file' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/base.rb:951:in `render' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/benchmarking.rb:51:in `block in render_with_benchmark' C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/ active_support/core_ext/benchmark.rb:17:in `block in ms' C:/Ruby19/lib/ruby/1.9.1/benchmark.rb:309:in `realtime' C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/ active_support/core_ext/benchmark.rb:17:in `ms' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/benchmarking.rb:51:in `render_with_benchmark' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/mime_responds.rb:135:in `block in custom' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/mime_responds.rb:179:in `call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/mime_responds.rb:179:in `block in respond' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/mime_responds.rb:173:in `each' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/mime_responds.rb:173:in `respond' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/mime_responds.rb:107:in `respond_to' C:/Users/Howard/Documents/local/vjoin/app/controllers/ home_controller.rb:53:in `construction' ..... C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/ methodoverride.rb:24:in `call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/params_parser.rb:15:in `call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/session/cookie_store.rb:93:in `call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/failsafe.rb:26:in `call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/lock.rb:11:in `block in call' :8:in `synchronize' C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/dispatcher.rb:114:in `block in call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/reloader.rb:34:in `run' C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/ action_controller/dispatcher.rb:108:in `call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/rack/ static.rb:31:in `call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `block in call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each' C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/rails/rack/ log_tailer.rb:17:in `call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/ content_length.rb:13:in `call' C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/handler/ webrick.rb:50:in `service' C:/Ruby19/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service' C:/Ruby19/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run' C:/Ruby19/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread' Request Parameters: None Show session dump Response Headers: {"Cache-Control"=>"no-cache", "Content-Type"=>"text/html"} **What should I do? I tried to search online, didn't find much. The only thing I found was something like putting the following into application_controller: before_filter :set_charset, :set_locale def set_charset response.headers["Content-Type"] = "text/html; charset=utf-8" WIN32OLE.codepage = WIN32OLE::CP_UTF8 end but this still doesn't work. I am new to ruby on rails, so don't know much about it. Thanks for your help.

    Read the article

  • Testing Rails Metal/Rack with RSpec?

    - by Matt Darby
    Say I have a Metal class named Preview. How do I test it with RSpec? When I try: require 'spec_helper' describe Preview do it "should return the posted content" do post "/preview", :content => "*title*" response.body.should == "*title*" end end I get: undefined method `post' for #<ActiveSupport::TestCase::Subclass_1:0x1058b3098> It seems that RSpec doesn't load up the :post method if the test isn't explicitly for a Controller. I've tried specifying :type => :controller to no avail.

    Read the article

  • Rails - Multiple top level domains and a single session/cookie

    - by Thadius B
    Hello all, I've been struggling with this for quite awhile and haven't been able to find a solution. I need a user to be able to view multiple top level domains with a single login. My understanding is that this needs to be set in environment.rb and called with before_dispatch. This is what I've come up with: require 'activesupport' require 'dispatcher' module ActionController class Dispatcher def set_session_domain ActionController::Base.session_options.update :session_domain => "#{@request.host}" end before_dispatch :set_session_domain end end However, this does not seem to be working when I try and pull the values from session[:session_domain]. Any help is greatly appreciated.

    Read the article

  • Include FileUtils raises an error

    - by Bilal Aslam
    I am trying to install CruiseControl.rb on an Amazon EC2 instance. I get this error in the mongrel log: /data/cruisecontrol/releases/20100313003145/vendor/rails/activesupport/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant ProjectsMigration::FileUtils (NameError) This error is raised in a file called projects_migration.rb: http://gist.github.com/331025. Check out line 3, which I have commented out. If you remove the comment-out, you will get this error as well. The weird part: from ruby script/console I can include FileUtils just fine!

    Read the article

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