Advertisement

900 organizations, including eBay, Ericsson and Lockheed Martin, now work smarter with Corporate Accounts. Save up to 42%!

 

Welcome! If you have any general questions about Experts Exchange, feel free to ask me.

 
Top Ruby Solutions: 1 - 22 of 22
  • 1
 
I am trying to start up a rails project and I run: rake db:create And I get: Couldn't create database for {"encoding"=>"utf8", "username"=>"root", "adapter"=>"mysql", "host"=>"localho...
This should be simple: text = 'adam|paul|mike' I want to replace that with   ->   <b>adam</b><b>paul</b><b>mike</b> So each name seperated by a |  OR a name at the end of the string s...
This is purely a self learning exercise, I'm not sure whether this is going to be possible or not, though I'm sure it would allow for some great flexibility in future code. What I want, is ...
Hello, I have a Ruby application that uses SQLite3 (with sqlite3-ruby). Sometimes it crashes with a SQLite3::BusyException. I think I could fix this with a begin...rescue...end block, but f...
I am trying to subtract 2 numbers; the numbers come from different sources (one from the Internet, the other from a table in a database where its type is decimal. If they both have the same...
Hello all, I am looking into creating a small ruby script that will ftp into my remote server and download all the files ending with .tar.gz, after they have been downloaded I then delete t...
When I try to access the RoR home page on http://localhost:3000, I see the page. But, when I try to access the same using the network host name of my machine, the page fails to load. telnet...
Hey, I am running this: gem install rails --version 2.1.2 To update my gem and I get: WARNING:  Installing to ~/.gem since /Library/Ruby/Gems/1.8 and        /usr/bin aren't both writable...
Hello Have a problem whereby when selection records seperated by "" delimiter - some fields are being chopped and passed to next line - below is my script so far ... File.open("U:/TEST.TXT...
Let me start by saying that my ultimate goal is to have a listing of items grouped by release date (using distance_of_time_in_words) and sorted in chronological order. This is what I've do...
Here is a data file and I want to know how long it takes from Start to Complete for each job.   I think I need to convert the date / time into something that Ruby can work on easy.   1...
I want to be able to have an input txt file with a structure as follows: var1 = "value1" var2 = 'value2' var3 = value3 var4 = 52+545 I want to be able to take the input from that file...
Hello, I would like to learn a (preferably simple) way to e-mail a textfile as an attachment from within a Ruby program (without Rails). If there is not a simple way in Ruby itself, a Li...
I am migrating a intranet server from Fedora 8 to RHEL5.  On the Fedora 8 servers I have: ruby-mysql-2.7.3-2.fc8 ruby-libs-1.8.6.287-2.fc8 ruby-1.8.6.287-2.fc8 On the RHEL5 box I have: ...
OK, this is my 4th line of ruby code so you can say I am new.  I do know shell a bit. Code: directorylist = %x[sjirdtag   `inquire | grep i500 | cut -f1  -d :` ] directorylist.each { |i|...
What is Rails?  I've heard of Ruby on Rails and another language that I forget on Rails.  I've also heard of RailSpace.  I think that Ruby is a computer language ( that I don't know ) but I've...
I am having trouble in getting the value from an input field in a form. The value is modified via an rjs file and the form shows the value in the field after the rjs  file has modified it. ...
I have a hash with the key generated by distance_of_time_in_words. I want to be able to sort that hash chronologically instead of alphabetically. How would I do that? i.e., the keys in my h...
Hi, is there a conditional operator in Ruby like the ? in C/C#, ie x = y == nil ? 0 : 1 I know you can do x = if (y == nil) then 0 else 1 end Just wondering if the more compact is ...
Hello Have a problem loading gems when at work - no problem at home - probably firewall? Could someone look at the attached error log taken from when I tried to install a gem and hopefully g...
one = Time.now two = Time.now I know I can do "print (one - two).to_I and get the days.   I need a simple way to get the difference in seconds ( or minutes ). I basicly want to fl...
Hello Below is my script to upload data to microsoft access - but need to know how to remove the carriage returns which shows in access by a little square box at end of text in access field. ...
 
  • 1