Local server error after upgrading ruby from 1.8.7 to 1.9.2 (with Rails 3.1.1)
Clear your cookies: your app is storing the session (which is a marshalled ruby object) in a cookie. If i remember correctly he marshal format changed between 1.8 and 1.9, so your app can no longer load old sessions
Segmentation fault - Ruby 1.8.7 and Rails 3.1.3
A note from guides.rubyonrails.org says:
Note that Ruby 1.8.7 p248 and p249 have marshaling bugs that crash Rails 3.0. Ruby Enterprise Edition have these fixed since release 1.8.7-2010.02 though. On the 1.9 front, Ruby 1.9.1 is not usable because it outright segfaults on Rails 3.0, so if you want to use Rails 3 with 1.9.x jump on 1.9.2 for smooth sailing.
I've had very good luck with 1.9.2 and rvm makes it easy to switch between multiple versions of ruby. Would you be able to try this?
Making scripts use 1.8.7 and Rails use 1.9.2
Make 1.8.7 your default Ruby and add a .rvmrc
to your Rails project:
https://rvm.io/workflow/rvmrc/
Successfully Installed Ruby 1.9.2 with RVM but now it reverted back to 1.8.7
You need to add the following to your ~/.bash_profile file to ensure that RVM is loaded properly in a terminal session:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
RVM is currently 1.9.2, want to run my app on 1.8.7, what should I do?
That's correct, assuming you already installed 1.8.7 with RVM: rvm install 1.8.7
, and loaded the rails 3 gem (remember, never use sudo with rvm). Then it's just:
$> rvm 1.8.7
$> cd /path/to/myApp
$> bundle install
$> rails server
Update: as tinifni points out in the comments, you may want to create a new gemset for your 1.8.7 installation to keep your gems separate from those already installed:
$> rvm gemset create rails3dev
$> rvm 1.8.7@rails3dev
$> cd /path/to/myApp
$> bundle install
$> rails server
Of course, there's all this and more in the the official RVM documentation
Regex don't find matches in Ruby 1.8.7 but does in 1.9.2
Where did you find this expression? I assume it was not written for Ruby.
Ruby is not supporting character class subtraction. So 1.9.2 is accepting [A-Z-[QVX]] but is not working as expected. Those characters are not excluded from the char class (See rubular, QVX is still matched)
1.8.7 is not accepting this expression at all.
You have to rewrite all those character ranges like this:
[A-Z-[QVX]]
becomes [A-PR-UWYZ]
See on Rubular
Internal Server Error can't convert String into Integer (in Rails)
I solved the error using the old version of project and using the db with above given migrations applied on it. Then i started entering the new code of model in my project, and ran the project, the error was gone!
Thanks
Related Topics
Rspec: How to Write Unit Test Case to Receive an Exception Which Is Getting Raised in Private Method
Ruby on Rails - Error Making New App (Rb:55:In 'Require')
Devise 'Find_First_By_Auth_Conditions' Method Explanation
Rails Contact Form Not Working
Is There a Way of Changing Regular Expressions to a Range of Numbers in Ruby on Rails
Calling Protected Class Method from Instance Method in Ruby
Ruby Get Permutations of All Lengths from a String in Order
How to Replace a Pattern in Ruby Array
How to Seed the Production Database Using the Capistrano Gem
How to Target a Specific Commit Sha with Capistrano Deploy
My Classes Can't Use Shoes Methods Like Para
Understanding Usage of Symbols in Routes.Rb Files
How to Use Link_To with Ajax in Rails 3.2.1
Deleting a Line in a Text File
How to Remove Devise Password Resetting During Email Confirmation
Rails How to Use Associated Model with the Admin Namespace