I am trying t configure the Salesforce Vulnreport tool, and everytime I run the SEED.rb I get the following error:
Setting up the PostgreSQL database...
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- dm--adapter (LoadError)
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/vendor_ruby/dm-core/adapters.rb:163:in `load_adapter'
from /usr/lib/ruby/vendor_ruby/dm-core/adapters.rb:133:in `adapter_class'
from /usr/lib/ruby/vendor_ruby/dm-core/adapters.rb:13:in `new'
from /usr/lib/ruby/vendor_ruby/dm-core.rb:230:in `setup'
from /root/Documents/Resources/Applications/vulnreport/models/init.rb:19:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from ./SEED.rb:20:in `<main>'
I have checked the Gemfile and 'dm-postgres-adapter' is included and installed. I have no idea why I am getting this error, and though I found others attempting to install this with the same issue, I found no fixes. I am not proficient enough with Ruby to really know where to go from here. Any help would be appreciated. Also I hope this I posted this in an OK place.
Thanks!
I realized while looking through my repo that my .env file had a small error in the 'export DATABASE_URL' component which was causing the issue. I was able to fix it by adjusting the incorrect password I had (1 character was off). However, the error message is not very clear. I feel it could have more easily pointed to an authentication failure to the database being the issue.
Related
I'm new on Ruby on Rails (actualy I'm new programming in general) and I tried to start a new server for my web app. I followed all the rules that were in the book, installed everything required (I hope I've installed it correctly), but it keeps giving me the following error:
My command ->
C:\Users\Júlia\work\demo>ruby bin/rails server
C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:50:in `match?': invalid byte sequence in UTF-8 (ArgumentError)
from C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:50:in `chop_basename'
from C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:374:in `plus'
from C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:354:in `+'
from C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:420:in `join'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/settings.rb:444:in `global_config_file'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/settings.rb:93:in `initialize'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:330:in `new'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:330:in `settings'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:99:in `configured_bundle_path'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:95:in `bundle_path'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:639:in `configure_gem_home_and_path'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:81:in `configure'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:194:in `definition'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:143:in `setup'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/setup.rb:10:in `block in <top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/ui/shell.rb:136:in `with_level'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/ui/shell.rb:88:in `silence'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/setup.rb:10:in `<top (required)>'
from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from C:/Users/Júlia/work/demo/config/boot.rb:3:in `<top (required)>'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'
I'm so frustrated right now, I keep doing things apparently right but something always has to go wrong! Anyways, I hope someone will be able to help me here :(
You can follow GoRails guide to install RoR on windows it will be much easier.
Here it is: Install Ruby On Rails on Windows 10
Also after installing it you may face some other issues related to your database ( whatever database you use) like you may have installed Postgresql on windows, so when after installing it on WSL you need to kill the one running on the port that WSL will use, and similar issues, all solved across the internet
Complete beginner to programming here. I'm trying to run ruby app.rb and I get the following error:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- oauth2 (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/dankearns/projects/wgc_groundwork/lib/profile.rb:1:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from app.rb:2:in `<main>'
This is really driving me insane. I've tried a number of fixes but not seem to work. Can anyone help?
ERROR: While executing gem ... (Errno::EACCES) Permission denied - /Library/Ruby/Gems/2.0.0/gems/multipart-post-2.0.0
You're trying to install code into your Apple-installed Ruby.
Don't do that.
Instead, use rbenv or RVM to install Ruby in a sandbox, which you can then play with to your heart's content. If you go with RVM, read the installation page completely. People failing to do what that page says, or what RVM says after it's on the disk, results in one of the top RVM problems on Stack Overflow.
Apple installed theirs for their convenience and it's OK for us to use it, but changing it can lead to problems, especially if you remove something it or some other app needs.
I'm a newb to rails, so please excuse this question but I've been searching everywhere for how to do it. I have a github project I cloaned that I'm going to have to eventually work on, but need to view it now in the browser (will be crash coursing to get up to speed the next couple months). I've downloaded the directory and ran bundle install. Now I'm trying to start the rails server and I get this:
Chriss-MacBook-Pro:chris cgood$ rails server
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails/railtie/configuration.rb:85:in `method_missing': undefined method `active_record' for #<Rails::Application::Configuration:0x007fc07b649c48> (NoMethodError)
from /Users/cgood/event/chris/config/application.rb:69:in `<class:Application>'
from /Users/cgood/event/chris/config/application.rb:25:in `<module:ChrisGood>'
from /Users/cgood/event/chris/config/application.rb:24:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails/commands.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Any help would be really appreciated! I've been pulling out hair for hours tackling error message after error message. This one has me stuck as hard to find anything on the internet about it.
I have xcode, rails installer, homebrew and postgreSQL installed. Thanks.
2 things:
upgrade rails!! there's a post about the dangers of using 3.2.11
your app needs a file called database.yml, read this and this to find out what to put in it
Normally your app would have that file in it already, but since it usually contains sensitive data, like database user passwords, people tend to leave it out of their github repos. So you just need to make your own one.
When I run rinari-web-server I am getting this error:
/home/pedrorolo/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- bundler/setup (LoadError)
from /home/pedrorolo/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/pedrorolo/workspace/geoptima-registrator/config/boot.rb:6:in `<top (required)>'
from /home/pedrorolo/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/pedrorolo/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/pedrorolo/workspace/geoptima-registrator/script/rails:5:in `<main>'
I have the rvm emacs package installed. What am I doing wrong?
Had the same problem, fixed it by installing rvm.el
https://github.com/senny/rvm.el
Edit: duh, didn't fully read your question. Sorry.
I managed to make this work by explicitly loading the rvm.el file in my .emacs.
My OS is Windows 7.
My problem is that when I try to run rails server, an error occurs. I have installed the sqlite3 gem, even the sqlite-ruby gem, and still nothing.
I already don't know what to do anymore.
If anyone needs any additional information, ask for it and I'll put it up.
The complete error is:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler.rb:120:in `require'
from C:/Users/JorWan/Desktop/JorWan/ASCENDSTUDIO/RoR/intento2/config/application.rb:7:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
download the required executable and the dll from http://www.sqlite.org/download.html
extract to your ruby's bin (c:\Ruby192\bin)
Forget all the so called "answers", no compiling of the sources or downloading pre-compiled libraries will solve this problem, believe me I tried everything, the problem lies somewhere else. This is how it works on windows:
bundle update sqlite3
You likely get another similar error after this one regarding nokogiri, fix it with the command:
bundle update nokogiri
Enjoy your Ruby App!
Is that file (/sqlite3/sqlite3_native) in your PATH environment variable? It will need to be in order for that gem to work. If you need to check try using echo %PATH% on the command prompt.
If it ends up that you need to add it to your path you can either SET PATH=%PATH%;C:\Path\To\Sqlite3 or change your environment variables by selecting the Properties\Advances\Environment Variables option after right-clicking on My Computer. Edit the path variable to contain your path and viola!
This URL provides the step-wise description and solution.
Hope it works for you.
http://rubyonwindowsguides.github.io/book/ch02-05.html
If you have extracted "exe"s and "dll"s from Sqlite download link to Ruby's bin folder and still have this problem. Try this:
bundle update
gem uninstall sqlite3
Given a choice between multiple versions of sqlite3, choose last option 'All versions'. Enter last number here
Select gem to uninstall:
1. sqlite3-1.3.13
2. sqlite3-1.3.13-x64-mingw32
3. All versions
>3
.
.
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]
>
y
gem install sqlite3 --platform=ruby
rails server
This should work.
Read through this link for more explanation if above works for you.