I'm trying to follow the Getting Started with Ruby on Heroku (Microsoft Windows) tutorial.
On the "Run the app locally" step, I am encountering an error when trying to setup the database for the demo app.
C:\jruby-getting-started>jruby -S bin\rake db:create db:migrate
ArgumentProcessor.java:655:in `resolveScript': java.lang.NullPointerException
from ArgumentProcessor.java:613:in `runBinScript'
from ArgumentProcessor.java:303:in `processArgument'
from ArgumentProcessor.java:105:in `processArguments'
from ArgumentProcessor.java:98:in `processArguments'
from RubyInstanceConfig.java:165:in `processArguments'
from Main.java:224:in `run'
from Main.java:197:in `main'
I have followed the tutorial instructions so far, including installing Postgres. Why this error happening? How can I resolve it?
Just repeating what's in the comments so this can be marked as answered.
This error results from using JRuby-9.0.0.0 with the Heroku guide. JRuby-9.0.0.0 is support on Heroku, but the guide has not adopted it yet because JRuby-9k has not had it's GA release yet.
FWIW it looks like this may be fixed in JRuby-9.0.0.0.rc2 :)
Related
Project:
https://github.com/jmopr/job-hunter
Background:
Took only 2 intro course on Java 7 years ago.
So I was browsing GitHub and ran across this nifty project that deals with scraping & applying for jobs on indeed.com.
The question is, how do you run it? Here is what I tried to do:
Tried to execute applier.ru I figured I was doing something wrong after getting:
/home/shap/Desktop/job-hunter-master/applier.rb:19:in initialize': uninitialized constant JobApplier::Job (NameError)
from /home/shap/Desktop/job-hunter-master/applier.rb:169:innew'
from /home/shap/Desktop/job-hunter-master/applier.rb:169:in `'
Something was missing, so looking around I found the bin folder and tried executing /bin/setup.ru but i ran into this error:
== Preparing database ==
/var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/application/configuration.rb:110:in database_configuration': Cannot loadRails.application.database_configuration`:
Could not load database configuration. No such file - ["config/database.yml"] (RuntimeError)
Are we supposed to generate our own database file? how would we do that?
Any help or even a push in the right path is deeply appreciated.
You are supposed to generate your own database configuration. It should be stored at config/database.yml. It's a file that specify where's your db server, what's the name of the database and what should be the credentials to access it. Google "rails database.yml example".
Once you have that, creating your actual database is as easy as running these commands
rake db:create
rake db:migrate
There may be many-many other different obstacles on your journey of making this application run. Things that are obvious to rails devs, but arcane to total strangers. I suggest finding and completing a ruby on rails tutorial.
This is ruby on rails project,
after checkout you need install all required dependencies, with command
bundle exec install
Run project you can with command
./bin/rails server
If project is started successful, you can access it with browser using address http://localhost:3000
more about rails you can find there http://guides.rubyonrails.org/getting_started.html
http://guides.rubyonrails.org/getting_started.html
I have had this issue and I have not been able to solve it. I have posted two questions prior to this. The problem is with the rails server (WEBrick). It was running fine in development. I installed a simple jquery-ui gem and ran bundle install and bundle update and the server stopped working. The error is given below.
Server Error
warning: previous definition of APP_PATH was here
Error: Command '-b' not recognized
Usage: rails COMMAND [ARGS]
After doing further investigation, I realized that the way to fix this is updating bin, so I ran the command, rake rails:update:bin. This also gave me an error. The snippet of the error is given below.
rake aborted!
LoadError: cannot load such file -- net/ssh
/home/ubuntu/workspace/config/application.rb:7:in `<top (required)>'
/home/ubuntu/workspace/Rakefile:4:in `<top (required)>'
I figured that if I could fix the rake command issue, I could potentially run the command and fix the server problem. I tried looking for solution on the web, however, they were focused towards MySQL database. I run sqlite3 version 1.3.9 in development. I have looked for potential reasons why rake rails:update:bin command would fail and give me that error but I haven't found a clear answer. I have never changed any of the code in the config/bin directory. Everything looks normal.
I have been trying to debug the this problem for the past two days. I have had no luck. I have tried to un-install gems such as spring and PostgreSQL and installed them again to see if they causing any problems. Not the problem. I have read almost every suggestion on the web. None of them really have the same issue as mine. If anyone can help me figure this problem out, It would be a great deal of help. Any documentation, posts or anything that can help me solve the problem would be highly appreciated. I hope I made myself clear and included all the relevant information, I tried to keep it concise. If any additional detail is needed, please do let me know. Again, any help would be appreciated. Thanks!!!
here is very similar post.
Ruby on rails - cannot load such file -- net/ssh
Only you need is add this to your Gemfile and install.
gem 'net-ssh'
It worked for me.
I am new to Ruby on Rails and am simply trying to setup a sample application by following a getting started guide. I am installing Rails on a Mac OS X Mountain Lion. I get rails working where I can run the default getting started application. When I try to run the rake db:create command, however, I am getting the following message:
rake aborted!
cannot load such file -- sqlite3/sqlite3_native
I know there are a bunch of questions asked and answered regarding this but none of the suggestions already identified have been able to help.
Please let me know what I can do to get this working.
Thanks
Cameron
Seemingly out of the blue, I am no longer able to run "rails server" or "rails console" on this project due to the above error message. I'm rather certain I ran a "gem update heroku" on this project's RVM gemset a few days ago, so that may be the root cause. Ruby is ruby-1.9.2-p136. Rails is Rails 3.0.9. Once I get to the bottom of this error, I plan on upgrading to the latest Rails 3.0 release (3.0.14), but need to resolve this issue first. Any ideas? I tried installing the Heroku toolbet to no avail.
The Heroku gem seems to be fine in all other ways, I am able to run "heroku login", "heroku rake", "heroku console", etc, just fine. The issue is only on my dev machine and only when I attempt to start up the server or run console. Next step is to clone this project on my new MacBook and move forward that way...
Upgrading to the latest minor versions of Ruby (1.9.2) and Rails (3.0.14) resolved the issues. Thanks for all your help.
I'm trying to deploy my first app with rails. I'm unable to deploy it, and I'm unhappy because the framework itself allowed me to develop really quickly the application, but I've only two days to make the deployment work :-(
I've installed and configured passenger following a tutorial (i'm using RVM).
When I access the page I have the following error page: traceback here (posted on pastebin to keep this post clear).
What is wrong?
i just uploaded the whole project on the production server, ran bundle install, rake db:create rake db:migrate and rake db:seed. Am I missing some step?
Why it doesn't run?
Developed using Rails 3.2.3 with Ruby 1.9.3.
Please help me to get it running.
Thanks,
Alex.
I have very little information about your problem but I have and idea what is going on. Check your belongs_to association in your event model if there is a class parameter replace it with class_name.