I am just diving into Heroku and have hit a bit of a snag. Whenever I attempt to create my database I am getting the following error.
$ heroku rake db:migrate
rake aborted!
no such file to load -- tasks/rails
/disk1/home/slugs/274236_54c3556_0822-55414a07-d565-459a-9412-67cc0e995790/mnt/Rakefile:10:in `require'
(See full trace by ru...
Are there protocols/solutions/messaging system that allows me to communicate between languages AND servers?
Eg. I want to be able to communicate between one server running Java (or Ruby, Python etc) on the backend and one server running Javascript also on the backend.
The solution I use now is HTTP REST.
Are there other solutions that...
Hello,
I'm recieving an error ECONNABORTED, and i really can't figure out, what is the cause of it. The IBM guide suggests that it is because of a timeout, but that doesn't ring the bell for me. I don't know where to start so here are few questions.
a) accept() is the only thing needed to establish a connection - i mean no other functi...
When learning Ruby, I noticed that in all the examples there are no semicolons. I am aware that this is perfectly fine as long as each statement is on its own line. But what I am wondering is, can you use semicolons in Ruby?
Thanks in advance!
...
Hello.
I have managed to setup autocomplete field for my rails app. What I'm trying to do is to have the contents of a lookup table listed and when I have selected the lookup text for few lines I would like the id of the lookup to be saved instead of the text itself. Here is what I have done:
Recipe model:
class Recipe < ActiveRecor...
I have a decent amount of web development and programming experience with C, C++ and several markup languages. In order to expand my knowledge I've decided to learn Ruby and I'm wondering what you guys recommend as being the best way to teach it to yourself. I took a quick browse through the books available at Amazon but nothing immediat...
I'm using Netbeans and JRuby to develop a Rails web application.
But for deployment, I will be using Heroku.
Since Heroku uses the Ruby-C implementation, I was wondering my use of JRuby can cause problems? Is this approach a safe thing to do?
...
I need to make certain output from views dynamic based on the "type" of user logged in. Specifically, the user "type" is based on the type of business they are in and using my application, so if they are a retail store my application needs to refer to "customers", "products", "purchases", etc. whereas another type of user in a services-b...
Hi, I have the following Ruby program:
require 'date'
class Person
def initialize(name, dob)
@name = name
@dob = dob
end
def age
Time.now - @dob
end
def marry(someone)
"Life: " + age.to_s
end
end
fred = Person.new('Fred', Date.new(1934, 4, 16))
p fred
p fred.age.to_s
p fred.marry(1)
But ruby 1.9.2 gives error:
#<P...
Hello,
I have the exact same problem posted here a year ago:
http://stackoverflow.com/questions/1347853/ruby-loop-failing-in-thread
Here the code (pretty much the same as in the topic above)
class NewObject
def my_funk
t = Thread.new {
until false do
puts sleep 15 # sleeps way too much
...
Hi everyone,
I wrote a little ruby script using optparse. I'd like to pass a list of files to my script using optparse. I would like to add a couple of files using wildcards (e.g. /dir/*). (Background: simple script, that writes all given arguments to a single text file, separated by newline.)
I tried this:
opts = OptionParser.new
o...
How do I obtain a reference to the current element in the iteration?
{{#my_array}}
<p>{{__what_goes_here?__}}</p>
{{/my_array}}
I hope I am just overlooking the obvious.
...
I use RVM with ruby 1.9.2 and Rails. When I try to generate a scaffold for my Rails app, I get this error:
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- script/../config/boot (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from script/generate:2:in `<main>'
Is there something w...
This code is failing on the last line specifically due to the check for table_exists? How do I correctly do this in Datamapper?
require 'sinatra'
require 'DataMapper'
DataMapper::setup(:default, "sqlite3://#{Dir.pwd}/blog.db")
class Post
include DataMapper::Resource
property :id, Serial
property :title, String
propert...
I am trying to write tests for a date helper class. I am wondering what is best practice for this.
Here is an example in PHP.
public static function get_date($offset = 0){
$date = mktime(0, 0, 0, date('m') , date('d') + $offset, date('Y'));
return array(
'day' => date('D',$date),
'month' =...
Ruby version: 3.0.2
Rails: 1.9.2
OS: windows 7
DB: sql server 2008 (r2)
I tried to execute the following command: rails generate model product
The error I get can be seen here: pastebin.ca/1965168
I tried to follow these two sites:
rubyrailsandwindows.blogspot.com/2008/03/rails-2-and-sql-server-2008-on-windows_24.html
www.lostechies....
I've installed Ruby (1.8.7 via apt-get) and I installed Rails (2.3.2 via rubygems) but when I type 'rails newapp', I get this error:
The program 'rails' is currently not installed. You can install it by typing: sudo apt-get install rails
rails: command not found
When I run 'gem list' it shows rails and all of it's dependencies. Any id...
Hi Stack Overflow,
Ruby n00b here. I copied the following ruby code from the internets and made a few changes.
#insert teh codes here
But it doesn't work!
Please help. What can I do to debug the program by myself?
Thanks in advance,
Andrew Grimm
...
For some reason, in vim whenever there is a line of ruby code with a function including parentheses, eg: string = gets() without a semicolon the next line is indented a level. When there is a semicolon, it works fine. Any ideas as to why this is happening and how to fix it? Also, since it will probably be requested, here is my ~/.vimrc
...
Hi!
I have a small crawler/screen-scraping script that used to work half a year ago, but now, it doesnt work anymore. I checked the html and css values for the reg expression in the page source, but they are still the same, so from this point of view, it should work. Any guesses?
require "open-uri"
# output file
f = open 'results.csv'...