|
What's the safest way to get a reasonably-up-to-date and version-matched build of Ruby and Rails in Ubuntu? apt-get install ruby rubygems, then gem install rails, then use rvm to install and set 1.9.3 active? How do I manage my version of rails? My attempts to manually install and use rvm for the initial installation failed horribly, for some reason gem would refuse to get anything. For example: gem install rails would produce a "package not found, count <= 0" error, and suggesting the alternate option 'rails'. I wiped my VM image to be sure and am trying again, but I want to do this right. Paul MaudDib fucked around with this message at 22:54 on Nov 16, 2011 |
# ? Nov 16, 2011 22:51 |
|
|
# ? May 14, 2024 16:48 |
|
You'll want to install RVM first, before rubygems. See if that helps. In an odd coincidence, lately I've been contributing to a set of instructions for that kind of thing. If you have any problems with the Ubuntu section (besides it not giving working urls for the rubygems packages for 8.04 and 8.10), please let me know: we're going to walk a ton of people through this on Friday, and I want to get out in front of any mistakes or unclear bits.
|
# ? Nov 16, 2011 23:19 |
Doc Hawkins posted:You'll want to install RVM first, before rubygems. See if that helps. Nice! But you might think about teaching Postgres if you're promoting Heroku.
|
|
# ? Nov 17, 2011 01:44 |
|
It doesn't really matter what RDBMS you're using as long as you stick to AR migrations. You can develop locally on sqlite and push to Heroku and Postgre without too much issue.
|
# ? Nov 17, 2011 02:44 |
|
NotShadowStar posted:Ruby forks aren't real OS forked processes, they're handled by the Ruby VM. If you're needing to do that for supporting multiple cores, fire up multiple Ruby processes communicating through DRB or something or use NodeJS. It just added true multithreading. Yeah could you elaborate on this and Bonzo's comment? I thought they were real processes (although information on multiprocessing in Ruby seems pretty scant), unlike the fake threads in 1.8.7.
|
# ? Nov 17, 2011 05:04 |
|
hepatizon posted:Yeah could you elaborate on this and Bonzo's comment? I thought they were real processes (although information on multiprocessing in Ruby seems pretty scant), unlike the fake threads in 1.8.7. Ruby forks are real processes (child of the parent). I think he might be thinking of ruby threads?
|
# ? Nov 17, 2011 17:00 |
NotShadowStar posted:It doesn't really matter what RDBMS you're using as long as you stick to AR migrations. You can develop locally on sqlite and push to Heroku and Postgre without too much issue. I've run into issues where my local sqlite queries ran fine, but imploded when I deployed to Heroku on postgres. For example, a simple case-insensitive search Works in SQLite: code:
code:
|
|
# ? Nov 17, 2011 20:28 |
|
Because you're writing a sql fragment that's database specific. If you want case insensitive downcase everything before it goes into the table instead of relying on the db Model.where("column LIKE '%?'", params[:butts].downcase) NotShadowStar fucked around with this message at 22:23 on Nov 17, 2011 |
# ? Nov 17, 2011 22:19 |
|
A MIRACLE posted:I've run into issues where my local sqlite queries ran fine, but imploded when I deployed to Heroku on postgres. code:
|
# ? Nov 17, 2011 22:47 |
Thanks guys
|
|
# ? Nov 17, 2011 23:07 |
|
For most simple crud apps, sure that's fine. But postgres has a ton of great features that you'll want to eventually take advantage of. Fulltext search that doesn't suck, using more than one index per query (sorry mysql), true serializable snapshot isolation, etc etc etc
|
# ? Nov 17, 2011 23:23 |
|
Pardot posted:For most simple crud apps, sure that's fine. But postgres has a ton of great features that you'll want to eventually take advantage of. Fulltext search that doesn't suck, using more than one index per query (sorry mysql), true serializable snapshot isolation, etc etc etc Database lock-in doesn't matter when it's the best and open-source.
|
# ? Nov 17, 2011 23:50 |
|
Just a quick question about Postgres. In a former (enterprise) life I used to be big into Oracle. I'm now using MySQL with our Rails projects and still a little uncomfortable with the syntax. I've heard that Postgres is similar to Oracle. Is this true? Is it worth checking out?
|
# ? Nov 18, 2011 06:24 |
|
If SQL is English than MySQL is German. It's... sort of like SQL but it doesn't adhere to any standard.
|
# ? Nov 18, 2011 06:51 |
|
8ender posted:Just a quick question about Postgres. In a former (enterprise) life I used to be big into Oracle. I'm now using MySQL with our Rails projects and still a little uncomfortable with the syntax. I've heard that Postgres is similar to Oracle. Is this true? Is it worth checking out? I would skip MySQL just based on how PHP-style bad it is; I've had the UI lie to me about InnoDB tables (which support ACID) when they were MyISAM on disk.
|
# ? Nov 18, 2011 17:44 |
|
8ender posted:Just a quick question about Postgres. In a former (enterprise) life I used to be big into Oracle. I'm now using MySQL with our Rails projects and still a little uncomfortable with the syntax. I've heard that Postgres is similar to Oracle. Is this true? Is it worth checking out? It is more similar than mysql by a long shot, and pl/psql is written to be oracleish, as I understand. I've never used oracle myself, though. Check out http://www.postgresql.org/docs/9.1/static/plpgsql.html
|
# ? Nov 18, 2011 22:44 |
|
Pardot posted:I've never used oracle myself, though. Lucky. I remember configuring Rails on my iBook to talk to the CS department's Oracle 8 server back in 2006, and it required downloading about a gigabyte of drivers and other poo poo.
|
# ? Nov 19, 2011 01:19 |
|
redatcted
Pardot fucked around with this message at 22:16 on Dec 8, 2013 |
# ? Nov 19, 2011 03:30 |
|
Anyone have experience with mailman (https://github.com/titanous/mailman) ? I'm looking to build a "dropbox" email address into one of our apps and this looks like it might save me some hassle but I'm at a bit of a loss as to the best way to integrate this. Cron or the Daemons gem? Or am I missing some better way here?
|
# ? Nov 19, 2011 06:45 |
|
holy moly, ruby 1.9.3 and rails 3.1.1 are a pretty amazing combination, speed-wise, compared to even 1.9.2 and 3.0. I have no proper metrics for this, but the app just feels really responsive, sub~20ms response times for each page request/load, etc. Got a web application up atm on a 512mb ram vmware VM (single core) used by approx 50-60 people at once, on a single thin balancer, and the load is negligible. And that's without caching! I'd love to see a 1.9.3 + 3.1.1 comparison vs a php framework, right now.
|
# ? Nov 19, 2011 13:48 |
|
Is anyone still experiencing git push issues with heroku? I keep timing out but the support page says everything is fixed.
|
# ? Nov 22, 2011 15:29 |
rugbert posted:Is anyone still experiencing git push issues with heroku? I keep timing out but the support page says everything is fixed. Not having any problems, pushed last night. Are you on Windows? I would just open a ticket with support, they're usually good about getting back to you. A MIRACLE fucked around with this message at 17:26 on Nov 22, 2011 |
|
# ? Nov 22, 2011 15:47 |
|
A MIRACLE posted:Not having any problems, pushed last night. Are you on Windows? Linux
|
# ? Nov 22, 2011 16:13 |
|
I made an abstracted method on a whim, but was curious if anyone had a way to clean it up. I can't figure out how to generate the proper Arel object that will take a receiver of Arel#or.code:
|
# ? Nov 23, 2011 21:30 |
|
Doc Hawkins posted:You'll want to install RVM first, before rubygems. See if that helps. I'm trying to use your tutorial to install rails for a school project, and I'm having an issue where when I try to start the rails server, it can't find the java script runtime, even though I've install the JRE and JDK. Any tips? Edit: Nope, I'm using Ubuntu in a VM. vvvvvvvvvvvvvvvvvvvv Edit2: That didn't work Edit3: Got it working with execjs and nodejs TheAsterite fucked around with this message at 04:41 on Nov 28, 2011 |
# ? Nov 28, 2011 03:01 |
|
JavaScript, not Java. Completely different (albeit similarly-named) technologies. Unless you know you need a specific JS runtime, gem install therubyracer and you should be set. No guarantees that won't be incredibly painful if you're on Windows; I haven't tried it.
|
# ? Nov 28, 2011 03:16 |
|
I'd like to use the Yelp! API with my app to search for businesses near locations associated with models in my DB. The way I envision it is with a SearchController for managing requests, probably with just an index action. I think that the business logic of fetching the search results (connecting to api.yelp.com, authenticating, sending the request, receiving the results) should be handled by a model, but I'm unsure of where to start with this. I'm fairly sure this Search model should stay the hell out of the database, so it won't be subclassing ActiveRecord. Should I look into subclassing ActiveModel instead? Another issue I might have is that my Rails app will be stuck waiting for the results from Yelp! and won't be able to serve other requests in the meantime, which could really suck. Is there anything I should be reading about this?
|
# ? Nov 30, 2011 04:38 |
|
Your models don't have to subclass AR, that's just the most common. I've written models that don't subclass anything and they perform File I/O. So you can make a standalone class that handles the business of communicating with Yelp.
|
# ? Nov 30, 2011 16:17 |
|
Sorry for this, but I am copying code from the tutorial guide, and it's giving me all types of errors. I have Rails 3.1.1, and ruby 1.9.2p290.code:
code:
Edit - I'm sorry for breaking the tables, not really sure how to fix it. I'm a mess. Newbsylberry fucked around with this message at 00:13 on Dec 1, 2011 |
# ? Dec 1, 2011 00:10 |
I'm a noob help me. I want my form select tags to retain their search parameters. code:
|
|
# ? Dec 1, 2011 00:49 |
|
Newbsylberry posted:Sorry for this, but I am copying code from the tutorial guide, and it's giving me all types of errors. I have Rails 3.1.1, and ruby 1.9.2p290. You have an unmatched parens in the fourth line. Whatever book you have, it's awful.
|
# ? Dec 1, 2011 01:17 |
|
Probably, but I'm awful in this scenario, I just copied it wrong. I actually spotted it right when I hit refresh in TCOC. Unfortunately that didn't solve my problems, really my issue is that I'm an idiot and have @attr_merge, instead of @attr.merge. Also an error on my end, not with the book. Sorry for wasting your time.
|
# ? Dec 1, 2011 01:27 |
|
A MIRACLE posted:I'm a noob help me. The trick here is that any view form helper that ends with "_tag" is *not* for dealing with models. So select(), is for dealing with models (i.e. inside "form_for :bla do |form|"), whereas select_tag is a bit more generic and requires more customization. Try this: code:
code:
manero fucked around with this message at 19:34 on Dec 1, 2011 |
# ? Dec 1, 2011 19:31 |
manero posted:You're the man! The second example did the trick. I guess I'll learn to use select_tag instead of select in the future. e: Anyone know how to escape the html `options_from_collection_for_select` produces? I'm getting some &-amp's in my options tags. I tried calling raw, html_safe on it to no avail. A MIRACLE fucked around with this message at 22:48 on Dec 2, 2011 |
|
# ? Dec 2, 2011 21:52 |
|
I'm trying to have a website with several sub sites that have similar dynamic features (forums, users, etc.), but have different static pages, links, etc. What's the best way to do this? I'm still a newb, but I want to do the right stuff now to make my life easier in the future. It may be a long answer, so if people want to just point me in the right direction I can google up a storm.
|
# ? Dec 4, 2011 20:16 |
|
There is a Radiant extension that adds support for multisites, if that's the approach you want to take. It's a few years old now, but the concept is basically the same: associate all content models with a site model, and load the correct site on each request based on the request.host. request.host may have been replaced in Rails 3, I don't remember for sure. Source code: https://github.com/radiant/radiant-multi-site-extension Railscasts has a subdomain example, which you could also modify for your needs: http://asciicasts.com/episodes/221-subdomains-in-rails-3 CanCan's ability.rb allows you to restrict access to objects based on attributes. So you could easily do something like: code:
hmm yes fucked around with this message at 05:11 on Dec 5, 2011 |
# ? Dec 5, 2011 05:05 |
|
My company does a bunch of stuff like what you're describing, Newbsylberry, and we built a gem for dealing with some of it - https://github.com/bradrobertson/apartment Basically, the idea with it is that this gem will switch over to different databases (or schemas if you're using postgres on heroku) depending on something like the subdomain of the request coming in (or really whatever you want). We like it a lot better than the scoping thing everyone tends to do since you don't need to add columns like site_id to every table in your app, and once you have things set up, you don't need to think about it (other than running a different version of db:migrate)
|
# ? Dec 5, 2011 12:56 |
|
Unless the sites are going to share users, I'd just put each one in a separate Heroku instance and maybe write a rake task that git pushes to each one to deploy. That way you don't have to worry about columns or schemata at all.
|
# ? Dec 5, 2011 13:12 |
|
BonzoESC posted:Unless the sites are going to share users, I'd just put each one in a separate Heroku instance and maybe write a rake task that git pushes to each one to deploy. That way you don't have to worry about columns or schemata at all. Yeah, actually I tend to skip by this approach and it's effective as long as you're not sharing data or have a large number of sites (large being anything more than 5 or so in my experience). We actually used this approach at my company until the number of clients became infeasible to manage separately.
|
# ? Dec 5, 2011 13:23 |
|
|
# ? May 14, 2024 16:48 |
|
enki42 posted:Yeah, actually I tend to skip by this approach and it's effective as long as you're not sharing data or have a large number of sites (large being anything more than 5 or so in my experience). We actually used this approach at my company until the number of clients became infeasible to manage separately. How hard was it to switch after that? I'm trying to figure out what will best serve my current need, and not limit me in the future. Right now I just need that division to demonstrate that it's possible, so what Bonzo suggested would be perfect. In the future though, I want to have the users of the subsites also be able to interact at a higher level. So if the subsites are neighborhoods, in the future it would be nice to have them interact within their city as well as their neighborhood, and so on. If anyone has reading I can look over so I don't feel so overwhelmed that would be sweet. I really appreciate your patience, let me know if there is a better place to ask my newb questions. Or if I should just start a new thread to contain all my issues.
|
# ? Dec 5, 2011 15:39 |