|
If you guys had put this book on the first page, I wouldn't have bought it today, since I found it is free online after I came home! Oh well, the author gets a sale and a couple bucks, and I really needed a book this weekend. http://railstutorial.org/ruby-on-rails-tutorial-book
|
# ¿ Jan 9, 2011 03:32 |
|
|
# ¿ Apr 27, 2024 12:49 |
|
Sub Par posted:Ok, so I'm on Windows (Vista) on my laptop, and everything I read says that it is best to develop on Linux. So I've read about using Linux via Virtual PC 2007, and gotten that working, but I can't seem to get Ubuntu 10.10 to install all the way - it hangs halfway through. It's starting to piss me off, so now I'm about to try Gentoo, but is it really a bad idea to develop on Windows? Is all the trouble I'm going through to get this going gonna be worth it? Just use Windows for a while. So far it seems like everyone who uses Ruby has a Mac... I am up and running on Fedora 14, haven't tried my MacBook Pro yet. VirtualPC is windows-only but apparently this will let you run Ubuntu: http://www.sysprobs.com/install-ubuntu-1010-virtual-pc-2007-windows-7-host Alternatively, try VirtualBox.
|
# ¿ Jan 9, 2011 04:37 |
|
I started making a message forum, and I wonder what the 'Rails-way' would be to handle new posts, versus replies and replies with quotes. In php I would just have the options in the url new post, resulting in new topic: code:
code:
code:
Bob Morales fucked around with this message at 19:18 on Mar 6, 2011 |
# ¿ Mar 6, 2011 19:14 |
|
A MIRACLE posted:I'm a rails noob working through a tutorial. I added a CSS layout to my template and now the method buttons like "Show", "Edit" etc include a path, like "Show /bugs/field_samples/3". That code is on the button itself? Do a pastebin or put the code in your post so we can see, and maybe a screenshot of the actual app. This tutorial does a few things like buttons with Blueprint - http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
|
# ¿ Mar 17, 2011 02:18 |
|
Is anyone using Pow? http://pow.cx/ With Pow, there are no preference panes to install. No Apache configuration files to update. And Pow eliminates the need to edit /etc/hosts. To get a Rack app running, just type a single command. Looks like it's Rails 3 only, though.
|
# ¿ Apr 11, 2011 15:24 |
|
Anyone being affected by the Heroku outage? Don't we have a goon or two that work there?
|
# ¿ Apr 21, 2011 21:21 |
|
So, is Ruby missing a 'case' construct or what?code:
|
# ¿ May 2, 2011 21:39 |
|
Just code from work. I don't know why they wrote it that way. There's also tons of IF NOT/UNLESS FALSE instead of 'if' as well.
|
# ¿ May 3, 2011 15:25 |
|
Pardot posted:My guess is that it was written by C programmers used to using magic negative return values for errors. Used to be a .NET/ASP shop, I guess. What are you guys using to find errors in your production apps? Here's what we have now:
|
# ¿ May 3, 2011 18:08 |
|
NotShadowStar posted:Try Hoptoad. It's really popular with iOS devs and they have Rails components. We're basically using gmail+filters based on the app causing them, and the type (javascript, etc). I think we're just hoping for something magical that will identify 'real' errors before the users do. I think what we really want is other sources of errors.
|
# ¿ May 3, 2011 18:51 |
|
NotShadowStar posted:The fact you say that developers are ignoring errors getting sent to them is telling me there's a systemic development problem. The problem is there's a few hundred a day so they get ignored, unless they start repeating. And they're probably things that should be fixed anyway. But they might as well be 'warnings'. Like I said, until a user contacts a CSR with something like "Hey, this page is showing up wrong" or "This button doesn't work on the site", we don't know about the problem. The bad thing is that when you have a CSR come up to you 5 times a day, you can't get other stuff done. Some stuff is application problems but other stuff is things like issues with certain browsers and/or general web stuff, that the devs don't need to be bothered with and I, or an intern can fix. CSS changes and crap like that.
|
# ¿ May 3, 2011 19:16 |
|
Obsurveyor posted:My guess: No tests. We're going to have a meeting about this tomorrow, I think. I'll bring up the goal of 'zero exceptions'. I think the biggest problem is that we have ~15 apps, and they are all basically copies of the first app. The core application is the same but the 'gimmick' of each one is different. You're basically entering in information, but in one program you might be using a Javascript basketball court, one uses a Javascript 'blender' that you put vegetables in, etc. You have 'teams' of people and you record progress of eating vegetables/fruits, recording steps, exercise minutes, whatever the gimmick is for that app. So basically we'll have poo poo left over from one that doesn't belong in another. Or we'll update/fix stuff in one, but the other doesn't get the updates. I'd say that's often due to laziness, but some of the changes are specific to that app for whatever reason. For instance, yesterday a CSR couldn't remove a user from a program because the user model was trying to remove 'locations' from an exercise table, but this app doesn't use locations to track exercise, just minutes.
|
# ¿ May 3, 2011 19:54 |
|
Trabisnikof posted:Yeah, I have no idea how to get my shop to use tests. I've mentioned it before and there really is no interest in it. The one guy actually told me to not bother learning them because they don't use them, back when I first interviewed.
|
# ¿ May 3, 2011 21:44 |
|
NotShadowStar posted:Just looking at those exception titles, that doesn't look at all like stuff that should be 'just warnings' but serious application errors that need to be drat well fixed. I had pretty big Rails apps that went for a good long while without a single exception thrown, and lots of other people do as well. Latest update: quote:I love that zero-tolerance idea. But "you have to fix this" conflicts with "you have to build that" where "this" is yesterday's app and "that" is tomorrow's.
|
# ¿ May 4, 2011 14:06 |
|
BonzoESC posted:I worked in a shop like that, where the pressure to deploy anything at all was interfering with my ability to make quality software. I came here from being a sysadmin at a place where I had zero to do (and took a pay+benefits cut to come here). This is my first actual programming job even though I've been toying around with various languages etc for the last 15 years. I'm also in the mid-west where there aren't any tech jobs that don't suck, so I have to either build some experience here for a while and then move, or go back to sysadmining po-dunk networks. They also hired me with 5 days RoR experience
|
# ¿ May 4, 2011 14:26 |
|
What's the 'main' page of my app called, or does it have a file name? Basically what I want to do is allow Googlebot to index https://www.myapp.com as well as stuff like https://www.myapp.com/info or https://www.myapp.com/about But nothing else. I can allow the other pages but if I disallow / in the robots.txt, it can't hit https://www.myapp.com. Which is expected.
|
# ¿ May 9, 2011 20:24 |
|
atastypie posted:http://guides.rubyonrails.org/routing.html#using-root We have :welcome routed like that, but for some reason it doesn't work the way I want it to. They're just visiting / which goes through, and not /welcome I'm just going to block all the ones we don't want in the robots.txt. Basically what happens is we get Exceptions from GoogleBot hitting random pages in our site that it shouldn't be. Or at least, we don't expect it to be. customer-subdomain.ourapp.com/register/demo-password/ and stuff like that (which is actually done in AJAX)
|
# ¿ May 9, 2011 23:21 |
|
Pardot posted:Unrelated to your problem, but I'd strongly advise against subdomains. They make full stack integration testing much harder than it has to be. And there's not much business value in subodmains. Most people don't know what browser they're using let alone care what the url looks like. Everything I've read agrees with you, but they're 100's of customers and ~ 20 products in. I put the robots.txt in yesterday, and Googlebot is still hitting us. code:
|
# ¿ May 10, 2011 13:35 |
|
Our web server puked this morning. Rackspace kept blaming Passenger/Rails, they couldn't get Apache restarted. What was wrong? /tmp was full! We have an image upload in a couple of our apps (company logos and poo poo like that, not image barn), and the programmer who wrote it didn't delete the temp files created. Ooops.
|
# ¿ May 24, 2011 00:41 |
|
Linux guys, what are you using for a development setup? Are you choosing a distribution that has a current version of Ruby and then just installing rubygems, or are you compiling your own stuff?
|
# ¿ May 25, 2011 03:44 |
|
What are some ways of issuing a shell command from a rails app and showing the user the output? For example, I'd have a list of network interfaces on the server, and you could click on button to turn the interface on/off, send a ping, or release/renew the DHCP address. These would just issue commands or run scripts I have written. There's be some sort of indicator icon in the same row as the interface icon that told the status, but I'd like some sort of box that displays the output from that script or command for more information.
|
# ¿ Jun 24, 2011 01:25 |
|
Plastic Jesus posted:You really, really, really don't want to execute shell commands from a script that accepts user-supplied data. I also doubt that you'd want to be able up/down a network interface or change its IP address via a web application. It would be for a couple internal people to use, instead of ssh'ing into the server and running commands. It'd actually be for 'clone database', 'sync database' and 'dump database'
|
# ¿ Jun 24, 2011 13:47 |
|
This is almost a cross-post from the SQL, thread, but how do you guys balance your hardware resources between your web and DB server? We're running Ruby with Apache/Passenger (should we look into nginx or something else?) My main question is should our web server have 12GB of vRAM, would it better used for our DB server? The server is has 3 vCPU's, Xeon L5520 @ 2.27GHz. The Ruby/Apache server has 5, and also has 12GB. Wouldn't it make more sense to give the DB server more RAM and maybe equal out the CPU's? Not sure if it's a single quad with HT enabled, or a dual-quad with HT disabled. Maybe we should enable HT and give each server 8 vCPU? Any tips on my.cnf settings for InnoDB? Going from this site: http://www.mysqlperformanceblog.com...b-memory-usage/ I've decided to change the following settings on our server. code: innodb_buffer_pool_size=8096M innodb_flush_method=O_DIRECT innodb_thread_concurrency=6 innodb_flush_log_at_trx_commit=2 innodb_log_buffer_size=4M cat /proc/meminfo on the server shows: MemTotal: 12299960 kB MemFree: 2467744 kB Our ibdata1 file is 16G
|
# ¿ Jul 15, 2011 23:50 |
|
Pardot posted:Is there a reason you're using mysql instead of postgres? No clue, I've only been here a few months. Their database originates back to when they were an ASP shop. I changed the DB stuff around this morning, don't notice any difference but I'll get a better idea on Monday since we're really only busy M-F 8am-8pm.
|
# ¿ Jul 17, 2011 01:40 |
|
Abel Wingnut posted:I'm looking to further my skills and develop some database intensive sites. I'm new to Ruby, PHP, and SQL but have significant experience with HTML and CSS. How should I proceed? Will learning Ruby teach me what I need to know about PHP and SQL, or should I learn the basics of PHP and SQL and then transition smoothly to Ruby? PHP has really nothing to do with Ruby other than the fact that they are both programming languages. PHP is similar to C, if you've ever used that. Ruby on Rails is a framework for Ruby for making web applications. SQL is another ball of wax. You should probably learn the basics of it, but it's possible to do an application in Ruby without any SQL at all. Play around with Ruby here, it's fun! http://tryruby.org/ If you like that, I'd get started with Rails here: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
|
# ¿ Jul 20, 2011 01:46 |
|
Stup posted:Make sure you're using the 4th edition of Agile Web Development with Rails if you're working in Rails 3.x, and the 3rd edition if you're working with 2.2 or 2.3 You should see how many notes I have written in our copy of the 2nd edition. Any tips on reducing the amount of memory our Ruby and httpd processes take? code:
|
# ¿ Jul 21, 2011 19:40 |
|
NotShadowStar posted:1.8 or 1.9? Ruby Enterprise Edition version 1.8.7-2010.01 The server isn't busy right now and it's down to just under 8GB memory used
|
# ¿ Jul 22, 2011 01:39 |
|
NotShadowStar posted:I think you're reading angry blogs from 2006 because everything you said is completely not true. Twitter runs on Rails. Groupon runs on Rails. Amazon has lots of Rails internally. People are actively identifying performance issues in Rails and attacking them head on. Rails 3 is way faster than anything ever. The Ruby language is not deliberately gimped by a single entity like Zend so you have to go and buy the 'enterprise' from Zend to un-gently caress the interpreter. It seems like I've read a bunch of blog articles about replacing this part and that part of Twitter with Java (or something else) in place of Rails. On a side note, our first 'Rails 3' app does something goofy and freezes our server up a couple times a day. The server also runs Rails 2 apps so we are going to throw up another virtual server or something just for that app, and future apps. 3.09, I'm not sure exactly what's going on with it but another of our developers said it's a problem plenty of others are having.
|
# ¿ Jul 29, 2011 03:58 |
|
revmoo posted:I'm definitely handicapped. I read Agile web development basically cover to cover last week and didn't really get anything out of it. I'm just used to PHP, which while it is a very messy, ugly language, works very well for web app development and is actually documented. Did you read it, or are you actually working through it?
|
# ¿ Jul 29, 2011 04:00 |
|
Turns out we have Passenger 2.2.x which doesn't have smart spawning, and we need to upgrade our production server to Passenger 3.0, which our staging server has been running.
|
# ¿ Jul 29, 2011 13:59 |
|
What's going on here?code:
|
# ¿ Aug 10, 2011 21:04 |
|
Plastic Jesus posted:It means 'loop through indexes 1 to 99 in the array @promotion.evaluations'. for the c folk this would be Gotcha. In this particular case they'd want ALL the evaluations for the promotion so I'm not sure why they would put 0-99. Ugh.
|
# ¿ Aug 10, 2011 21:45 |
|
What would be a good (or bad) way to add users to a system service (say email, that uses a plaintext config file for user info) from a Rails web interface? So if someone signs up, they get added to /etc/passwd and have an shell account? Is there something really, really wrong with just doing 'exec adduser -whatever username'?
|
# ¿ Aug 14, 2011 19:43 |
|
Any suggestions for a captcha setup that works well with Ruby? Basically looking to slow down a brute-force login attempt by adding it as a requirement after say, 4 failed logins. Ideas other than a captcha would be entertained as well, account lockout for a period of time, and making each login take longer to process than the previous one have been ruled out.
|
# ¿ Sep 13, 2011 14:50 |
|
BonzoESC posted:http://rubygems.org/gems/recaptcha Thanks. https://github.com/kiskolabs/humanizer was suggested, but it only works with Rails 3. Our newest app is on Rails 3 but the rest are on 2, and it'd be nice to use the same thing in the older apps if that need arises.
|
# ¿ Sep 13, 2011 18:07 |
|
We now have two Rails 3 apps. When we deployed the first one, it ate all our memory and crashed the server. The second one did the same thing the other day.code:
Rails 3.0.7 (new app 1) uses considerably more memory than Rails 3.0.9 (new app 2) -- but neither is as good as Rails 2.x or 1.x in terms of memory usage. For example, after serving 333 requests, one <old app> process (a Rails 2.x app) is using 69MB of RAM. On the other hand, after serving 64 requests, one <new app 1> orocess (a Rails 3.0.7 app) is using 207MB of RAM. I chose those two apps because they have so much in common that it seems like the only difference is the Rails framework. I set passenger to kill (new app 1) processes after 75 requests. It looks like a bunch of memory is eaten on each request and it's not released. But if you kill the process, then the OS will reclaim the memory. No idea what's causing it though. It's (new app 1)-specific because (new app 2) is a Rails-3 app that does not have any problems. Memory leak of some sort? Garbage collection?? Rackspace wants a good-sized amount of money to add another 24GB to our server (split into 12gb app, 12gb db VM's) But if we signed up another big customer or deploy a third rails 3 app, we'll just be eating up a ton more memory anyway.
|
# ¿ Sep 22, 2011 16:23 |
|
Ruby 1.8.7 (2009-12-24 patchlevel 248) Ruby Enterprise Edition 2010.01 Passenger 3.0.7 I am looking at setting up memprof right now, I'm just not sure what could I should be checking (or what the easiest way to check all of it is)
|
# ¿ Sep 22, 2011 18:48 |
|
code:
Also memprof.com isn't working so I don't know if that's part of the error, I'm trying to just get it to dump to a file by giving a made-up key and using the -f option
|
# ¿ Sep 22, 2011 19:57 |
|
BonzoESC posted:https://github.com/ice799/memprof seems to make it look like you want the Rack Middleware doing the dirty work, but you might want its output to go somewhere other than your production log. My boss was spergin' out on me earlier for spending time working on this. Then he showed me stuff in New Relic for 2 hours "This is where you will find the problem", after I kept asking him how it was going to tell us what was making the processes grow and grow, the longer they ran. It doesn't have anything to do with how long a page loads or how long a SQL query takes! He also said if we throw hardware at it now, we'll just have to throw hardware at it in the future. There's no interest in adding additional web servers and a load balancer. Test suite? ahahaah We moved the offending app to 3.0.9 so we'll see what happens today.
|
# ¿ Sep 23, 2011 13:32 |
|
|
# ¿ Apr 27, 2024 12:49 |
|
What are some good blogs/articles about setting up multiple front-end web servers with a load balancer (an all free-software Linux solution is preferred)? Right now we have a single web server running Apache/Passenger and a MySQL database server. We'd like to have 2+ web servers due to traffic, and for redundancy. Our database is 20GB and grows about a gig a month, but a lot of that data is 2+ years old and not used anymore. My boss was playing with the sliders on the Rackspace Cloud configuration page and basically said "We can get 4 8GB cloud servers for what we pay for our 1 server now..." but I tried to explain to him it's not quite that simple.
|
# ¿ Sep 27, 2011 02:57 |