|
|
|
[
Permlink
| « Hide
]
Vladimir Sizikov - 09/Dec/07 03:35 AM
Interesting. I had no problems with Rails 2.0.1. First time I tried to start the server, it was complaining about the need for jruby-openssl gem, I instaled it , and after that everything was fine (well, there was a bug about TCPSocket not accepting nil, but that's different story and is already fixed in the trunk).
I just tried this with a release candidate of jruby 1.0.3 and I am getting same exact behavior as in description. Is anyone else seeing this? I updated environment to be a little more specific with my environment in case it that sheds any light on this.
The trunk version of jopenssl now supplies the complete OpenSSL::BN class. Not sure when jossl is scheduled for its next release.
If it works with a newer jossl version then that is great, but I would still like to understand why we have this problem only on windows with the current jossl gem. We must be following a different code path somewhere?
The problem appears in the rails-2.0.1\lib\rails_generator\secret_key_generator.rb in the method generate_secret_with_openssl Since OpenSSL::BN.rand method does not exist, I just added a bogus line:
data = "This is some string that should be randomly generated" instead of data = OpenSSL::BN.rand(2048, -1, false).to_s Ok, it's not the best, but it will allow Rails to create a new site. It appears that the OpenSSL::BN.rand method needs to be defined!!!! ok, maybe data = "This is some string that should be randomly generated" should be replaced, temporarily with something like:
data = "#{Time.now.to_s}/RoRs Rocks" Combine William's comments with these and the mystery is solved....
On MacOS and linux magic happens and they end up using generate_secret_with_urandom whereas windows uses generate_secret_with_openssl. So Bill (Dortch) is correct that we just need to put out a new version of jossl where OpenSSL::BN is properly defined (which is already done in jossl trunk) and all will be golden. I thought I would try jruby-openssl-0.0.5 from SVN (http://jruby-extras.rubyforge.org/svn/trunk/jopenssl/
First, I copied the build.properties.SAMPLE to build.properties and made it contain: C:\jopenssl>cat build.properties
Next, I ran ant and compiled. Next, I ran jruby on jruby-openssl.gemspec and successfully created a new gem Next, did jruby -S gem install jruby-openssl -v 0.0.5 and successfully installed the gem However, when running jruby -S rails railsapp1, I get the following message: uninitialized constant Digest::SHA2 So I looked in rails-2.0.1\lib\rails_generator\secret_key_generator.rb again and see the it requires 'openssl', but 'openssl' requires 'jopenssl' which does not exist in the jrbuy lib...shouldn't this have been installed with the gem package? I thought I compiled the jruby-openssl correctly but apparently I have not. Doh...maybe I should read my docs more!!!
Ran gem build jruby-openssl.gemspec and got the correct gem file. I believe this is fixed now, and should work even without the openssl gem installed. Stub versions of OpenSSL::Digest and HMAC are built-in, as is 1.9's SecureRandom class which should take precedence in the secret_key_generator.
Hi, i'm trying to get started with JRuby reading the JRuby on Rails..., i installed the last version of JRuby, get the latest Ruby version etc... I followed your tips to run rails command to create an application but the error remains. There is a step by step to make run this command with those versions of Ruby and JRuby?
Please try these resources for simple step-by-step instructions:
http://wiki.jruby.org/wiki/Running_Rails_with_ActiveRecord-JDBC http://blog.emptyway.com/2008/04/08/120-seconds-guide-to-jruby-on-rails |
|||||||||||||||||||||||||||||||||||||||||||||||||||