Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Adolf Hitler
Feb 12, 2003

The Journey Fraternity posted:

Have you looked into its bleeding edge? According to their blog, they're prepping for a 1.0 release that might scratch your 2.3.2 itch.

It was a horrible nightmare. I'm just rolling my own and hoping my liver can survive the trauma I bring upon myself.

Oh god.

Jargon posted:

I just started using Hobo too and I am going to shoot myself in the head trying to figure out DRYML.

Oh yeah, I got to that part and decided they are just wasting my time. I'm learning one new language, already. I just can't figure out why I should learn the DRYML poo poo, when I'm already picking up Ruby/Rails. It's not even like a dozen other projects use DRYML too. Just them. So if I want to use other stuff with Hobo? I have this potentially hackish mess with several competing languages (JavaScript/Ruby/DRYML/HTML/VOMIT), and nothing to show for it if I ever want to move my code into something else.

Adolf Hitler fucked around with this message at 07:06 on Apr 29, 2009

Adbot
ADBOT LOVES YOU

Jargon
Apr 22, 2003

Adolf Hitler posted:

Oh yeah, I got to that part and decided they are just wasting my time. I'm learning one new language, already. I just can't figure out why I should learn the DRYML poo poo, when I'm already picking up Ruby/Rails. It's not even like a dozen other projects use DRYML too. Just them. So if I want to use other stuff with Hobo? I have this potentially hackish mess with several competing languages (JavaScript/Ruby/DRYML/HTML/VOMIT), and nothing to show for it if I ever want to move my code into something else.

I'm only using it for the admin area on a client project, because I HATE doing admin areas. All of the public-facing stuff is going to be HAML/SASS.

I was tempted to use Django just for its awesome admin thingy, but the way it does stuff is just so weird and foreign that I decided it would be faster to just hunker down and learn the little bit of DRYML I need for the admin area.

Pardot
Jul 25, 2001




Bathroompants posted:

Thanks for the responses guys, I figured out that I was doing things the hard way. Trying to learn subversion and rails at the same time had me very confused but I've worked out that step of the problem and have gotten to be able to start messing around with rails =)

Not to start a version control war (there is a different thread for discussing the different ones), but unless you're forced to use svn from your company or something, you should learn git.

The entire rails community has been using it for the last year and a half or so, pretty much exclusively, and in no small part due to the awesomeness of http://gibub.com http://github.com

At the very least you'll have to become familiar with it, since a lot of gems aren't even being released on rubyforge anymore, and solely live on github.

Pardot fucked around with this message at 00:14 on Apr 30, 2009

Jargon
Apr 22, 2003

Pardot posted:

http://gibub.com

I've been sitting here for a minute trying to figure out what brain misfiring or finger slip could have led to this typo haha

Are you on a Dvorak or chorded keyboard??

Pardot
Jul 25, 2001




Jargon posted:

I've been sitting here for a minute trying to figure out what brain misfiring or finger slip could have led to this typo haha

Are you on a Dvorak or chorded keyboard??

Wow, I have no idea. :ohdear: I did post right before bed though. Anyway, who is going to be in vegas next week?

wunderbread384
Jun 24, 2004
America's favorite bread
Speaking of GitHub, am I the only one who thinks it being so easy to fork repositories might be a bad thing? I wanted to use the couchrest gem, and it turns out there's like 3 or 4 different versions that have different features that would be nice. But they're pulled so infrequently that I had to merge a lot of it myself...and of course if I post it to GitHub that's yet another project and yet another pull request.

It's almost too cheap to fork a repository compared to submitting a patch or bug report.

I guess this isn't really a RoR question but...GitHub runs RoR so technically...

king_kilr
May 25, 2007

wunderbread384 posted:

Speaking of GitHub, am I the only one who thinks it being so easy to fork repositories might be a bad thing? I wanted to use the couchrest gem, and it turns out there's like 3 or 4 different versions that have different features that would be nice. But they're pulled so infrequently that I had to merge a lot of it myself...and of course if I post it to GitHub that's yet another project and yet another pull request.

It's almost too cheap to fork a repository compared to submitting a patch or bug report.

I guess this isn't really a RoR question but...GitHub runs RoR so technically...

No, you're not: http://www.pointy-stick.com/blog/2009/03/16/dark-side-distributed-version-control/

