Skip to main content

Posts

Showing posts from December, 2007

Session problems with Mongrel and Jruby on rails

If you get a "wrong number of arguments(2 for 1)" in the stale_session_check method when running your jruby ruby on rails application, the problem may be your sessions. Clear the sessions and delete all rows from the sessions database table if you are using one. Then add to environment.rb: config.action_controller.session = { :session_key => "_myapp_session", :secret => "some secret phrase of at least 30 characters" } The code has to be inside the Rails::Initializer.run do |config| block.

Rubyscript2Exe is not deleting the temp files once it is done: SOLVED!

Is your Ruby on rails application packed in a exe created by Rubyscript2Exe? Is Ruby2Exe not deleting the temp files once it is done? I came out with the solution of deleting the files of previous run: 1. Replace the contents of init.rb with this: require "rubyscript2exe" require "fileutils" at_exit do require "irb" require "drb/acl" require "dbi" require "dbd/ODBC/ODBC" #Add the libraries you need end if RUBYSCRIPT2EXE.is_compiled? ee_base_folder = File.expand_path(RUBYSCRIPT2EXE.appdir + "/../..") ee_folder = File.expand_path(RUBYSCRIPT2EXE.appdir + "/..") name_parts = ee_folder.split(".") curr_ee_folder_number = name_parts[3].to_i last_ee_folder_number = curr_ee_folder_number - 1 Dir.entries(ee_base_folder).each do |folder| if (folder != ".") and (folder != "..") and (folder.split(".")[3].to_i != curr_ee_folder_number)

Database configuration sample for accessing MS SQL in Jruby's rails

Use NetBeans to create the rails project using Jruby. Make sure you select "use JDBC". The database yml for connecting to MS SQL through ODBC: development: adapter: jdbc username: MYUSERNAME password: "14 if your password starts with a number enclose the password in double quotes" driver: sun.jdbc.odbc.JdbcOdbcDriver url: jdbc:odbc:MYDNSNAME