1

I'm developing a rails 4.0.0.beta1 app on MRI 2.0.0 and all looks working. I would like to try to run it on JRuby with puma.

$ ruby -v
jruby 1.7.3 (1.9.3p385) 2013-02-21 dac429b on Java HotSpot(TM) 64-Bit Server VM 1.6.0_45-b06-451-11M4406 [darwin-x86_64]

I changed my Gemfile this way:

if defined?(JRUBY_VERSION)
  gem 'activerecord-jdbc-adapter', :require => false
  gem 'jdbc-mysql'
  gem 'puma'
else
  gem 'mysql2'
  gem 'thin', '1.5.1'
end

and I did bundle install (all ok).

When I try to run puma with

$ bundle exec puma

I'm getting this error:

Puma 2.0.1 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://0.0.0.0:9292
NameError: uninitialized constant Foo::Application::Railties

I tryed to google but I couldn't find any information about the error, someone has an idea how to fix this?

Thank you

SDp
  • 329
  • 3
  • 13
  • 1
    I'm guessing the path to the `bundle` executable was laid down when you installed bundler through your MRI environment. What happens when you run something like `jruby -S bundle exec puma`? – Chris Mowforth May 20 '13 at 13:27
  • @ChrisMowforth I tryed and I get the same error, do you have any other idea? Thank you for your help – SDp May 22 '13 at 07:45

1 Answers1

0

Finally I found (luckly), I think it's a rails's problem on rc1, to solve it put this in your Gemfile

gem 'rails', github: 'rails/rails'

Then you will get another error

NameError: uninitialized constant ActionDispatch::Session::EncryptedCookieStore

You can solve this changing your 'initializers/session_store.rb' to

Foo::Application.config.session_store :cookie_store, key: '_foo_session'

(pay attention at your app's name in the correct place, don't use 'Foo')

Enjoy!

SDp
  • 329
  • 3
  • 13