Adolf Hitler
Feb 12, 2003
GitHub is a bit of a pain in the rear end, if you're coming in from nowhere. When you search, you find forks and have no clue which one people are talking about.

I'm all for some kind of open forum thing, but either someone needs to declare themselves king and flag some projects more visible than others... Or they need a voting system to rank projects.

But when I searched for something, I was finding plenty of forks and had a less than easy time figuring out what to use. I'm becoming less beginner-ish, but yeah.

Oh, and rubyforge blew. So I'm glad that's sorta ignored. But it'd be really swell if GitHub has downloadable Gems for everything. Right now, I get the tar and there's a few ways to generate a gem, or maybe an installer script or whatever else. But it isn't an easy thing to figure out (ie, even realize you can do that at first).

And maybe they can do what CPAN does and tell me what is a goddamn dependency. If I put a Gem on a server at work, I have to download it to my computer and FTP it over. Network-restricted servers are pretty common in the enterprise.

I can rant about lots of poo poo in the Ruby community. I love finding zero RDocs half the time. I love how I have a pain in the rear end time finding solutions to some simple problems, and people saying it's in "[the/a] book" and calling me a hippie fag for even thinking it should be on google. Or.. or... or.... ugh

But still, I like Ruby/Rails--generally speaking.

Here's a question:

I have data that I am validating before it gets prepared for import. I don't need AR to validate everything. But I do have an AR plugin ("acts_as_revisable") for maintaining versioned histories of my records.

If I use AR-Extensions, it doesn't call any AR plugins/validations, which makes it super fast. So... Is it possible to use AR-Ext with my acts_as stuff? I could write a semi-complex set of MySQL triggers, but that's basically taking the least robust course IMO. Eh.

KarmaticStylee
Apr 21, 2007

Aaaaaughibbrgubugbugrguburgle!
what's the best base install when u set up on slicehost?

Operation Atlas
Dec 17, 2003

Bliss Can Be Bought

KarmaticStylee posted:

what's the best base install when u set up on slicehost?

Debian

Bathroompants
Aug 19, 2002

Pardot posted:

Not to start a version control war (there is a different thread for discussing the different ones), but unless you're forced to use svn from your company or something, you should learn git.

The entire rails community has been using it for the last year and a half or so, pretty much exclusively, and in no small part due to the awesomeness of http://gibub.com http://github.com

At the very least you'll have to become familiar with it, since a lot of gems aren't even being released on rubyforge anymore, and solely live on github.

Thanks for the information. I'll have to look into using git for my project, already had to install it to get some plugins I was messing around with.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
It feels like Rails 3 is just around the corner. I'm at a loss, I have a large project I want to get started on but I'm not sure if I should use the latest from the Rails 3 repository and then update as it goes or just use 2.3.

I wonder if I will be able to more or less migrate my 2.3 app into a Rails 3 application later on.

niralisse
Sep 14, 2003
custom text: never ending story

Nolgthorn posted:

I wonder if I will be able to more or less migrate my 2.3 app into a Rails 3 application later on.

Of course you will, it'll just take a fair bit of refactoring. 2.3 will be supported for quite a while anyway. I'd say, don't dick around with beta stuff, focus on your project, and when 3 is good and ready, you can do the conversion then. Everyone else on production Rails is going to be in your boat and there will be tons of tutorials and hand-holding available then.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
My concern was mostly that Rails 3 might be vastly different from 2.3. I would not be able to migrate a Rails app to a Merb app easily for instance, it would be more or less a rewrite.

I guess I'll stick with Rails 2.3, you're right that it will still be supported for quite a while.

Sewer Adventure
Aug 25, 2004

Nolgthorn posted:

My concern was mostly that Rails 3 might be vastly different from 2.3. I would not be able to migrate a Rails app to a Merb app easily for instance, it would be more or less a rewrite.

I guess I'll stick with Rails 2.3, you're right that it will still be supported for quite a while.

Moving to Rails 3 won't be so bad. Moving to ruby 1.9 is going to be a bitch.

Evil Trout
Nov 16, 2004

The evilest trout of them all

Jargon posted:

I've been using Slicehost ($20 for an Ubuntu VPS with 256MB ram, enough to run a Rails site with light to moderate traffic), and it's a great value if you don't mind getting your hands dirty with a bare Linux box.

