I was looking for a way to do this and found a good resource to find out how (without coding it yourself!)
http://www.quarkruby.com/2007/10/21/sessions-and-cookies-in-ruby-on-rails#sexpire refers to a plugin called limited session but the link is no longer valid. Check out http://iprog.com/project/limited_sessions
Update: this breaks in Rails 2.3, I think it's because of the lazy loading. I've never learned much about sessions, so for now I'll move back to file stored.
Showing posts with label rails. Show all posts
Showing posts with label rails. Show all posts
Tuesday, March 3, 2009
Tuesday, February 3, 2009
Using --trace; cucumber & machinist order of loading files
I followed this tutorial to easily use Cucumber with a fixture replacement plugin called Machinist. It worked great on my desktop, but when I moved to my laptop, running rake features didn't work - an "uninitialized constant Sham" error popped up and I spent a day figuring it out.
Although the context of this problem is Cucumber and Machinist (which includes Sham), this is a post that talks about using --trace when you run into problems similar to this.
IF YOU'RE FAMILIAR WITH CUCUMBER & MACHINIST...
The problem occured partially because I put my blueprints.rb file where env.rb is. I believe cucumber loads everything there in alphabetical order (doesn't explain why my desktop loaded things differently). The problem is that blueprints.rb tries to call "Sham" which is something that is loaded by Machinist, which in turn is loaded during or after env.rb, not before.
IF YOU'RE NOT FAMILIAR NEITHER CUCUMBER NOR MACHINIST...
The problem occured because of the order files were loaded. I do not know why files were loaded differently in my desktop vs the laptop, but what the heck -- I found the error by using --trace and actually read the big bad ugly code that rake conveniently hides from us.
http://pastie.org/379188
So the lesson is: actually read what --trace spits out! :)
Although the context of this problem is Cucumber and Machinist (which includes Sham), this is a post that talks about using --trace when you run into problems similar to this.
IF YOU'RE FAMILIAR WITH CUCUMBER & MACHINIST...
The problem occured partially because I put my blueprints.rb file where env.rb is. I believe cucumber loads everything there in alphabetical order (doesn't explain why my desktop loaded things differently). The problem is that blueprints.rb tries to call "Sham" which is something that is loaded by Machinist, which in turn is loaded during or after env.rb, not before.
IF YOU'RE NOT FAMILIAR NEITHER CUCUMBER NOR MACHINIST...
The problem occured because of the order files were loaded. I do not know why files were loaded differently in my desktop vs the laptop, but what the heck -- I found the error by using --trace and actually read the big bad ugly code that rake conveniently hides from us.
http://pastie.org/379188
So the lesson is: actually read what --trace spits out! :)
Friday, May 23, 2008
Ruby, Rails, Mongrel, Monit, Nginx on Ubuntu 7.10 Gutsy
Ubuntu 7.10 on SilverRack
I used to have a tutorial here, and I had gotten the files from an existing server. I made it for myself. Since ezra posted making sure I wasn't violating any copyrights, I've decided to take it down, since I can't prove where those files were taken from.
Labels:
gutsy gubbon,
mongrel,
monit,
nginx,
rails,
ruby,
silverrack,
ubuntu
Sunday, May 11, 2008
Rails.vim breaks in Hardy Heron
Well, Vim breaks when using rails.vim in Ubuntu 8.04 Hardy Heron. Took me a few days to decide to actually try and fix it and not downgrade back down to Gutsy.
This post explains what you can do to fix this error. We'll upgrade to the latest Vim. Because the error is caused by an old version of Vim and rails.vim, you need to update it. You can read about it in this thread. That was my starting point to find the fix.
1) Download and install the latest version of Vim
2) Install all the plugins and scripts again
3) If you use haml, when I downloaded the latest version today of the haml syntax script, I had some illegal carriage return errors. I had to open haml.vim then save it via
This post explains what you can do to fix this error. We'll upgrade to the latest Vim. Because the error is caused by an old version of Vim and rails.vim, you need to update it. You can read about it in this thread. That was my starting point to find the fix.
1) Download and install the latest version of Vim
svn co https://vim.svn.sourceforge.net/svnroot/vim/vim7
cd vim7
./configure --with-features=huge
sudo make
sudo make install
2) Install all the plugins and scripts again
3) If you use haml, when I downloaded the latest version today of the haml syntax script, I had some illegal carriage return errors. I had to open haml.vim then save it via
:w ++ff=unix
Subscribe to:
Posts (Atom)