Rails server won't run - ruby-on-rails

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.

Related

cucumber/formatter/legacy_api/ast (LoadError) when updating cucumber

I'm upgrading Ruby from version 2.5.1 to 2.7.2.
So, I'm Upgrading Cucumber from 3.1.2 to the latest version 8.0.0.rc.1
I'm just learning Ruby as I work, so I'm sorry if I ask any question that is too easy for you.
The stack for the error is:
loading content yaml support/data/static_content.yaml
loading environment yaml support/environments/stage.yaml
cannot load such file -- cucumber/formatter/legacy_api/ast (LoadError)
/home/acabista/Documents/automations/web-automation/cucumber/support/patches/rerun_file.rb:2:in `require'
/home/acabista/Documents/automations/web-automation/cucumber/support/patches/rerun_file.rb:2:in `<top (required)>'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/glue/registry_and_more.rb:123:in `require'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/glue/registry_and_more.rb:123:in `load_code_file'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/runtime/support_code.rb:145:in `load_file'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/runtime/support_code.rb:82:in `block in load_files!'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/runtime/support_code.rb:81:in `each'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/runtime/support_code.rb:81:in `load_files!'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/runtime.rb:274:in `load_step_definitions'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/runtime.rb:74:in `run!'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/cli/main.rb:29:in `execute!'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/bin/cucumber:9:in `<top (required)>'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/bin/cucumber:23:in `load'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/bin/cucumber:23:in `<main>'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/bin/ruby_executable_hooks:24:in `eval'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/bin/ruby_executable_hooks:24:in `<main>'
[acabista#acabista cucumber]$ ./start_auto.sh
loading content yaml support/data/static_content.yaml
loading environment yaml support/environments/stage.yaml
cannot load such file -- cucumber/formatter/legacy_api/ast (LoadError)
/home/acabista/Documents/automations/web-automation/cucumber/support/patches/rerun_file.rb:2:in `require'
/home/acabista/Documents/automations/web-automation/cucumber/support/patches/rerun_file.rb:2:in `<top (required)>'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/glue/registry_and_more.rb:123:in `require'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/glue/registry_and_more.rb:123:in `load_code_file'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/runtime/support_code.rb:145:in `load_file'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/runtime/support_code.rb:82:in `block in load_files!'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/runtime/support_code.rb:81:in `each'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/runtime/support_code.rb:81:in `load_files!'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/runtime.rb:274:in `load_step_definitions'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/runtime.rb:74:in `run!'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/lib/cucumber/cli/main.rb:29:in `execute!'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/gems/cucumber-8.0.0/bin/cucumber:9:in `<top (required)>'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/bin/cucumber:23:in `load'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/bin/cucumber:23:in `<main>'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/bin/ruby_executable_hooks:24:in `eval'
/home/acabista/.rvm/gems/ruby-2.7.2#web-automation/bin/ruby_executable_hooks:24:in `<main>'
These are the first 2 lines from the file rerun_file.rb that is throwing the error:
require 'cucumber/formatter/io'
require 'cucumber/formatter/legacy_api/ast'
And I just use Ast in two parts of my code:
!(Cucumber::Formatter::LegacyApi::Ast::ScenarioOutline === feature_element)
Cucumber::Ast::OutlineTable::ExampleRow === table_row
I can't post more of the code because it's proprietary.
I already tried some other things that I found here in stackoverflow but nothing seems to work, and I really want to upgrade Cucumber, so going back to 3.1.2 is not a fix. How can I do that?

Could not open library '/usr/lib/libmecab.so.2': /usr/lib/libmecab.so.2: cannot open shared object file: No such file or directory (LoadError)

when i tried to start my rails server i got an error related to mecab
So i followed below given instruction to install mecab and it was installed successfully
i checked the version of mecab
while installing mecab followed steps are
1. gem install natto
2. sudo apt-get install mecab libmecab-dev
3. sudo apt-get install mecab-ipadic-utf8
4. mecab --version
5. sudo find / -name libmecab.so*
this gives an error of permission denied
6. echo 'export MECAB_PATH=/usr/lib/libmecab.so.2' >> ~/.bash_profile
7. source ~/.bash_profile
After all, this when I tried to start rails server I got below given error
/home/admin123/.rvm/gems/ruby-2.3.1/gems/ffi-1.9.14/lib/ffi/library.rb:147:in `block in ffi_lib': Could not open library '/usr/lib/libmecab.so.2': /usr/lib/libmecab.so.2: cannot open shared object file: No such file or directory (LoadError)
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/ffi-1.9.14/lib/ffi/library.rb:100:in `map'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/ffi-1.9.14/lib/ffi/library.rb:100:in `ffi_lib'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/natto-1.1.1/lib/natto/binding.rb:64:in `<module:Binding>'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/natto-1.1.1/lib/natto/binding.rb:6:in `<module:Natto>'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/natto-1.1.1/lib/natto/binding.rb:2:in `<top (required)>'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/natto-1.1.1/lib/natto/natto.rb:2:in `<top (required)>'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/natto-1.1.1/lib/natto.rb:2:in `<top (required)>'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:81:in `require'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:81:in `block (2 levels) in require'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:76:in `each'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:76:in `block in require'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:65:in `each'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:65:in `require'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler.rb:114:in `require'
from /home/admin123/WFSGo/myproject/config/application.rb:16:in `<top (required)>'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
On Ununtu the mecab lib is in /usr/lib/x86_64-linux-gnu/libmecab.so. So this should work:
export MECAB_PATH=/usr/lib/x86_64-linux-gnu/libmecab.so
rails server

ruby app is giving problems with incompatible libraries

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.

Cannot start rails server, I get an error

I'm new to Ruby on Rails. So, I'd got this error before, and I reinstalled rails and ruby and installed them again, but I still get it.
The error is:
/home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /home/X/Documents/Appw/config/application.rb:7:in `<top (required)>'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from /home/X/Documents/Appw/bin/rails:9:in `require'
from /home/X/Documents/Appw/bin/rails:9:in `<top (required)>'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/client/rails.rb:28:in `load'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/client/rails.rb:28:in `call'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/client/command.rb:7:in `call'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/client.rb:28:in `run'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/bin/spring:51:in `<top (required)>'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/binstub.rb:11:in `load'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/X/Documents/Appw/bin/spring:13:in `require'
from /home/X/Documents/Appw/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I tried updating the uglifier gem, but nothing happened.
It looks like you have't installed nodejs
sudo apt-get install nodejs
Should work !!!
The problem was that I didn't have nodejs installed. After I've installed it, everything worked smoothly.
What is you gemfile/gem list?
Actually having meteor installed doesn't count as having nodejs installed. nodejs is required for uglifier package, so simple: yum install nodejs resolves the issue.

Using ruby 1.9.2, rails3.1.0, Why am I getting an error when I try to generate a scaffold.

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

Resources