I just signed up and used you as a referrer :)

Forumwarz already runs on a cluster of three 8-core servers, but we're launching a new project that I wanted to partition away from our regular site. Slicehost looks really good as a lightweight simple host.

NotShadowStar
Sep 20, 2000

Sewer Adventure posted:

Moving to Rails 3 won't be so bad. Moving to ruby 1.9 is going to be a bitch.

I still don't know what the gently caress the core Ruby team was thinking. They improved the core aspects of the interpreter that were the primary weaknesses, the GC and execution speed, and it was amazing. Then they go and make fundamental changes to the language AT THE SAME TIME. ARGH.

On the other hand, I'm getting kinda good at tracking down 1.9 issues from libraries, fixing them and submitting patches.

Pardot
Jul 25, 2001




NotShadowStar posted:

On the other hand, I'm getting kinda good at tracking down 1.9 issues from libraries, fixing them and submitting patches.

What are some examples of typical problems? I haven't tried 19 yet :o:

Operation Atlas
Dec 17, 2003

Bliss Can Be Bought

NotShadowStar posted:

I still don't know what the gently caress the core Ruby team was thinking. They improved the core aspects of the interpreter that were the primary weaknesses, the GC and execution speed, and it was amazing. Then they go and make fundamental changes to the language AT THE SAME TIME. ARGH.

On the other hand, I'm getting kinda good at tracking down 1.9 issues from libraries, fixing them and submitting patches.

A point revision in Ruby is not like a point revision in any other software. Ruby 1.8.0 came out in 2002,, so it has been 7 years since fundamental changes have been made to the language. It is about drat time, whether or not the internals have been overhauled at the same time or not.

Sewer Adventure
Aug 25, 2004

NotShadowStar posted:

I still don't know what the gently caress the core Ruby team was thinking. They improved the core aspects of the interpreter that were the primary weaknesses, the GC and execution speed, and it was amazing. Then they go and make fundamental changes to the language AT THE SAME TIME. ARGH.

On the other hand, I'm getting kinda good at tracking down 1.9 issues from libraries, fixing them and submitting patches.

Please do ferret :)

ndb
Aug 25, 2005

I'm trying to set up Integrity using Thin on an Ubuntu Jaunty install for work purposes. I'm getting an error when trying to start the Integrity server that says

code:
 "can't activate rack (0.9.2) already activated rack (1.0)"
I've googled, and have done many things, including trying to require Integrity to use Rack 0.9.2 and Sinatra 0.9.1, as well as requiring gems that come from my own .gems folder (One of the many solutions I read seemed to point the culprit at Sinatra). Right now, I have three rack gems installed (1.0, 9.1 and 8.7, I think), and two Sinatra gems (0.9.1 and 0.9.2). Most solutions that I have seen have the already activated version of rack be the lower version, not the higher version. Any idea on what I can do?

Unfortunately, any specifics I can provide are limited because this machine is at my workplace, which I don't have access to this weekend.

I'm using Ruby 1.8 and Rails 2.3, I believe.

Bathroompants
Aug 19, 2002
I'm probably doing this completely rear end backwards, but I've got my rails application connecting to a telnet server and I'm having a hard time finding a way to show the output.

What I'd like to do is have my messages from the server thread append the new message to the bottom of a text box I have on my page. I can't figure out how to have the method in the helper file thats being called do something like $('destinationDiv').innerHTML += newLineOfText

Anyone have any suggestions?

NotShadowStar
Sep 20, 2000

Sewer Adventure posted:

Please do ferret :)

Oi, I took a look and it looks like a weird C extension that bridges an external library to Ruby. Those are no fun, I tried to work on RSRuby and eventually gave up to do something productive.

quote:

'm probably doing this completely rear end backwards, but I've got my rails application connecting to a telnet server and I'm having a hard time finding a way to show the output.

What I'd like to do is have my messages from the server thread append the new message to the bottom of a text box I have on my page. I can't figure out how to have the method in the helper file thats being called do something like $('destinationDiv').innerHTML += newLineOfText

Anyone have any suggestions?

With RJS, it looks like you're using jQuery and I don't know the answer offhand but jRails should translate appropriately

