I have a problem loading a gem (pg, a postgreSQL API for ruby) i have installed for ruby on windows. It was successfully installed with gem install. I downloaded Strawberry perl for the libpq libs and headers required for the pg gem. I received the following successful output:
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
Successfully installed pg-1.2.3
Parsing documentation for pg-1.2.3
Installing ri documentation for pg-1.2.3
Done installing documentation for pg after 7 seconds
1 gem installed
If I run gem list I can see the gem is also installed along with other gems:
gem list
> pg (1.2.3)
However I am unable to load it using the require method. If I try to run a script containing require 'pg' I get the following error:
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:83:in `add_dll_directory_winapi': AddDllDirectory failed for C:/Ruby30-x from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:50:in `initialize'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `new'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `add_dll_directory'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:15:in `block in <top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:26:in `rescue in <top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:4:in `<top (required)>'
from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
from P:/Projekte/OPTIMA_910/Hydraulik/Scripts/pg_snippet.rb:2:in `<main>'
<internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': 126: The specified module could not be found. - C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg_ext.so (LoadError)
from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:5:in `<top (required)>'
from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
from D:/Scripts/pg_snippet.rb:2:in `<main>'
<internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- pg (LoadError)
from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from D:/Scripts/pg_snippet.rb:2:in `<main>'
Likewise I try to run it as a command on irb I get a slightly different output:
Traceback (most recent call last):
14: from C:/Ruby30-x64/bin/irb.cmd:31:in `<main>'
13: from C:/Ruby30-x64/bin/irb.cmd:31:in `load'
12: from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/irb-1.3.0/exe/irb:11:in `<top (required)>'
11: from (irb):2:in `<main>'
10: from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
9: from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
8: from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
7: from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:4:in `<top (required)>'
6: from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:26:in `rescue in <top (required)>'
5: from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:15:in `block in <top (required)>'
4: from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `add_dll_directory'
3: from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `new'
2: from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:50:in `initialize'
1: from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:83:in `add_dll_directory_winapi'
RubyInstaller::Runtime::DllDirectory::WinApiError (AddDllDirectory failed for C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/x64-mingw32)
irb(main):003:0> gem list
Traceback (most recent call last):
5: from C:/Ruby30-x64/bin/irb.cmd:31:in `<main>'
4: from C:/Ruby30-x64/bin/irb.cmd:31:in `load'
3: from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/irb-1.3.0/exe/irb:11:in `<top (required)>'
2: from (irb):2:in `<main>'
1: from (irb):3:in `rescue in <main>'
NameError (undefined local variable or method `list' for main:Object)
irb(main):004:0> C:/Ruby30-x64/lib/ruby/3.0.0/reline/unicode.rb:124:in `calculate_width': undefined method `encode' for nil:NilClass (NoMethodError)
from C:/Ruby30-x64/lib/ruby/3.0.0/reline/line_editor.rb:1314:in `calculate_width'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline/line_editor.rb:126:in `check_multiline_prompt'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline/line_editor.rb:365:in `rerender'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:248:in `block (3 levels) in inner_readline'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:246:in `each'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:246:in `block (2 levels) in inner_readline'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:330:in `block in read_io'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:284:in `loop'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:284:in `read_io'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:245:in `block in inner_readline'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:243:in `loop'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:243:in `inner_readline'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:175:in `readmultiline'
from C:/Ruby30-x64/lib/ruby/3.0.0/forwardable.rb:238:in `readmultiline'
from C:/Ruby30-x64/lib/ruby/3.0.0/forwardable.rb:238:in `readmultiline'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb/input-method.rb:302:in `gets'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb.rb:519:in `block (2 levels) in eval_input'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb.rb:721:in `signal_status'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb.rb:518:in `block in eval_input'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb/ruby-lex.rb:202:in `lex'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb/ruby-lex.rb:174:in `block (2 levels) in each_top_level_statement'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb/ruby-lex.rb:171:in `loop'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb/ruby-lex.rb:171:in `block in each_top_level_statement'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb/ruby-lex.rb:170:in `catch'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb/ruby-lex.rb:170:in `each_top_level_statement'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb.rb:537:in `eval_input'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb.rb:472:in `block in run'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb.rb:471:in `catch'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb.rb:471:in `run'
from C:/Ruby30-x64/lib/ruby/3.0.0/irb.rb:400:in `start'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/irb-1.3.0/exe/irb:11:in `<top (required)>'
from C:/Ruby30-x64/bin/irb.cmd:31:in `load'
from C:/Ruby30-x64/bin/irb.cmd:31:in `<main>'
I hope there is only some extra path I need to specify. I am also not using rails btw. Any help would be greatly appreciated! If anyone else has a good suggestion for an alternative for pg I might also be open to considering that.
Thanks in advance
Related
This is the error I'm getting, please tell me what should I do?
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/prawn-2.4.0/lib/prawn/transformation_stack.rb:10:in `require': cannot load such file -- matrix (LoadError)
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/prawn-2.4.0/lib/prawn/transformation_stack.rb:10:in `<top (required)>'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/prawn-2.4.0/lib/prawn.rb:67:in `require_relative'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/prawn-2.4.0/lib/prawn.rb:67:in `<top (required)>'
from C:/Users/Ayushman Bedi/diabetes_analyst-master/diabetes_analyst-master/config/environment.rb:12:in `require'
from C:/Users/Ayushman Bedi/diabetes_analyst-master/diabetes_analyst-master/config/environment.rb:12:in `<top (required)>'
from C:/Users/Ayushman Bedi/diabetes_analyst-master/diabetes_analyst-master/config.ru:2:in `require'
from C:/Users/Ayushman Bedi/diabetes_analyst-master/diabetes_analyst-master/config.ru:2:in `block in <main>'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `eval'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `new_from_string'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:105:in `load_file'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/builder.rb:66:in `parse_file'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:249:in `app'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:422:in `wrapped_app'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:312:in `block in start'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:379:in `handle_profiling'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:311:in `start'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/server.rb:168:in `start'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rack-2.2.4/bin/rackup:5:in `<top (required)>'
from C:/Ruby31-x64/bin/rackup:25:in `load'
from C:/Ruby31-x64/bin/rackup:25:in `<main>'
I installed all the gems required, matrix, rack, prawn... but still.
When I installed redmine-3.3 & 3.4 , I am not getting redmine page
I am facing this Error
Web application could not be started
undefined method `require_sudo_mode' for EmailAddressesController:Class (NoMethodError)
/usr/share/redmine/app/controllers/email_addresses_controller.rb:21:in `<class:EmailAddressesController>'
/usr/share/redmine/app/controllers/email_addresses_controller.rb:18:in `<top (required)>'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `require'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `block in require'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:236:in `load_dependency'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `require'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:359:in `require_or_load'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:313:in `depend_on'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:225:in `require_dependency'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:444:in `block (2 levels) in eager_load!'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:443:in `each'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:443:in `block in eager_load!'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:441:in `each'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:441:in `eager_load!'
/usr/lib/ruby/vendor_ruby/rails/application/finisher.rb:53:in `block in <module:Finisher>'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `instance_exec'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `run'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:55:in `block in run_initializers'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in `each'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in `run_initializers'
/usr/lib/ruby/vendor_ruby/rails/application.rb:136:in `initialize!'
/usr/lib/ruby/vendor_ruby/rails/railtie/configurable.rb:30:in `method_missing'
/usr/share/redmine/config/environment.rb:14:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/usr/lib/ruby/vendor_ruby/rack/builder.rb:51:in `instance_eval'
/usr/lib/ruby/vendor_ruby/rack/builder.rb:51:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:158:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'
Application root /usr/share/redmine Environment (value of RAILS_ENV, RACK_ENV, WSGI_ENV and PASSENGER_ENV) production Ruby interpreter
command /usr/bin/ruby.. .... ..
Can you give me suggestions?
Please ensure you'r connected with your database and did you missing any required gem.
require_sudo_mode. If the error comes because of this you definitely missing this gem.
This type of error comes under database not connected issue.If you are fix that this would be start.Thanks..!
I am using vmware and trying to run rake db:migrate for getting the database tables. I am getting this error.
ubuntu#ubuntu-VirtualBox:~/hw-acceptance-unit-test-cycle/rottenpotatoes$ bundle exec rake db:migrate
rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'coffee-rails'.
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Backtrace for gem load error is:
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in ` autodetect'
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>'
/var/lib/gems/2.3.0/gems/coffee-script-2.4.1/lib/coffee_script.rb:1:in `require'
/var/lib/gems/2.3.0/gems/coffee-script-2.4.1/lib/coffee_script.rb:1:in `<top (required)>'
/var/lib/gems/2.3.0/gems/coffee-script-2.4.1/lib/coffee-script.rb:1:in `require'
/var/lib/gems/2.3.0/gems/coffee-script-2.4.1/lib/coffee-script.rb:1:in `<top (required)>'
/var/lib/gems/2.3.0/gems/coffee-rails-4.1.1/lib/coffee-rails.rb:1:in `require'
/var/lib/gems/2.3.0/gems/coffee-rails-4.1.1/lib/coffee-rails.rb:1:in `<top (required)>'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
/home/ubuntu/hw-acceptance-unit-test-cycle/rottenpotatoes/config/application.rb:12:in `<top (required)>'
/home/ubuntu/hw-acceptance-unit-test-cycle/rottenpotatoes/Rakefile:5:in `require'
/home/ubuntu/hw-acceptance-unit-test-cycle/rottenpotatoes/Rakefile:5:in `<top (required)>'
/var/lib/gems/2.3.0/gems/rake-11.2.2/lib/rake/rake_module.rb:28:in `load'
/var/lib/gems/2.3.0/gems/rake-11.2.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/var/lib/gems/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:686:in `raw_load_rakefile'
/var/lib/gems/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:96:in `block in load_rakefile'
/var/lib/gems/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:178:in `standard_exception_handling'
/var/lib/gems/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:95:in `load_rakefile'
/var/lib/gems/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:79:in `block in run'
/var/lib/gems/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:178:in `standard_exception_handling'
/var/lib/gems/2.3.0/gems/rake-11.2.2/lib/rake/application.rb:77:in `run'
/var/lib/gems/2.3.0/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Bundler Error Backtrace:
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
/home/ubuntu/hw-acceptance-unit-test-cycle/rottenpotatoes/config/application.rb:12:in `<top (required)>'
/home/ubuntu/hw-acceptance-unit-test-cycle/rottenpotatoes/Rakefile:5:in `require'
/home/ubuntu/hw-acceptance-unit-test-cycle/rottenpotatoes/Rakefile:5:in `<top (required)>'
/var/lib/gems/2.3.0/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect'
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>'
/var/lib/gems/2.3.0/gems/coffee-script-2.4.1/lib/coffee_script.rb:1:in `require'
/var/lib/gems/2.3.0/gems/coffee-script-2.4.1/lib/coffee_script.rb:1:in `<top (required)>'
/var/lib/gems/2.3.0/gems/coffee-script-2.4.1/lib/coffee-script.rb:1:in `require'
/var/lib/gems/2.3.0/gems/coffee-script-2.4.1/lib/coffee-script.rb:1:in `<top (required)>'
/var/lib/gems/2.3.0/gems/coffee-rails-4.1.1/lib/coffee-rails.rb:1:in `require'
/var/lib/gems/2.3.0/gems/coffee-rails-4.1.1/lib/coffee-rails.rb:1:in `<top (required)>'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in block in require'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:ineach'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in require'
/var/lib/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:106:inrequire'
/home/ubuntu/hw-acceptance-unit-test-cycle/rottenpotatoes/config/application.rb:12:in <top (required)>'
/home/ubuntu/hw-acceptance-unit-test-cycle/rottenpotatoes/Rakefile:5:inrequire'
/home/ubuntu/hw-acceptance-unit-test-cycle/rottenpotatoes/Rakefile:5:in <top (required)>'
/var/lib/gems/2.3.0/gems/rake-11.2.2/exe/rake:27:in'
(See full trace by running task with --trace)
What is the problem?
If you are on Linux then run:
sudo apt-get install nodejs
On Mac:
brew install node
and then run bundle and try to migrate. Must work.
Also you shall be more attentive to the search on Stackoverflow for not to duplicate same topics.
Rails - Could not find a JavaScript runtime?
I'm just getting my feet wet in rails development. Trying to learn from "Head First Rails", which is fairly out of date. But I'm updating the commands to more modern versions of rails.
Anyway, I'm trying to use the rails generate scaffold command and running into the following error:
[root#web1:/var/www/tickets] #rails generate scaffold name:string seat_id_seq:string address:text price_paid:decimal email_address:string
invoke active_record
/usr/local/rvm/gems/ruby-1.9.3-p547/gems/railties-4.1.5/lib/rails/generators/base.rb:258:in `const_defined?': wrong constant name Name:string (NameError)
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/railties-4.1.5/lib/rails/generators/base.rb:258:in `block in class_collisions'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/railties-4.1.5/lib/rails/generators/base.rb:249:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/railties-4.1.5/lib/rails/generators/base.rb:249:in `class_collisions'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/railties-4.1.5/lib/rails/generators/named_base.rb:200:in `block in check_class_collision'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/invocation.rb:115:in `invoke'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/group.rb:277:in `block in _invoke_for_class_method'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/shell.rb:68:in `with_padding'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/group.rb:266:in `_invoke_for_class_method'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/group.rb:149:in `_invoke_from_option_orm'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/railties-4.1.5/lib/rails/generators.rb:157:in `invoke'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/railties-4.1.5/lib/rails/commands/generate.rb:11:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:135:in `generate_or_destroy'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:51:in `generate'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/railties-4.1.5/lib/rails/commands.rb:17:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:247:in `require'
from /var/www/tickets/bin/rails:8:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:241:in `load'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:241:in `block in load'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:232:in `load_dependency'
from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/activesupport-4.1.5/lib/active_support/dependencies.rb:241:in `load'
from /usr/local/rvm/rubies/ruby-1.9.3-p547/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p547/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
I'm running ruby 1.9.3 via rvm and rails 4 via gem. The server is CentOS 7
I was just wondering if any of you might have run into a similar situation and know how I can get past this error.
Thanks!
Usage:
rails generate scaffold NAME [field[:type][:index] field[:type][:index]] [options]
Examples:
`rails generate scaffold post`
`rails generate scaffold post title body:text published:boolean`
You're not specifying name attribute, (i.e model)
I'm using MongoMapper with Padrino, and I'm having trouble with executing any padrino tasks. I get this error for nearly every tasks.
ethan#tardis:/var/www/sakura$ padrino rake -T
=> Executing Rake -T ...
/home/ethan/.rvm/gems/ruby-1.9.2-head/gems/mongo_mapper-0.8.6/lib/mongo_mapper/plugins/modifiers.rb:19:in `set': undefined method `each' for "StandardFormBuilder":String (NoMethodError)
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-helpers-0.9.29/lib/padrino-helpers.rb:33:in `registered'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/sinatra-1.2.6/lib/sinatra/base.rb:1200:in `block in register'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/sinatra-1.2.6/lib/sinatra/base.rb:1198:in `each'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/sinatra-1.2.6/lib/sinatra/base.rb:1198:in `register'
from /var/www/sakura/app/app.rb:3:in `<class:Sakura>'
from /var/www/sakura/app/app.rb:1:in `<top (required)>'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/reloader.rb:128:in `require'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/reloader.rb:128:in `safe_load'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/loader.rb:140:in `block in require_dependencies'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/loader.rb:138:in `each'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/loader.rb:138:in `require_dependencies'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/mounter.rb:125:in `locate_app_object'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/mounter.rb:21:in `initialize'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/mounter.rb:189:in `new'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/mounter.rb:189:in `mount'
from /var/www/sakura/config/apps.rb:34:in `<top (required)>'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/reloader.rb:128:in `require'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/reloader.rb:128:in `safe_load'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/loader.rb:140:in `block in require_dependencies'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/loader.rb:138:in `each'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/loader.rb:138:in `require_dependencies'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/loader.rb:56:in `block in load!'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/loader.rb:56:in `each'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/loader.rb:56:in `load!'
from /var/www/sakura/config/boot.rb:29:in `<top (required)>'
from /home/ethan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/ethan/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/cli/base.rb:51:in `block in rake'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/cli/base.rb:130:in `capture'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/lib/padrino-core/cli/base.rb:51:in `rake'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/gems/padrino-core-0.9.29/bin/padrino:8:in `<top (required)>'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/bin/padrino:19:in `load'
from /home/ethan/.rvm/gems/ruby-1.9.2-head/bin/padrino:19:in `<main>'
I tried this with multiple Ruby versions, with similar results. Is this an error with Sinatra, MongoMapper, or what?
Seems a problem with ActiveSupport.
In your gemfile add:
gem "mongo_mapper", "~> 0.9.1"