Search Results

Search found 13929 results on 558 pages for 'ruby on rails plugins'.

Page 22/558 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • when executing Powershell Script from Ruby "Can't convert true into String" error

    - by Ozie Harb
    I am trying to execute a powershell script from Ruby, I have entered the below command: scriptPath = system('powershell \"C:\\Scripts\\DB_Setup.ps1\"') The ruby Script is handling exceptions when an error is raised to stop the script as below command: rescue => ex message = "\nscript on server '#{`hostname`.strip()}' terminated unexpectedly:\n\nMessage: '#{ex.message}" raise ex Output Error: script on server 'TestDB1' terminated unexpectedly: Message: 'can't convert true into String' Thanks

    Read the article

  • Ruby generic filesystem libraries

    - by webdestroya
    I am looking for a "Virtual File System" type library for ruby. I want to be able to have a completely generic file system that I can easily switch between using Local files and using S3 or using FTP or something like that. (Identical to VFS for Java) Has anybody used any type of generic file system for ruby (I just need it to support local files and Amazon S3) Any pointers would be much appreciated.

    Read the article

  • Who's using Ruby on Rails in production?

    - by Jekke
    I've been kicking around Ruby and the rails framework and have been considering recommending to a client-of-a-client that they use it to rebuild their site, which is currently built in very bad ASP classic that will have to be rewritten from the ground up regardless of what technology is used. One thing I'm missing from my pitch is a list of major sites using Ruby-on-Rails. Are there any yet?

    Read the article

  • Parametrized get request in Ruby?

    - by Horace Loeb
    How do I make an HTTP GET request with parameters in Ruby? It's easy to do when you're POSTing: require 'net/http' require 'uri' HTTP.post_form URI.parse('http://www.example.com/search.cgi'), { "q" => "ruby", "max" => "50" } But I see now way of passing GET parameters as a hash using net/http.

    Read the article

  • Convert SQL query to Ruby help

    - by Verloren
    Hey all, I need to query my database table to find which employee has the most support tickets related to them. I can do this just fine using this MySQL query: SELECT employee_id, COUNT(id) AS number_of_tickets FROM tickets GROUP BY employee_id ORDER BY number_of_tickets DESC LIMIT 1; How would write this in Ruby-on-Rails? Thanks very much for your assistance. I use Ruby version 1.8.6, Rails version 2.2.2 and MySQL Server version 5.0.

    Read the article

  • floating point precision in ruby on rails model validations

    - by Chris Allison
    Hello I am trying to validate a dollar amount using a regex: ^[0-9]+\.[0-9]{2}$ This works fine, but whenever a user submits the form and the dollar amount ends in 0(zero), ruby(or rails?) chops the 0 off. So 500.00 turns into 500.0 thus failing the regex validation. Is there any way to make ruby/rails keep the format entered by the user, regardless of trailing zeros?

    Read the article

  • Ruby Rails _without_ ActiveRecord

    - by devlearn
    Hello, I'm looking for any pointers on how to write a rails web app without ActiveRecord. A doc or an example of a (not too complex) web app using storage backends other than a relational database would be greatly appreciated. It's not clear on what should be implemented in the model classes in order to make the rails app work without the ActiveRecord layer. Thanks,

    Read the article

  • Ruby On Rails and UTF-8

    - by Semyon Perepelitsa
    I have an Rails application with SayController, hello action and view template say/hello.html.erb. When I add some cyrillic character like "?", I get an error: ArgumentError in SayController#hello invalid byte sequence in UTF-8 Headers: {"Cache-Control"=>"no-cache", "X-Runtime"=>"11", "Content-Type"=>"text/html; charset=utf-8"} I use Windows 7 x64, Ruby 1.9.1p378, Rails 2.3.5, WEBrick server.

    Read the article

  • like-vim emacs ruby indentation

    - by edbond
    ruby-mode from svn, looks equal to 1.1 version here is emacs indentation of hash User.all({ :joins => :account, :conditions => {:delete_at => nil} }) here is the same in vim User.all({ :joins => :account, :conditions => {:delete_at => nil} }) How to make emacs indent like vim in ruby-mode?

    Read the article

  • Rails/Node.js interaction

    - by lpvn
    I and my co-worker are developing a web application with rails and node.js and we can't reach a consensus regarding a particular architectural decision. Our setup is basically a rails server working with node.js and redis, when a client makes a http request to our rails API in some cases our rails application posts the response to a redis database and then node.js transmits the response via websocket. Our disagreement occurs in the following point: my co-worker thinks that using node.js to send data to clients is somewhat business logic and should be inside the model, so in the first code he wrote he used commands of broadcast in callbacks and other places of the model, he's convinced that the models are the best place for the interaction between rails and node. I on the other hand think that using node.js belongs to the runtime realm, my take is that the broadcast commands and other node.js interactions should be in the controller and should only be used in a model if passed through a well defined interface, just like the situation when a model needs to access the current user of a session. At this point we're tired of arguing over this same thing and our discussion consists in us repeating to ourselves our same opinions over and over. Could anyone, preferably with experience in the same setup, give us an unambiguous response saying which solution is more adequate and why it is?

    Read the article

  • Backbone.js, Rails and code duplication

    - by Matteo Pagliazzi
    I'm building a web app and I need a JS framework like Backbone.js to work with my backend rovided by Rails that mostly return JSON objects after DB queries. Searching on the web I've discovered Backbone which seems to be complete, quite populare and actively developed but I've noticed that a lot of things done by Backbone are simply a duplicte of the works done by Rails: for example validation and models. My idea of "perfect" (for my actual needs) JS mvc (it can't be called mvc but i don't have any other names) is something really simple that has a function for each action in my Rails controller that are triggered by a specific event (user/hash changes, click on a button...) and send requests to the server that respond with a JSON object then I'll load a template or execute some JS code. Do you have any concern/suggestion about my idea? Do you know some "micro" js framework like what i have described? If you have worked with backone.js + rails what can you suggest me?

    Read the article

  • Error installing Rails on Ubuntu 11.10 (Gem::DependencyError)

    - by Paulo Cassiano
    I'm trying to install Ruby on Rails on Ubuntu 11.10, but receiving this error: $ sudo gem install rails ERROR: While executing gem ... (Gem::DependencyError) Unable to resolve dependencies: rails requires activesupport (= 3.2.3), actionpack (= 3.2.3), activerecord (= 3.2.3), activeresource (= 3.2.3), actionmailer (= 3.2.3), railties (= 3.2.3) How can I fix this? Note: Git (1.7.5.4 ) and Ruby (1.9.2p290) are installed properly.

    Read the article

  • Mavericks system Ruby and gem broken

    - by T1000
    When I tried to run ruby -v or gem -v (or any other command), I get: dyld: lazy symbol binding failed: Symbol not found: _ruby_run Referenced from: /usr/local/bin/ruby Expected in: /usr/lib/libruby.dylib dyld: Symbol not found: _ruby_run Referenced from: /usr/local/bin/ruby Expected in: /usr/lib/libruby.dylib This is after I ran rvm system to temporally switch to the system default Ruby. RVM is working fine, but I have a special need to install a gem to the system Ruby and I can't because of this problem. Does anyone know why? It seems to be some kind of link problem to Ruby, but I'm don't know how to solve this. I ran which ruby and it's at this point located in "/usr/local/bin/ruby". I checked the Ruby in "/usr/lib/" and it's pointing to my system Ruby: "../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/ruby" Any help would be appreciated.

    Read the article

  • Ruby on rails: Staring mongrel server

    - by spin-docta
    I know mongrel is the default server for "script/server" but when I do that command I get webrick. (I had it working before with mongrel). Now when I tell is to use mongrel ("script/server mongrel") the server fails to start up in the terminal. I get this: $ script/server mongrel ^C/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/gems.rb:11:in `require': Interrupt from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:17 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:521:in `new_constants_in' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `require' from /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:1 from /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/handler.rb:17:in `const_get' from /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/handler.rb:17:in `get' from /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/handler.rb:17:in `each' from /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/handler.rb:17:in `get' from /Users/devinross14/.gem/ruby/1.8/gems/rails-2.3.3/lib/commands/server.rb:45 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from script/server:3 I just upgraded to snow leopard if that helps...

    Read the article

  • Ruby number_to_currency displays a totally wrong number!

    - by SueP
    Greetings! I’m an old Delphi programmer making the leap to the Mac, Ruby, Rails, and web programming in general. I’m signed up for the Advanced Rails workshop at the end of the month. In the meantime, I’ve been working on porting a mission-critical (of course) app from Delphi to RAILS. It feels like I’ve spent most of the past year with my head buried in a book or podcast. Right now, I’ve hit a major issue and I’m tearing my hair out. I literally don’t know where to go with this, I desperately don’t want to deploy with this bug, and I’m feeling a bit frantic. (The company database is currently running on an ancient XP box that’s looking rustier by the day.) So, I set up a test database that shows the problem. I’m running: OS/X 10.6.3 Rails 2.3.5 ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0] MySQL 5.1.38-log via socket MySQL Client Version 5.1.8 ActiveRecord::Schema.define(:version => 20100406222528) do create_table “money”, :force => true do |t| t.decimal “amount_due”, :precision => 10, :scale => 2, :default => 0.0 t.decimal “balance”, :precision => 10, :scale => 2, :default => 0.0 t.text “memofield” t.datetime “created_at” t.datetime “updated_at” end The index view is right out of the generator, slightly modified to add the formatting that's breaking on me. Listing money <table> <tr> <th>Amount</th> <th>Amount to_s </th> <th>Balance to $</th> <th>Balance with_precision </th> <th>Memofield</th> </tr> <% @money.each do |money| %> <tr> <td><%=h money.amount_due %></td> <td><%=h money.amount_due.to_s(‘F’) %></td> <td><%=h number_to_currency(money.balance) %></td> <td><%=h number_with_precision(money.balance, :precision => 2) %></td> <td><%=h money.memofield %></td> <td><%= link_to ‘Show’, money %></td> <td><%= link_to ‘Edit’, edit_money_path(money) %></td> <td><%= link_to ‘Destroy’, money, :confirm => ‘Are you sure?’, :method => :delete %></td> </tr> *<% end %> *</table> <%= link_to ‘New money’, new_money_path %> This seemed to work pretty well. Then I started testing with production data and hit a major problem with number_to_currency. The number in the database is: 10542.28, I verified it with the MySQL Query Browser. RAILS will display this as 10542.28 unless I call number_to_currency, then that number is displayed as: $15422.80 The error seems to happen with any number between 10,000.00 and 10,999.99 So far, I haven’t seen it outside of that range, but I obviously haven’t tested everything. I guess my workaround is to remove number_to_currency, but that leaves the views looking really sloppy and unprofessional. The formatting is messed up, things don’t line up properly and I can’t force the display to 2 decimal places. I’m seriously hoping there is an easy fix for this. I can’t imagine this being a widespread problem. It would affect so many people that someone would have fixed it! But I don’t know where to go from here. I’d desperately like some help. (Later – number_with_precision fails the same way number_to_currency does.) Sue Petersen

    Read the article

  • Unit Testing a rails 2.3.5 plugin

    - by brad
    I'm writing a new plugin for a rails 2.3.5 app. I've included an app directory (which makes it an engine) so i can easily load some extra routes. Not sure if that affects anything. Anyway, in the test directory i have two files: test_helper.rb and my_plugin_test.rb These files were generated automatically using script/generate plugin my_plugin When I go to vendor/plugins/my_plugin directory and run rake test they don't seem to run. I get the following console output: (in /Users/me/Repos/my_app/source/trunk/vendor/plugins/my_plugin) /Users/me/.rvm/rubies/jruby-1.4.0/bin/jruby -I"lib:lib:test" "/Users/me/.rvm/gems/jruby-1.4.0/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/my_plugin_test.rb" So it obviously sees my test file, but none of the tests inside get run, I just get back to my console prompt. What am I missing here? I figured the generated code would work out of the box Here are the two files test_helper.rb require 'rubygems' require 'active_support' require 'active_support/test_case' my_plugin_test.rb require 'test_helper' class MyPluginTest < ActiveSupport::TestCase # Replace this with your real tests. test "the truth" do assert true end test "Factories are supported" do assert_not_nil Factory end end File structure vendor - plugins - my_plugin - app - config - routes.rb - generators - my_plugin - some generator files.rb - lib - my_plugin.rb - my_plugin - my_plugin_lib_file.rb - rails - init.rb - Rakefile - tasks - my_plugin_tasks.rake - test - test_helper.rb - my_plugin_test.rb

    Read the article

  • Ruby or Rails reporting tools?

    - by Anushank
    I am looking for a report generation tool in ruby or rails which allows the user to define a template, then fetch data into the created template. I have been looking through "The Ruby Box: reporting section." There are two reporting tools I have looked at: Thin Reports: It is really good. You can create your own report template with the template editor. Then you can produce PDF reports using thinreports gems. ODF Report: You can create a template ODF file using Open Office and MS Word, and you can use that template to generate the report. Both of these solutions lack the ability to draw charts. Does anyone know of similar reporting tools that can draw charts within a given report? I have tried the RTF Ruby Library. It works, but shares the limitation that it cannot draw charts and graphs. The minimum requirements are: Able to create customizable templates. (e.g. design layout, set font size, color, embed images etc.) Able to draw tables and charts. Template could be in Docx or excel or xml or any other common file format. Report output report must be in Docx or RTF format. Thanks

    Read the article

  • Rails app Hangs and Ruby uses 100% CPU

    - by tuzzolotron
    I have an apache2 server running Phusion Passenger. On this machine I have two virtual hosts setup each look like this (path's are different for the 2nd virtualhost...but other directives are the same) ServerName beta.mysite.us DocumentRoot "/var/www/beta/mysite/public" <Directory "/var/www/beta/mysite/public"> RewriteEngine on AllowOverride All Options FollowSymLinks </Directory> # http://www.modrails.com/documentation/Users guide.html PassengerAppRoot "/var/www/beta/mysite" RailsEnv development PassengerMaxPoolSize 6 PassengerDefaultUser mysite # PassengerHighPerformance does come at a trade off of lack of support for mod_rewrite PassengerHighPerformance off RailsSpawnMethod conservative RailsFrameworkSpawnerIdleTime 0 RailsAppSpawnerIdleTime 0 PassengerPoolIdleTime 300 ErrorLog "/var/log/httpd/mysite-beta-error_log" CustomLog "/var/log/httpd/mysite-beta-access_log" common Apache starts fine. I can go to one of the virtualhosts and it will load Rails and work. When I go to the second virtualhost, a ruby process spawns ("Rails: /var/www/mysite/current" according to ps awuxf) and uses 100% CPU. This process never exits. At this point neither virtualhost is responsive. If I kill the the offending ruby process, another ruby process replaces it and uses 100% cpu. If I kill these processes about 5-6 times, then both virtualhosts respond but they, are somehow, running the same Rails app?! I have another virtualhost on this machine that is not setup with phusion passenger..This one never exhibits any problems. Any help / ideas would be much appreciated!

    Read the article

  • Rails requires Rubygems but I have the gems

    - by fogonthedowns
    Update I notice that which ruby and whereis ruby are different locations which ruby /opt/local/bin/ruby whereis ruby /usr/bin/ruby I recently upgraded ruby to ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10] and I think I broke rails. When I attempt to load rails. I get an odd message. Please help! $ ruby script/server Rails requires RubyGems = 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org $ rails -v Rails 3.0.0.beta $ gem -v 1.3.6 $ which gem /usr/bin/gem $ whereis gem /usr/bin/gem $ which rails /usr/bin/rails $ whereis rails /usr/bin/rails $ /usr/bin/gem -v 1.3.6 $ /usr/bin/rails -v Rails 3.0.0.beta $ ruby script/console Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org $ gem list rails *** LOCAL GEMS *** rails (3.0.0.beta, 2.3.5, 2.2.2, 1.2.6) $ gem list *** LOCAL GEMS *** abstract (1.0.0) actionmailer (3.0.0.beta, 2.3.5, 2.2.2, 1.3.6) actionpack (3.0.0.beta, 2.3.5, 2.2.2, 1.13.6) actionwebservice (1.2.6) activemerchant (1.4.1) activemodel (3.0.0.beta) activerecord (3.0.0.beta, 2.3.5, 2.2.2, 1.15.6) activerecord-tableless (0.1.0) activeresource (3.0.0.beta, 2.3.5, 2.2.2) activesupport (3.0.0.beta, 2.3.5, 2.2.2, 1.4.4) acts_as_ferret (0.4.3) arel (0.2.pre) authlogic (2.1.3) builder (2.1.2) bundler (0.9.3) calendar_date_select (1.15) capistrano (2.5.2) cgi_multipart_eof_fix (2.5.0) chronic (0.2.3) columnize (0.3.1) compass (0.8.17) daemons (1.0.10) dnssd (0.6.0) erubis (2.6.5) fastercsv (1.5.0) fastthread (1.0.1) fcgi (0.8.7) ferret (0.11.6) flay (1.4.0) flog (2.4.0) gbarcode (0.98.16) gem_plugin (0.2.3) git (1.2.5) haml (2.2.15) haml-edge (2.3.100) highline (1.5.0) hoe (2.4.0) hpricot (0.6.164) i18n (0.3.3) javan-whenever (0.3.7) jeweler (1.4.0) jscruggs-metric_fu (1.1.5) json_pure (1.2.0) libxml-ruby (1.1.2) linecache (0.43) mail (2.1.2) mechanize (0.9.3) memcache-client (1.7.8) mime-types (1.16) mislav-will_paginate (2.3.11) mocha (0.9.7) mojombo-chronic (0.3.0) mongrel (1.1.5) needle (1.3.0) net-scp (1.0.1) net-sftp (2.0.1, 1.1.1) net-ssh (2.0.4, 1.1.4) net-ssh-gateway (1.0.0) nifty-generators (0.3.0) nokogiri (1.4.0) openrain-action_mailer_tls (1.1.3) passenger (2.2.5) polyglot (0.2.9) prawn (0.6.3) prawn-core (0.6.3) prawn-format (0.2.3) prawn-layout (0.3.2) prawn-security (0.1.1) rack (1.1.0, 1.0.1) rack-mount (0.4.5) rack-test (0.5.3) rails (3.0.0.beta, 2.3.5, 2.2.2, 1.2.6) railties (3.0.0.beta) rake (0.8.7, 0.8.3) rake-compiler (0.6.0) RedCloth (4.1.1) reek (1.2.6) relevance-rcov (0.9.2.1) rmagick (2.12.2) roodi (2.1.0) rsl-stringex (1.0.3) rspec (1.2.9) rspec-rails (1.2.9) ruby-debug (0.10.3) ruby-debug-base (0.10.3) ruby-openid (2.1.2) ruby-yadis (0.3.4) ruby2ruby (1.2.4) ruby_parser (2.0.4) rubyforge (2.0.3) rubygems-update (1.3.6, 1.3.5) rubynode (0.1.5) searchlogic (2.3.9) sexp_processor (3.0.3) spree (0.9.4) sqlite3-ruby (1.2.5, 1.2.4) termios (0.9.4) test-unit (2.0.5) text-format (1.0.0) text-hyphen (1.0.0) thor (0.13.0) tlsmail (0.0.1) topfunky-gruff (0.3.5) treetop (1.4.3) tzinfo (0.3.16) xmpp4r (0.4)

    Read the article

  • Installtion problems in ruby

    - by user26202
    Hello , I had ruby in my Red hat linux pc. I manually deleted the folders of ruby in /usr/lib and /usr/bin. Now when I try to install ruby again it says it conflicts with some files which does not exist. rpm -i ruby-libs-1.8.6.111-1.i386.rpm th file from package ruby-libs-1.8.5-5.el5 file /usr/lib/ruby/1.8/yaml/tag.rb from install of ruby-libs-1.8.6.111-1 conflicts with file from package ruby-libs-1.8.5-5.el5 What should I do now ?Can someone guide me. Regards, Mithun

    Read the article

  • Sqlite3 error after Rails 3 (beta 4) install

    - by elsurudo
    After Installing Rails 3, I get the following error regarding Sqlite3 when I try to do a migrate: dlsym(0x1037e5f10, Init_sqlite3_native): symbol not found - /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/sqlite3_native.bundle I am using Snow Leopard, if that makes a difference.

    Read the article

  • when to choose ruby on rails over java [closed]

    - by Dany Y
    I have been working with Java EE for 6 years, and I have mostly used it even for simple applications like data-entry to database). I heard Ruby on Rails is superior to Java in this domain. What are the actual advantages of Ruby. and should I switch ? P.S : I know this is a subjective question, and the most probable answer is "depends on what you'll use it for", but this is exactly what I want to know when to use what. Thank you

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >