|
what does code:
Regardless of if multiple ruby binaries show up for some retarded reason (which is my lame guess atm), I'd be happy to dick around in an irc room or on AIM and get you up and running. I like playing around with new frameworks, but I loathe getting them setup because of crap like this. dustgun fucked around with this message at 04:24 on Aug 19, 2009 |
# ? Aug 19, 2009 04:18 |
|
|
# ? May 15, 2024 01:35 |
|
1.8.6, no other version. AIM is wagedomain if you want to try and help out, but I'll probably be idling all night until tomorrow.
|
# ? Aug 19, 2009 04:34 |
|
Myrddin Emrys posted:Total newbie here, just picked up my first RoR book and tried my hand at installing it on Linux. I really don't want to be a human being, but do you have a Mac around? 10.5 works completely out of the box, Apple made everything work perfectly, all you need to do is 'sudo gem update' from a fresh install and you're ready to rock. I have to go through a few pits of hell every time I try and get Ruby going on Ubuntu. They way the maintainer packaged it makes it all kinds of hosed up. I always end up compiling from source, but then I have to track down a dozen -devel libraries from the repos.
|
# ? Aug 19, 2009 04:51 |
|
NotShadowStar posted:I really don't want to be a human being, but do you have a Mac around? 10.5 works completely out of the box, Apple made everything work perfectly, all you need to do is 'sudo gem update' from a fresh install and you're ready to rock. No, sorry. I had a macbook a year or so ago but I couldn't stand the keyboard. I am a fast typer and it literally could not keep up with my typing, so I ditched it. Got a Toshiba Satellite but that fell off a bus and broke. I'm working now on a netbook (which I am pleasantly surprised runs Linux and Windows 7 incredibly well). I no longer have a Windows install on it though. I'm also shopping around for a kickass but relatively inexpensive gaming laptop, but the netbook's all I've got for now.
|
# ? Aug 19, 2009 05:17 |
|
NotShadowStar posted:I have to go through a few pits of hell every time I try and get Ruby going on Ubuntu. They way the maintainer packaged it makes it all kinds of hosed up. I always end up compiling from source, but then I have to track down a dozen -devel libraries from the repos. Not only that, but the ubuntu compiled ruby is supposed to have some performance problems that you don't get if you build ruby yourself. However, I use ruby enterprise edition on our one ubuntu CI box.
|
# ? Aug 19, 2009 07:09 |
|
Myrddin Emrys posted:No, sorry. I had a macbook a year or so ago but I couldn't stand the keyboard. I am a fast typer and it literally could not keep up with my typing, so I ditched it. Got a Toshiba Satellite but that fell off a bus and broke. I'm working now on a netbook (which I am pleasantly surprised runs Linux and Windows 7 incredibly well). Don't ever try and work with Ruby on Windows. Lots of C-based Ruby libraries expect gcc which of course you don't get on Windows. Either the maintainer or some volunteer built a binary for you to use or you're totally screwed. sqlite is a major one. I've been doing Ruby for about 4-5 years and I still hit a brick wall hard when it comes to working on Windows. I can try and walk you through a compile and install, or if you can give a user-level temporary shell I can build everything and you can do the final install. I wish the Ruby maintainer in Ubuntu/Debian would just give up, this is a really really common problem and they don't know what they're doing.
|
# ? Aug 19, 2009 16:31 |
|
Sewer Adventure posted:I know it is quite un-rails but is there an equivalent of php output buffering (ob_start) in rails? I'm trying to store the result of a partial for a particular object in the db rather than render it every time. If it's for caching purposes stick with fragments, but if it's something else you can use capture.
|
# ? Aug 19, 2009 17:34 |
|
NotShadowStar posted:I can try and walk you through a compile and install, or if you can give a user-level temporary shell I can build everything and you can do the final install. I wish the Ruby maintainer in Ubuntu/Debian would just give up, this is a really really common problem and they don't know what they're doing. Sure, a walkthrough would be great, definitely have to be complete with versions as I've learned certain versions of rails/ruby/gems don't work together nicely. I did try a manual build/install (whee ./configuration, make, sudo make install!) I ran into issues with this once though, as I'm not a super awesome linux guru, I had no idea how to UNINSTALL something that I built myself - so synaptic and the filesystem got out of whack. dustgun posted:what does I realized I gave you my output for ruby -v, not a which. Which says /usr/local/bin/ruby.
|
# ? Aug 19, 2009 17:54 |
|
Well, my friend tried installing ruby/rails/gems on Debian and had no issues. I couldn't even INSTALL Debian because it's a netbook, and booting from the USB worked but it bitched at me for not being a "CD-ROM", like it was hardcoded in the installer or something. So, now I'm going to try Fedora 11. Myrddin Emrys: breaking Linux one distro at a time!
|
# ? Aug 20, 2009 02:55 |
|
Happy update! Installed Fedora 11 and used yum to install ruby/gems/rails and no more errors I can now do the book's exercises!
|
# ? Aug 20, 2009 04:32 |
|
Hooray. I felt horrible last night when I realized I'd totally spaced out and forgotten about my offer to help out on AIM.
|
# ? Aug 20, 2009 14:48 |
|
dustgun posted:Hooray. I felt horrible last night when I realized I'd totally spaced out and forgotten about my offer to help out on AIM. Haha no worries. I'm liking what I see so far, though admittedly I haven't delved too deep. It's a refreshing change from .NET, though.
|
# ? Aug 20, 2009 19:25 |
|
I know ruby 1.8 but never so much as glanced at 1.9 until I saw how god damned fast it was and that rails now supports it. I know 1.9 has some major, incompatible changes with 1.8, so what's the best way to learn it? Is there a webpage out there with a list of changes, and is that enough to learn 1.9? Or should I get the new 1.9 pickaxe to compliment my 1.8 pickaxe? What about O'Reilly's 'The Ruby Programming Language'? A lot of people are saying it's better than the pickaxe, and it says it covers both 1.8 and 1.9, but it was published 18 months ago, is the 1.9 info still accurate?
|
# ? Aug 21, 2009 00:48 |
|
I hated the Pickaxe. It reads like a Java refugee's first trip with Ruby, and in reality that's exactly what it is. Dave Thomas used to be a Java dude and discovered Ruby, so you see this weird Java-Rubyish naming convention and Java style programming. The Ruby Programming Language co-written by Matz points out the differences between 1.8 and 1.9 where applicable. That book is good for a reference instead of learning. There really isn't THAT big of a difference between 1.8 and 1.9 if you're doing pure Ruby. I suggest just doing what you always do using 1.9, then consult the RPL book if things go wrong.
|
# ? Aug 21, 2009 03:48 |
|
Did anyone here do Rails Rumble this year? I worked on morsurl.com, which is a URL shortener that lets you add highlighting to the page you're linking to. We got a bit of a late start but I'm still pretty happy with what we got done in that time.
|
# ? Aug 24, 2009 04:24 |
|
I've spent all day trying to get prawnto & prawn to render layouts. I want to shoot myself in the face and I think I'm just going to hack something up so that ... something something and then it works. In short, someone make a better PDF creation plugin for rails.
|
# ? Aug 24, 2009 21:16 |
|
dustgun posted:I've spent all day trying to get prawnto & prawn to render layouts. I want to shoot myself in the face and I think I'm just going to hack something up so that ... something something and then it works. What's wrong with pdf-writer? Magicmat posted:I know ruby 1.8 but never so much as glanced at 1.9 until I saw how god damned fast it was and that rails now supports it. I know 1.9 has some major, incompatible changes with 1.8, so what's the best way to learn it? Is there a webpage out there with a list of changes, and is that enough to learn 1.9? Or should I get the new 1.9 pickaxe to compliment my 1.8 pickaxe? What about O'Reilly's 'The Ruby Programming Language'? A lot of people are saying it's better than the pickaxe, and it says it covers both 1.8 and 1.9, but it was published 18 months ago, is the 1.9 info still accurate? There aren't really that many differences. Just update your ruby binary and run your old projects and see what breaks. My main project (~5000 LOC) only had 2 or 3 places that required minor changes. Took maybe 30 minutes to upgrade. The biggest gotcha had something to do with require and load paths, but I can't remember the specific problem at the moment.
|
# ? Aug 26, 2009 15:54 |
|
Help me out, guys. This is a painful wall I've been running into for the last several hours, and I'm unable to Google anything useful. This is probably something more Ruby and less Rails specific, but this is still probably the better thread to ask the question, as it's still Rails related. So I'm making my blog in Rails, and I want to intermingle my blog posts with Facebook status updates. The two ways I've looked into to access the Facebook status updates are: 1. Use Facebooker to access the data. The problem with this is that I don't think it's meant to work quite like that - it seems to be more about allowing the user log in and access their data as opposed to having the application log in and access a single user's data. 2. Use my status RSS feed. This is the one I need some assistance with. So I found this link which allowed me to get an RSS feed of my own status updates. I then found this page which pointed me in the direction of opening/parsing that RSS feed. Everything comes together, right? Nope. When I run the code in that last link, the content of 'response' is not the XML of the RSS feed I want, but it's the Facebook page telling me that I'm using an incompatable web browser. Yes, ruby's 'open' is not Firefox, IE, etc. My question is - how do I get around this and make ruby's open function identify as a given browser? Or what else should I do instead of use open? Kimani fucked around with this message at 11:28 on Aug 28, 2009 |
# ? Aug 28, 2009 11:22 |
|
Which direction are you wanting to go, pulling from facebook to blog or from blog to facebook?
|
# ? Aug 28, 2009 20:49 |
|
You can pass HTTP headers when opening a URL by including them in a hash as the second parameter (documentation here). For example:code:
|
# ? Aug 28, 2009 22:54 |
|
NotShadowStar posted:Which direction are you wanting to go, pulling from facebook to blog or from blog to facebook? sorghum posted:You can pass HTTP headers when opening a URL by including them in a hash as the second parameter (documentation here). Thanks!
|
# ? Aug 29, 2009 05:15 |
|
So I'm fairly new to RoR, and I'm really liking it. I've been maintaining a site that was built before I got here. I have kind of a strange migration question, though. So right now, according to script/about, we're running Ruby 1.8.6 and Rails 1.2.3: code:
|
# ? Sep 11, 2009 18:07 |
|
Fangs404 posted:What's with the discrepancy in Rails versions? You can have any number of versions of any gem, including rails. The app itself is picks which one to use, which doesn't have to be the most recent version you have installed. As an aside, you don't have the newest version that's been released which is 2.3.4. In config/environment.rb check to see if there is RAILS_GEM_VERSION = '1.2.3'. I don't really remember 1.2, so it might be different back then. That's how you set which version to use now. Or, check to see if you have rails vendored in vendor/rails. Also, be aware that rails 3 is due out soon.
|
# ? Sep 11, 2009 18:37 |
|
Pardot posted:Also, be aware that rails 3 is due out soon. Really? Last I heard, a November release was going to be iffy.
|
# ? Sep 11, 2009 20:01 |
|
Pardot posted:You can have any number of versions of any gem, including rails. The app itself is picks which one to use, which doesn't have to be the most recent version you have installed. As an aside, you don't have the newest version that's been released which is 2.3.4. Ah, I do indeed see RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION. So if I understand you right, all I have to do to migrate to 2.x is change that line to say RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION (once we update to 2.3.4 from 2.2.2), run rake rails:update, update plugins, and fix any bugs that we encounter?
|
# ? Sep 11, 2009 20:23 |
|
I highly recommend vendoring your rails.
|
# ? Sep 11, 2009 20:25 |
|
jonnii posted:I highly recommend vendoring your rails. I'll check into this. I don't even know what that means. [edit] Oh, snap, this looks great. Sounds like it'll make pushing our test code to the live server a whole lot simpler. I'll definitely look more into this. Thanks.
|
# ? Sep 11, 2009 20:37 |
|
Fangs404 posted:I'll check into this. I don't even know what that means. Additionally I suggest vendoring everything you can. Plugins, gems, the works. It's really easy to do it now in rails 2.x: In environment.rb config.gem "thoughtbot-clearance", :lib => 'clearance', :source => 'http://gems.github.com', :version => '0.8.2' Then you can run: rake gems:install rake gems:unpack
|
# ? Sep 11, 2009 21:24 |
|
In essence you can copy Rails into the project instead of relying on system-installed Rails. It's good for keeping things static. Is this a public server? I'd be scared running 1.x of Rails because of the litany of vulnerabilities that have sprung up since then.
|
# ? Sep 11, 2009 21:25 |
|
Thanks for the info guys. Vendoring definitely sounds like it's the way to go. And yeah, this is a public live server. I kind of inherited this project, and upgrading Rails is my top priority.
|
# ? Sep 12, 2009 03:08 |
|
I'm following a tutorial(You need to register to view it) from IBM; have downloaded RoR and the gems I need. I'm using Windows Vista. I've created a new project and then I run the command "ruby script/server". This appears to run fine. However, when I enter "http://localhost:3000/" into my browser it can't find the page. I've tried googling around but no one else seems to have gotten this problem. I tried one solution attempt of reseting winsock but it didn't do anything. When I ran the server first I told the firewall to unblock it and I've tried running it with the firewall off. It's probably something extremely obvious but I'm at a loss. Any ideas?
|
# ? Sep 19, 2009 16:36 |
|
Donald Duck posted:I'm following a tutorial(You need to register to view it) from IBM; have downloaded RoR and the gems I need. I'm using Windows Vista. Stupid suggestion but try 127.0.0.1. One of the guys at work has to do this
|
# ? Sep 19, 2009 19:38 |
|
darqness posted:Stupid suggestion but try 127.0.0.1. One of the guys at work has to do this That worked actually, didn't work the first time but did after that. Any idea why that happens?
|
# ? Sep 19, 2009 20:18 |
|
Donald Duck posted:edit: I have only seen it happen on thinkpads. So I am guessing it is that super enterprise wireless tool that comes with them.
|
# ? Sep 20, 2009 14:46 |
|
Could try pinging localhost from the command line, but yeah some wireless 'management programs' gently caress with the network settings and break normal stuff. Also, that tutorial is 2.5 years old and likely very, very wrong just by reading the blurb. I don't have an IBM account but a huge number of things have changed since 1.2. We're almost at 3.0. If you're really interested in Rails, use The Book.
|
# ? Sep 21, 2009 20:31 |
|
Donald Duck posted:edit: add the following line to c:\windows\system32\drivers\etc\hosts 127.0.0.1 localhost
|
# ? Sep 21, 2009 22:22 |
What's the cleanest way to represent this idea? I have a model, and different links to different actions on different controllers related to that model. It's not very RESTful, I'm afraid, but that's not the priority of the project; however it means I can't use the nice automagic RESTful URL helpers There are two conditions, an initial condition and a secondary condition. So if the initial condition is true, I don't want to return a link at all. If the initial condition is false, and the secondary condition is true, then I want to return a hyperlink with text "Create Foo" and a link to FoosController#new. If the initial condition is false, and the secondary condition is false, then I want to return a hyperlink with text "Edit Foo" and a link to FoosController#edit. Right now I have something like this in the model: code:
|
|
# ? Sep 22, 2009 17:20 |
|
Panic! at the Fist Jab posted:What's the cleanest way to represent this idea? First: You're violating MVC in an extreme way. Models should not ever know about controllers or URLs or routes or any of that stuff. This kind of logic should be in the helper, if it should exist at all. I have a suspicion that you're trying to do something that you don't have to be doing at all. Can you elaborate a bit further on what you're trying to really do? Here's how it should be done if you're going to do it at all (in ApplicationHelper or FoosHelper, depending on where it is used): code:
|
# ? Sep 22, 2009 18:54 |
I know it violates MVC, that's why I was asking. All I'm trying to do is have a list of links, each one with subtly different logic for when they should show up on a page. I finally decided upon this in the view, which I can tear out into a partial if it turns out it needs to be duplicated:code:
|
|
# ? Sep 22, 2009 19:52 |
|
|
# ? May 15, 2024 01:35 |
|
The helper is exactly right. Models are strictly for data, the further you go down the route of your model doing view stuff the harder everything is going to be on you later. You also don't want convoluted logic in your view because in a couple months you are going to go trying to figure out your view. But after looking at it a bit and whipping something up something seems really off. Why do you want to create a new record if there is some condition on an existing model instance?
|
# ? Sep 23, 2009 03:01 |