page.insert_html :bottom, :destinationDiv, {string html or :partial =>}

Pardot
Jul 25, 2001




Clock Explosion posted:

I'm trying to set up Integrity using Thin on an Ubuntu Jaunty install for work purposes. I'm getting an error when trying to start the Integrity server that says


The problem is that the older version of sinatra requires a version of rack that is < 1.0, but integrity wants >= 1.0

Make sure you have sinatra 0.9.2, rack 1.0.0. and integrity 0.1.10. Since you wrote that you have some of those versions, try and doing gem remove <gemname> and deleting the older versions of sinatra and rack.

Operation Atlas
Dec 17, 2003

Bliss Can Be Bought

Clock Explosion posted:

I'm trying to set up Integrity using Thin on an Ubuntu Jaunty install for work purposes. I'm getting an error when trying to start the Integrity server that says

code:
 "can't activate rack (0.9.2) already activated rack (1.0)"
I've googled, and have done many things, including trying to require Integrity to use Rack 0.9.2 and Sinatra 0.9.1, as well as requiring gems that come from my own .gems folder (One of the many solutions I read seemed to point the culprit at Sinatra). Right now, I have three rack gems installed (1.0, 9.1 and 8.7, I think), and two Sinatra gems (0.9.1 and 0.9.2). Most solutions that I have seen have the already activated version of rack be the lower version, not the higher version. Any idea on what I can do?

Unfortunately, any specifics I can provide are limited because this machine is at my workplace, which I don't have access to this weekend.

I'm using Ruby 1.8 and Rails 2.3, I believe.

If you can, uninstall the lower versions of those gems, and one of two things will happen: 1) everything will work, or 2) It will give you a more specific error about who is trying to require that version of rack. This has happened to me before with Merb when I was careless about messing with system gems and vendored gems. The Passenger process, in my case, was using the system gem, and my app was trying to load up a different version out of the bundled gems.

Kind of vague, but I hope that helps. These problems are insanely hard to debug.

ndb
Aug 25, 2005

Operation Atlas posted:

If you can, uninstall the lower versions of those gems, and one of two things will happen: 1) everything will work, or 2) It will give you a more specific error about who is trying to require that version of rack. This has happened to me before with Merb when I was careless about messing with system gems and vendored gems. The Passenger process, in my case, was using the system gem, and my app was trying to load up a different version out of the bundled gems.

Kind of vague, but I hope that helps. These problems are insanely hard to debug.

I actually realized the answer on how to fix this - uninstalling lower versions of the gems didn't work, because it turns out that integrity absolutely required sinatra 0.9.1.1 and thin 1.22.2 absolutely required rack 1.0, which sinatra 0.9.1.1 didn't support.

The fix was to use an earlier version of thin that was rack > 0.9.2.

Fortunately, the server is now almost working, so I'm happy.

phazer
May 14, 2003

chirp chirp i'm a buffalo
Dudes

I'm using the Restful_Authentication_Tutorial (here: http://railsforum.com/viewtopic.php?id=14216) and I changed the session store to active_record (db store)

Since doing that, any time I try to access a controller (while logged in) with the before_filter :login_required, it calls access_denied and says I need to be logged in, takes me to the login page.

For example my sessions_controller#create method calls a password_authentication method which calls successful_login if everything is on the up and up. The successful_login says cool, go to member_path(current_user) (the logged in user's member page), the members_controller says hey, login required to see anything here. login_required says access_denied, redirect to login.

And that's what happens. I login, it tries to go to my member page, it spits me back out.

Any help?

NotShadowStar
Sep 20, 2000
Did you do rake db:sessions:create ?

Donkey Darko
Aug 13, 2007

I do not lust for blood or death. I prepare for the warrior's call.

phazer posted:

Dudes

I'm using the Restful_Authentication_Tutorial (here: http://railsforum.com/viewtopic.php?id=14216) and I changed the session store to active_record (db store)

Give AuthLogic a spin instead?

Plastic Jesus
Aug 26, 2006

I'm cranky most of the time.
Is it possible to load the code for a lambda from a file? I want to do this:

quote:

[twitch@varial]$ cat blah.test
puts "helu from the test"
[twitch@varial]$ irb
>> a = lambda { File.read("blah.test") }
=> #<Proc:0x0036707c@(irb):1>

