Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Psych.load doesn't work on Heroku #55

Closed
ncri opened this issue Mar 29, 2012 · 12 comments
Closed

Psych.load doesn't work on Heroku #55

ncri opened this issue Mar 29, 2012 · 12 comments

Comments

@ncri
Copy link

ncri commented Mar 29, 2012

In my Rails 3.2.2 app

Psych.load('--- foo')  

works fine in my local (production) console. But in on Heroku (cedar stack, ruby 1.9.2) I get this error:

irb(main):001:0> Psych.load('--- foo') 
LoadError: no such file to load -- --- foo
    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load'
    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `block in load'
    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load'
    from (irb):1
    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.2/lib/rails/commands/console.rb:47:in `start'
    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.2/lib/rails/commands/console.rb:8:in `start'
    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
@tenderlove
Copy link
Member

What version of Ruby are you running on your local machine?

@ncri
Copy link
Author

ncri commented Mar 29, 2012

ruby-1.9.2-p290-railsexpress [ x86_64 ], a patched ruby installed via rvm

@ncri
Copy link
Author

ncri commented Mar 29, 2012

Oh, and I don't have the psych gem installed. Ruby 1.9.2 comes with Psych, right? Or where is it coming from otherwise?

@ncri
Copy link
Author

ncri commented Mar 29, 2012

With ruby-1.9.3-p0 it works too (without the gem installed).

@tenderlove
Copy link
Member

Ya, it's in 1.9.2. It seems like somehow you're doing a require on psych in development but not in production. I'm not sure where that might be happening though.

@ncri
Copy link
Author

ncri commented Mar 29, 2012

Okay, I was suspecting the localeapp gem as I found the error through that, but it doesn't have require 'psych' anywhere, neither does my rails app...

@tenderlove
Copy link
Member

I'm guessing that some library code (possibly rails?) is doing it in development but not production. Can you try adding a require 'psych' to your application.rb?

@ncri
Copy link
Author

ncri commented Mar 29, 2012

See this issue: Locale/localeapp#27

@ncri
Copy link
Author

ncri commented Mar 29, 2012

Hm, require 'psych' doesn't work on Heroku, it gives me "LoadError: no such file to load -- psych" locally it works though...

@tenderlove
Copy link
Member

Seems like they don't have it installed for Ruby 1.9.2. I think this should be fixed in localeapp. Checking for the Psych constant isn't the best way to detect if Psych has been loaded or not. I'll comment on that issue with how to fix.

@ncri
Copy link
Author

ncri commented Mar 29, 2012

Thanks, I guess we can close this then?

@ghost
Copy link

ghost commented Jan 25, 2013

I am also getting same error of "LoadError: no such file to load -- psych" on heroku with ruby 1.9.2. Is there any way i can fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants