WARNING: Nokogiri was built against LibXML version 2.9.2, but has dynamically loaded 2.9.0
/Users/olleh/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/psych.rb:369:in `parse': (<unknown>): mapping values are not allowed in this context at line 14 column 10 (Psych::SyntaxError)
I'm stuck with this problem. When I run Rails s or Rails C this comes up.
I think this is related to the global gems. I've used a gemset for this project called drugstore
eldiablo:drug-store olleh$ rails c
/Users/olleh/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.7.11/lib/bundler.rb:302: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Users/olleh/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.7.11/lib/bundler.rb:302: warning: Insecure world writable dir /usr/local in PATH, mode 040777
WARNING: Nokogiri was built against LibXML version 2.9.2, but has dynamically loaded 2.9.0
/Users/olleh/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/psych.rb:369:in `parse': (<unknown>): mapping values are not allowed in this context at line 14 column 10 (Psych::SyntaxError)
from /Users/olleh/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/psych.rb:369:in `parse_stream'
from /Users/olleh/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/psych.rb:317:in `parse'
from /Users/olleh/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/psych.rb:244:in `load'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/railties-3.2.14/lib/rails/application/configuration.rb:115:in `database_configuration'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/activerecord-3.2.14/lib/active_record/railtie.rb:84:in `block (2 levels) in <class:Railtie>'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/activesupport-3.2.14/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/activesupport-3.2.14/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/activesupport-3.2.14/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/activesupport-3.2.14/lib/active_support/lazy_load_hooks.rb:25:in `each'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/activesupport-3.2.14/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/activerecord-3.2.14/lib/active_record/railtie.rb:80:in `block in <class:Railtie>'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `run'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/railties-3.2.14/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `each'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/railties-3.2.14/lib/rails/application.rb:136:in `initialize!'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/railties-3.2.14/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /private/var/www/drug-store/config/environment.rb:5:in `<top (required)>'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/railties-3.2.14/lib/rails/application.rb:103:in `require_environment!'
from /Users/olleh/.rvm/gems/ruby-2.1.0#drugstore/gems/railties-3.2.14/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
The problem was actually my Db yml.
There was a syntax error on my configuration for production thus the error.
Related
I have a rails app that runs fine on my development iMac (Ventura). I pushed to production CentOS7. It bundled up fine but when trying to to assets precompile I get the error below. I have tried, removing lock file and re-bundling, updating bundler, did gem update and did yum update on server. I get the following when doing rake assets:clean precompile and I see similar error in apache log as well. I am running rails 7.0.4.2 and ruby 3.1.1. I need some guidance on how to resolve.
rake assets:clean precompile
rake aborted!
LoadError: cannot load such file -- Version
<internal:/usr/local/rvm/rubies/ruby-3.1.1/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/local/rvm/rubies/ruby-3.1.1/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/usr/local/rvm/gems/ruby-3.1.1/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
/admin/bin/rails/catering_bk/config/initializers/active_admin.rb:290:in `block in <top (required)>'
/usr/local/rvm/gems/ruby-3.1.1/gems/activeadmin-2.13.1/lib/active_admin.rb:68:in `setup'
/admin/bin/rails/catering_bk/config/initializers/active_admin.rb:1:in `<top (required)>'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/engine.rb:667:in `load'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/engine.rb:667:in `block in load_config_initializer'
/usr/local/rvm/gems/ruby-3.1.1/gems/activesupport-7.0.4.2/lib/active_support/notifications.rb:208:in `instrument'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/engine.rb:666:in `load_config_initializer'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/engine.rb:620:in `block (2 levels) in <class:Engine>'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/engine.rb:619:in `each'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/engine.rb:619:in `block in <class:Engine>'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/initializable.rb:32:in `instance_exec'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/initializable.rb:32:in `run'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/initializable.rb:61:in `block in run_initializers'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/initializable.rb:50:in `each'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/initializable.rb:50:in `tsort_each_child'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/initializable.rb:60:in `run_initializers'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/application.rb:372:in `initialize!'
/admin/bin/rails/catering_bk/config/environment.rb:5:in `<top (required)>'
<internal:/usr/local/rvm/rubies/ruby-3.1.1/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/local/rvm/rubies/ruby-3.1.1/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/usr/local/rvm/gems/ruby-3.1.1/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/application.rb:348:in `require_environment!'
/usr/local/rvm/gems/ruby-3.1.1/gems/railties-7.0.4.2/lib/rails/application.rb:511:in `block in run_tasks_blocks'
/usr/local/rvm/gems/ruby-3.1.1/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:61:in `block (2 levels) in define'
/usr/local/rvm/gems/ruby-3.1.1/bin/ruby_executable_hooks:22:in `eval'
/usr/local/rvm/gems/ruby-3.1.1/bin/ruby_executable_hooks:22:in `<main>'
Tasks: TOP => environment
(See full trace by running task with --trace)
As noted above. I tried
Remove lock file and bundle again.
gem update
yum update
Also to note this is also an older app that was upgraded to be in compliance with Veracode. It works perfectly on OSX, so the issue must be within CentOS.
while generating controllers, I am getting this error message:
Leticias-MacBook-Pro:portfolio Tish$ rails g controller welcome index about music loops projects
/Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:6:in `require': incompatible library version - /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3/sqlite3_native.bundle (fatal)
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:2:in `<top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
from /Users/Tish/Projects/portfolio/config/application.rb:7:in `<top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:82:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:82:in `preload'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:143:in `serve'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:131:in `block in run'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `loop'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `run'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Nothing I have tried makes it stop. I have reinstalled every gem it complains about, but the changes do not persist. I've followed every fix I can find/understand but I am chasing my tail on this one.
Working on OSX...
Your rails is not linked with the right ruby version. Use the following code:
rvm use ruby-<version number> like: (rvm use ruby-2.1.4)
then reinstall the bundler:
gem uninstall bundler
gem install bundler
bundle install once again with the new version.
bundle install
Then proceed with your rails g command.
I just upgraded my ruby from 1.9.3 to 2.0.0 and then created a new rails project. After creating the project, I try to run rails server but I get the following error:
root#giri:~/sr# rails s
/home/giri/.rvm/gems/ruby-2.0.0-p576/gems/actionpack-4.1.6/lib/action_controller/metal/strong_parameters.rb:106: warning: already initialized constant ActionController::Parameters::NEVER_UNPERMITTED_PARAMS
/home/giri/.rvm/gems/ruby-2.0.0-p576/gems/actionpack-4.1.6/lib/action_controller/metal/strong_parameters.rb:106: warning: previous definition of NEVER_UNPERMITTED_PARAMS was here
/home/giri/.rvm/gems/ruby-2.0.0-p576/gems/actionpack-4.1.6/lib/action_controller/metal/strong_parameters.rb:106: warning: already initialized constant ActionController::Parameters::NEVER_UNPERMITTED_PARAMS
/home/giri/.rvm/gems/ruby-2.0.0-p576/gems/actionpack-4.1.6/lib/action_controller/metal/strong_parameters.rb:106: warning: previous definition of NEVER_UNPERMITTED_PARAMS was here
/home/giri/.rvm/gems/ruby-2.0.0-p576/gems/coffee-rails-4.0.1/lib/coffee-rails.rb:1:in `require': cannot load such file -- coffee-script (LoadError)
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/coffee-rails-4.0.1/lib/coffee-rails.rb:1:in `<top (required)>'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler/runtime.rb:88:in `require'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler/runtime.rb:88:in `block (2 levels) in require'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler/runtime.rb:83:in `each'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler/runtime.rb:83:in `block in require'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler/runtime.rb:72:in `each'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler/runtime.rb:72:in `require'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/bundler-1.12.0.rc/lib/bundler.rb:102:in `require'
from /home/giri/sr/config/application.rb:7:in `<top (required)>'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:79:in `require'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `server'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /home/giri/.rvm/gems/ruby-2.0.0-p576/gems/railties-4.1.6/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
warning: already initialized constant
This kind of error tends to happen when you have a different version in your bundle to your command line.
Try bundle exec rails s
Try deleting cache. It is located under tmp folder
Basically, When I try to generate a scaffold I am getting this error
no such file to load -- openssl (LoadError) .
The error is coming from
.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
Not sure why this is happening. Here is the full error:
/home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
/home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require': no such file to load -- openssl (LoadError)
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/rack-1.3.4/lib/rack/session/cookie.rb:1:in `<top (required)>'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/actionpack-3.1.0/lib/action_dispatch/middleware/session/cookie_store.rb:4:in `<top (required)>'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/application/configuration.rb:125:in `const_get'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/application/configuration.rb:125:in `session_store'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/application.rb:168:in `block in default_middleware_stack'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/application.rb:142:in `tap'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/application.rb:142:in `default_middleware_stack'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/engine.rb:445:in `app'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/application/finisher.rb:37:in `block in <module:Finisher>'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `instance_exec'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `run'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/initializable.rb:50:in `block in run_initializers'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `each'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `run_initializers'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/application.rb:92:in `initialize!'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/spencer/Desktop/blog/config/environment.rb:5:in `<top (required)>'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/application.rb:78:in `require'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/application.rb:78:in `require_environment!'
from /home/spencer/.rvm/gems/ruby-1.9.2-p290#rails310/gems/railties-3.1.0/lib/rails/commands.rb:22:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
OK so what I ended up doing is this.
uninstalled all version of ruby from rvm
deleted all of the gemsets from rvm
$ rvm pkg install openssl
$ rvm pkg install zlib
$ rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr --with-zlib-dir=$rvm_path/usr
reinstalled rails in a gemset
Everything works fine after that.
You should be able to do something like this: (forgive the fact that there may be errors in my paths and I'm not on my linux box)
cd to ~.rvm/src/ruby-1.9.2-p290/ext/openssl
ruby extconf.rb
make
make install
Basically, just cd to the gem's source directory for your particular ruby version and rebuild/install this.
You will not need to rebuild ruby, this has been a common problem.
If your in linux you could try these
apt-get install openssl
apt-get install libopenssl-ruby
I have been trying to setup Ruby on Rails for the past 2 days now. I had them running at one stage but broke it. I have gone through re-installing Ruby and Rails via RVM and I am attempting to get going on the tutorial I have been working on. The problem I have is that when I run the command 'rails s' within the Rails app directory I get the following error message:
Exiting
/home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require': no such file to load -- openssl (LoadError)
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/session/cookie.rb:1:in `<top (required)>'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /home/hugo/.rvm/gemsin my terminal /ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/session/cookie_store.rb:4:in `<top (required)>'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/configuration.rb:131:in `const_get'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/configuration.rb:131:in `session_store'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:172:in `block in default_middleware_stack'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:146:in `tap'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:146:in `default_middleware_stack'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/engine.rb:446:in `app'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/finisher.rb:37:in `block in <module:Finisher>'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/hugo/rails_projects/web_app/config/environment.rb:5:in `<top (required)>'
from /home/hugo/rails_projects/web_app/config.ru:4:in `require'
from /home/hugo/rails_projects/web_app/config.ru:4:in `block in <main>'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:51:in `instance_eval'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:51:in `initialize'
from /home/hugo/rails_projects/web_app/config.ru:1:in `new'
from /home/hugo/rails_projects/web_app/config.ru:1:in `<main>'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:40:in `eval'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:40:in `parse_file'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/server.rb:200:in `app'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/server.rb:46:in `app'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/server.rb:301:in `wrapped_app'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/server.rb:252:in `start'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/server.rb:70:in `start'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:54:in `block in <top (required)>'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:49:in `tap'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Can somebody explain to me this error please? I am getting very tired. Thanks in advance.
You compiled ruby without the openssl dependencies. Do
rvm requirements
(or rvm notes if you are using an older version of rvm that doesn't have rvm requirements)
and see what you need to install in your system (typically these are apt-get commands if you are running ubuntu for example), and then recompile your ruby installation
by
rvm remove 1.9.2
rvm install 1.9.2
The first line has the following error:
`require': no such file to load -- openssl (LoadError)
RVM needs to know how to get to your openssl library.
See http://beginrescueend.com/packages/openssl/ for more information on setting up openssl with RVM.