and be able to just invoke 'a' like I would if I did this:

quote:

a = lambda { puts "helu from the test" }

But this is what happens:

quote:

>> a.call
=> "puts \"helu from the test\"\n"

I have a fairly ugly work-around, but I really want to be able to attach a method to an object at runtime, with the code for that method stored in a flat file.

skidooer
Aug 6, 2001

Plastic Jesus posted:

Is it possible to load the code for a lambda from a file? I want to do this:
code:
a = lambda { load('/path/to/script.rb') }
a.call

Plastic Jesus
Aug 26, 2006

I'm cranky most of the time.

skidooer posted:

code:
a = lambda { load('/path/to/script.rb') }
a.call

That rules, but 1) there will be a file open/close every time it's invoked and 2) you can't pass args to Kernel.load :(

skidooer
Aug 6, 2001
code:
code = File.read('/path/to/script.rb')
# => "puts \"Hello, #{name}\""

a = lambda { |name| eval(code) }
a.call('Plastic Jesus')

Plastic Jesus
Aug 26, 2006

I'm cranky most of the time.

skidooer posted:

code:
code = File.read('/path/to/script.rb')
# => "puts \"Hello, #{name}\""

a = lambda { |name| eval(code) }
a.call('Plastic Jesus')

w00t, thank you. I now feel dim, but thanks.

Operation Atlas
Dec 17, 2003

Bliss Can Be Bought

Plastic Jesus posted:

Is it possible to load the code for a lambda from a file?

Not exactly what you're talking about, but sweet Jesus my life would be a whole lot easier if you could store blocks in a database. Lisps can do it, why not Ruby?

NotShadowStar
Sep 20, 2000
Because that sounds positively insane.

The fastest thing I can think of is a custom AR class with before_save and after_load that'll eval the proc as it goes in/out of the table. eval is slow as hell on 1.8 so that may not work out for you, I'll have to dig into the corners of the Rails book for the serialization stuff.

tl;dr it's entirely possible but dear god why.

Reminds me of this crazy dude I know who created a biological information system in .NET. The entire program ran out of some bizarre self compilation that was stored in an MSSQL DB. Each table had rows and columns that were binary blobs that contained pre-compiled .NET CLR code. The main program was a controller that fetched and concatenated the relevant bits from the DB then threw it at the CLR to execute. Of course it could be self-modifying too so what was executed might modify other pre-compiled binary blobs and :psyduck:

NOBODY understood it but on the other hand he's pretty much set for life. What you guys are asking reminds me much of that insanity.

dustgun
Jun 20, 2004

And then the doorbell would ring and the next santa would come
Yeah.. whatever you're trying to do, you're doing it wrong.

Hop Pocket
Sep 23, 2003

NotShadowStar posted:

NOBODY understood it but on the other hand he's pretty much set for life.

Because of code-obfuscated perpetual employment or value of said biological information system?

dustgun
Jun 20, 2004

And then the doorbell would ring and the next santa would come
I'm interested in playing with engines right now, but haven't been able to find any decent guides. Namely I'm looking for someplace that talks about how all the precedence works for adding routes and overriding controller actions.

dustgun fucked around with this message at 02:03 on Jun 24, 2009

Adbot
ADBOT LOVES YOU

Magicmat
Aug 14, 2000

I've got the worst fucking attorneys
I used to be a decent Rails coder around the 1.x days, but I left it (and all web programming) for a while. Now I want to create a new web project with Rails, but I'm at a loss because things changed so much.

Back when I was last programming, jEdit was the IDE I used on Windows (Eclipse had just gained support, but it was weak,) SVN was the version-control system of choice, and there had yet to be any major changes to either Rails or Ruby 1.8.

So where do I start? What's the IDE of choice these days on Windows? Does Git's windows support still suck? (Mercurial was the windows guys' distributed versioning system when I last checked, do Rails and Mercurial play nice?) When is Rails 3.0 coming out? If I'm embarking on a moderate-sized project, should I wait to jump back in or just go with the current 2.x version?

Any other gotchas or tips I need to know before starting back with Rails again?

(I know the answers are probably sprinkled throughout this thread, but it's 27 pages, the first half of it is so old as to be out of date, and no search.)

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply