NetBeans hangs up while creating a Rails project - ruby-on-rails

I'm using NetBeans and I'm trying to create a new Rails project trought the wizard, so while I click the finish button, it creates the folder structure but the wizard never finish working and doesn't show nothing on the Projects view.
It just happens when I set up a Sqlite3 DB.
I'm using Rails 3.0.7
Can someone help me?

I have always struggled to create Rails projects using the internal netbeans wizard. Usually I find it easier to create the rails app from the command line:
rails your_app_name
This will create a new folder your_app_name in your current location, and then I create a new project within Netbeans by selecting the 'Ruby on Rails Application with Existing sources' option. And select the freshly created your_app_name folder for the Project folder.
I have found Netbeans to be less reliable with rails 3+ applications than the 2+ and find that run most rails commands directly from the terminal/command prompt.

do you have sqlite3 installed? Anyways people will be able to help you if you can post the netbeans log. Go to the command line and run netbeans from the command line. Then you can see a lot of output/logging info.

Related

Cannot start the debugger in Rubymine. Rails server launcher wasn't found in project

I was trying to debug a rails application(4.03) using rubymine IDE version 7.0.2, but when I configure my application like this
The IDE complained that Rails Server launcher wasn't found in the project.
Please tell me what can I do fix the issue, and could you please recommend other ways of debugging a rails application.
Please note that this bug is easily replicated using Ruby Mine by following these steps.
Create a new rails projects with Ruby Mine, for example DebuggingRails. Which will generate default folders and files. At this point one can debug the application normally.
Create a new folder let's say Server.
Copy all the generated files above to the Server folder, so the project structure will be
DebuggingRails\Server.
Create a debugging configuration , which points to the DebuggingRails\Server.
Try to debug the application using the IDE.
The message "Rails server launcher wasn't found in project" appears
Thanks.
Close your project, remove the .idea folder, and open it back up again.
I had this problem because i chose the wrong folder, you must choose the root folder in the rails project. For example i had this structure
-MyProject
---RoR
-----app
-----bin
-----condig
-----etc
Then I chose the folder call
MyProject
It was wrong.
The correct is choose the folder
RoR

Rails - bin/rails generate doesn't work in recreated project

I've just red "Getting Started with Rails" and trying to create a blog project again from scratch.
I've created a new environment for rails projects with vagrant/virtualbox/ubuntu 12.04
Here is the problem.
I've create a new rails project with
rails new blog
Thereafter, using
bin/rails generate controller pages
I've create a controller, and continued working with project. After some time, I've decided to delete the blog project and start again from scratch.
I've started a new iteration
rails new blog | works fine
cd blog
bin/rails generate controller pages | does not create a controller, does not terminate, only with control + C
I've repeated all steps with a new project blog2. And the result was the same. If i create a new project, then delete it, then create a project with the same name
bin/rails generate
will not work.
Rubu 2.1.3/Rails 4.1.6
What should I do to fix it?
Solved by executing:
spring stop
I had a similar issue when using RVM. I had to close that terminal, opened another terminal, then switched back to that version of ruby.
After that everything worked fine again.

RubyMine is showing the error message: "Error running Development: MyProject: Rails 3.x launcher script was found instead of Rails 4.x one"

I'm updating my project from Rails 3.2.12 to 4.0.0.
I made all necessary corrections but when I try to execute my app using RubyMine 5.4 I'm receiving the message below:
Error running Development: MyProject: Rails 3.x launcher script was found instead of Rails 4.x one. You need '/Users/stackoverflowuser/RubymineProjects/MyProject/bin/rails' script to launch Rails server. Please update server launcher according to Rails 4.x documentation.
What am I doing wrong?
"Hack" solution:
Create a new Rails 4 project: rails new MyTestRails4Project
Copy the bin folder that is within the MyTestRails4Project
Paste bin folder inside the project that has just been migrated to Rails 4
Update
If the first solution doesn't work, as RiPuk suggested:
Run the rake task: rake rails:update
The accepted answer is a bit of a hack - it sounds like you've not finished the upgrade of your project from Rails 3 -> Rails 4.
First thing to do is to run the rake task that interactively updates various files (environments, configs etc) to Rails 4:
rake rails:update
Then assuming that you want to use Spring (of course you do!), run this:
spring binstub --all
it's a problem related to the IDE configutration, one quick solution to this is:
close the project
remove .idea folder
open project
Profit!
if it does not work, try to create a new project (rails new project) and copy the db and app folder from your original project to the new project and create the database using:
rake db:schema:load
I hope this helps.

Cannot start project in rails

I'm pretty new to Rails.
I created a new Rails app: rails new app_name, and ran rails server etc.
But, once I shut down and reopened my machine, I can run neither rails server nor rails console. It says to use the rails new app_name command again, but I just want to restart where I left off the day before.
Any advice is very much appreciated.
I'm guessing your current working directory of your command line is not in your project directory which you created yesterday.
cd some_path/to_my/rails_project
rails server
You must be in the directory that represents your project to do things like launch the server. Otherwise, how does it know what project to launch a server for?
Just make sure you are in the directory of the rails app you created. Sounds like you aren't.

Importing Existing Rails Application to RubyMine Project

I am currently having unnecessary trouble trying to test out RubyMine. My biggest problem is that I cannot find a way to take a existing rails application on my system and convert it to an official RubyMine application, so that I can experience all of the features of RubyMine.
The only options that are available to me are to either create a new RubyMine rails project, to pull a rails project from a git remote (doesn't work), or to open a previous rails directory (which allows you to edit rails code, but it doesn't recognize this directory as a RubyMine project, so I cannot heap all of the benefits that RubyMine has for rails).
Please help me out, RubyMine seems promising
This is RubyMine 4 btw.
File | Open Directory should create a new RubyMine project from the existing sources. I've just tried with a new Rails app and it recognized it as a Rails project and all the features work just like for the new project created from RubyMine.

Resources