|
ufarn posted:Updating rvm and running sudo rvm upgrade 2.0.0 allowed me to upgrade Ruby, but the bundle command isn't recognized. Think it involves playing with my env vars. You need to install bundler. It doesn't come with Ruby. See smol's post. sudo chown -R [yourusername]:admin /usr/local/* to fix your Homebrew install's permissions. sudo chown -R [yourusername]:staff ~/.rvm to fix your rvm install's permissions. (Assuming it's configured for the defaults.) And once you've done that, quit using sudo for Homebrew or rvm. It's not required for and should not be used with either of them. Homebrew in fact will refuse to run under sudo unless something royally fucks with its permissions. (Which is what happened, judging by your issues and your brew doctor output.)
|
# ? Sep 15, 2013 18:30 |
|
|
# ? May 15, 2024 03:11 |
|
Bundle(r) was already installed, but still wouldn't work, but using those two lines fixed it. Thanks so much.
|
# ? Sep 15, 2013 18:34 |
|
Just deployed to heroku. Things are going ok, but when I created the app locally it was for mysql. Now I am trying to switch to postgreSQL. The heroku documentation says my database.yml file gets overwritten with the right info, but it doesn't seem to be working.code:
|
# ? Sep 18, 2013 05:23 |
|
If I'm already kinda familiar with Python, what would the advantages be of learning Ruby? What can it offer me that Python can't?
|
# ? Sep 18, 2013 05:49 |
|
Pollyanna posted:If I'm already kinda familiar with Python, what would the advantages be of learning Ruby? What can it offer me that Python can't? There's a gem called HTTParty, I'm not really sure what other kinds of questions you might have but they all seem less important in light of that.
|
# ? Sep 18, 2013 05:56 |
|
KoRMaK posted:
https://devcenter.heroku.com/articles/rails-asset-pipeline#troubleshooting Scroll down to the trouble shooting section. I believe this answers your question.
|
# ? Sep 18, 2013 06:13 |
|
Pollyanna posted:If I'm already kinda familiar with Python, what would the advantages be of learning Ruby? What can it offer me that Python can't? They're similar enough that I wouldn't say there are technical reasons to learn. There might be social/employment reasons to learn: more than one Rails-using company in town recruits Python developers just because they get going in Ruby with less training than PHP or J-language developers.
|
# ? Sep 18, 2013 16:01 |
|
I'm having a hell of a time testing a redirection from a named route. Ruby code:
code:
Lexicon fucked around with this message at 18:00 on Sep 18, 2013 |
# ? Sep 18, 2013 17:24 |
|
What spec file? What does the rest of it look like? I can't tell from that snippet what's going on.
|
# ? Sep 18, 2013 17:47 |
|
Oh My Science posted:https://devcenter.heroku.com/articles/rails-asset-pipeline#troubleshooting The backgrounds for the other slides in the carousel bootstrap layout don't load. I'm not sure whats up with that.
|
# ? Sep 18, 2013 17:55 |
|
Cocoa Crispies posted:What spec file? What does the rest of it look like? I can't tell from that snippet what's going on. Sorry, that's the whole thing, other than 'require spec_helper' at the top. The route /fooblar is set in the routes file and matched to a particular controller method.
|
# ? Sep 18, 2013 18:02 |
|
As far as I can tell this is more of a Rails issue than a jQuery issue. I'm currently working on making babby's first webapp and when I explicitly put <script src="the-path-to-jquery-ui-on-the-internet"></script> I can display a modal, but when I put //= require jquery-ui in my application.js it doesn't let me use the dialog() function, which is from jquery-ui. Am I missing something obvious?
|
# ? Sep 19, 2013 06:45 |
|
it is posted:Am I missing something obvious? Are you using the jquery-ui-rails gem? If so it's //require jquery.ui.all https://github.com/joliss/jquery-ui-rails
|
# ? Sep 19, 2013 07:50 |
|
I am not. I fixed this; what was necessary was some combination of rake assets:precompile, deleting the files from /public/assets, and deleting /public/javascripts. Thanks!
|
# ? Sep 19, 2013 08:11 |
|
I learned the importance of "require jquery_ujs". I thought it was jquery_uis which would be a redundant include. The it dawned on me "ujs = unobstrusive javascript." It's got what remote forms crave. I spent an hour trying to figure out why my :remote => true form submit's were refusing to submit as js.
|
# ? Sep 19, 2013 20:24 |
|
Peristalsis posted:Oh, and one more question. kayakyakr posted:Did you reload owner1 between creating your new product object? Otherwise, it'll probably just cache the last products lookup. Are you use the product object is saving and are you sure that's the proper id? In case anyone is interested, I think the issue here was that I hadn't saved the model objects consistently, since I was just monkeying around in rails console. If I have owner1 linked to product1 as above, but haven't saved either of them, then owner1.products returns an array with product1 in it, but product1.owner doesn't return anything. I can't reload product1, presumably because it isn't in the database yet, so I think I just have to (carefully) save things before trying to use this particular voodoo.
|
# ? Sep 19, 2013 23:17 |
|
I'm trying to create an app that allows the user to keep a log of their weight changes. I'd like there to be one weight per day, and if the user puts in 2 different numbers on the same day, then it overwrites the original. Right now, my code to create the new weight iscode:
\/\/\/ Awesome, it's working now, thanks! Coco13 fucked around with this message at 02:20 on Sep 20, 2013 |
# ? Sep 19, 2013 23:47 |
|
Coco13 posted:When the # is removed, it says 'unknown key: user_id'. First, why does it recognize 'user_id:' in the where statement, but not the find? Second, is there a better way to do this that I'm missing? Find only accepts the primary key (id) as a parameter. If you want to find by a given field or fields, you want find_by: code:
code:
code:
Enforcing a single weight record per day is also ostensibly more appropriate in the model than the controller, and you could implement a callback there (before_create, maybe?) to do it. Molten Llama fucked around with this message at 01:51 on Sep 20, 2013 |
# ? Sep 20, 2013 01:34 |
|
You could use #find_or_initialize_bycode:
This code probably should go into the model, or possibly into a DailyWeightSaver service class if this application isn't tiny.
|
# ? Sep 20, 2013 03:45 |
|
Not related to your question and you may just not have gotten to it yet, but you're going to want to ensure you are forcing time zones. Date.today will use the system clock, not the Rails time zone, and further you probably want to allow users to define what zone they are in.
|
# ? Sep 20, 2013 12:33 |
|
Cocoa Crispies posted:They're similar enough that I wouldn't say there are technical reasons to learn. That is actually something I was wondering about. The most common languages I see requested on job websites and such are C#/.NET, Java, and SQL, with RoR showing up depending on what I search for. I'm most familiar with Python, so I had been thinking of learning one of those languages just so I'm more hireable. What can I say, I need a job. Also, I was trying out Ruby on some web-based trial...thingy, and I noticed that strings and the like can be modified like, "Jimmy".reverse. Does that mean that each string in Ruby is an object, with associated methods like "reverse"? Or does it work differently in this language?
|
# ? Sep 21, 2013 21:19 |
|
Almost everything in ruby (including things like classes, or even the class Class) is an object that you can modify or call methods on. But note that String#reverse doesn't actually modify the receiver, it just returns a new, reversed string.
Smol fucked around with this message at 23:37 on Sep 21, 2013 |
# ? Sep 21, 2013 22:32 |
|
I tried running RailsInstaller, but I get this during installation:quote:There has been an error. I looked it up online and apparently the solution is literally to reboot your computer? To be honest, I've always had trouble getting Ruby installed on OSX. RVM and stuff like that always broke for some reason, and I'm sick of trying to figure out what the loving problem is. Would it be worth it to just wipe OSX clean of anything Ruby except for what it came with? Is there a "best" installation manager to use for RoR?
|
# ? Sep 21, 2013 23:03 |
|
Install Homebrew then use it to install RVM (or better RBENV).
|
# ? Sep 21, 2013 23:34 |
|
I managed to get RailsInstaller going, and it includes lotsa poo poo like RVM JRuby RBENV Homebrew etc. I assume if I have all that, then I have pretty much anything I need?
|
# ? Sep 21, 2013 23:59 |
|
I guess, but the current version seems to install Ruby 1.9.3 and Rails 3.2. If you're just starting out, you might as well use Ruby 2 and Rails 4.
|
# ? Sep 22, 2013 01:22 |
|
Well, I think I finally managed to get my computer to stick with Ruby 2 and Rails 4. What are some good recommended tutorials for learning stuff in Ruby?
|
# ? Sep 22, 2013 01:47 |
|
Rails Tutorial will teach you how to make a Twitter clone. Rails for Zombies will teach you how to make a Twitter clone for zombies.
|
# ? Sep 22, 2013 03:46 |
|
rails tutorial is good and will teach you a lot of other useful skills (git, if you dont know it already) and probably taught half the people in this thread
|
# ? Sep 24, 2013 00:03 |
|
You're going to need an introductory Ruby course first. Do you have experience programming? I don't think that it's the best way to learn, but you could give Code Academy's Ruby stuff a shot if you wanted a bit of handholding to get started. I really liked Rails Tutorial, but it's going to suck to do if you know no Ruby at all.
|
# ? Sep 24, 2013 00:08 |
|
If you're looking at books, The Well Grounded Rubyist really clicked for me.
|
# ? Sep 24, 2013 00:18 |
|
What's the best way to set up a date field with an optional month and day? (i.e. if something was made at some unknown point in time in 1850, it would return just the year)
|
# ? Sep 25, 2013 00:50 |
|
EAT THE EGGS RICOLA posted:What's the best way to set up a date field with an optional month and day? (i.e. if something was made at some unknown point in time in 1850, it would return just the year)
|
# ? Sep 26, 2013 21:30 |
|
Cock Democracy posted:I've never used it but there's this gem. From the looks of it, they don't tackle the whole "how do I store this in the database" issue. The answer to that is the tstzrange data type SQL code:
|
# ? Sep 26, 2013 21:47 |
|
I have a static "info" page under public/info.html. Is there a simple way to like, have a link to that page on the bottom of every page in my application? Or do I have to add it manually to every view?
|
# ? Sep 26, 2013 22:16 |
|
Legacyspy posted:I have a static "info" page under public/info.html. Layouts are your friend. If you're using layouts for your views, put the link in the layout(s). If you're not using layouts, use layouts. Or if it needs to be in a different place on each page (and even multiple layouts won't cut it), you could always plop a method into ApplicationHelper to generate the link.
|
# ? Sep 26, 2013 22:48 |
|
But seriously, not using layouts is like not using controllers. Use a layout!
|
# ? Sep 27, 2013 00:37 |
|
Pardot posted:The answer to that is the tstzrange data type Please tell me that's pronounced tee-steez-range.
|
# ? Sep 27, 2013 01:04 |
|
Fillerbunny posted:Please tell me that's pronounced tee-steez-range. Haha. Well it's short for timestamptz, which is short for timestamp with timezone, which is the ONLY DATATYPE YOU SHOULD USE TO STORE TIME. loving rails and defaulting to timestamp without timezone for the created_at and updated_at columns. I should send a patch but
|
# ? Sep 27, 2013 01:20 |
|
|
# ? May 15, 2024 03:11 |
|
How do you set that in a migration?
|
# ? Sep 27, 2013 01:22 |