problems while running a rails proyect - ruby-on-rails

I am about to continue the project of another programmer and the person who contacted me sent me the code, I just installed all the gems and I am using the correct version of ruby but when doing "rails s" does not start the server, I enter the folder of the project but I see that there are not some folders that are usually in my rails projects at the time of creating the project. How the project is currently running on a server I don't know if they have dispensed with these folders or I'm missing something, the structure of the project is structured in the image, I would be very grateful if you could answer my question.
apparently the project makes use of the rbenv-vars gem

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

How do I set up an old Ruby on Rails project on a new server?

I'm not a RoR programmer myself, but a good client of ours has sent a project their previous web team built and I need to get it up and running on their server.
The server uses cPanel and Ruby on Rails is already installed. I've created a project via the cPanel wizard and located the file tree via SSH.
Using SSH, I've tried to replace this file tree with the project I've been sent, but when I hit 'run' in cPanel, the application doesn't actually start (although the success message would indicate that it has).
If I leave the original cPanel-created application in place, I can run/stop no problem and the web interface at :12001 opens up just fine.
I assume there are either conflicts with RoR versions that I need to resolve, or there's simply more to it than just replacing the file tree? Again I'm not a RoR programmer and I'm having a hard time finding a migration guide that tells me anything other than "set up in cPanel and replace the files".
I'd very much appreciate either some genuinely useful links to RoR application setup/migration guides (ideally for cPanel) or a step-by-step answer please.
First, forget Cpanel for now. Try in one environment where you can control everything.
Try to know better the rails version used and the associated gem19s or plugin if from 2.x days. The ruby version is important too, only then you can start defining a plan.
I'm afraid you won't get a step-by-step answer, but I'm sure you can be pointed in the right direction by providing the requested information.
Simple questions: Do you have a Gemfile file at the top at your project? Do you have any plugins (stuff in vendor/plugins)?
Update:
With the Gemfile provided here are the required steps:
Install ruby (if you haven't install it using rvm. The version 1.9.3-x should be the safest.
Install rubygems
Install bundler
Go the project dir and run bundle install
run rake db:migrate (assure you have the database setup acording to config/database.yml
run rails s and check the logs and see if the server is up.
If after installing bundler, you don't have the bundle command in your path, you need to add this your .bash_profile:
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH

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.

Railties in Rails 2.3 project?

I've inherited a small Rails project from a new client and unfortunately the previous developer(s) left essentially no information other than the Rails app instance running in production. (No source repository, no documentation, just the login to the production server.)
Inspecting the server shows Rails version 2.3.8 installed (confirmed by the version number in "config/environment.rb") but when I try to run "ruby script/console" (or "server") on my local dev environment I get (essentially fatal) error messages originating from files in "vendor/rails/railties" and searching the internet for "railties" shows a lot of Rails 3 documentation.
I'm guessing that a previous developer/maintainer crossed the Rails 2/3 streams somehow. Should I be ok to just delete the entire "vendor/rails" directory or am I missing something?
What kind of error are you getting? Do you know that your local environment is the same as production? Do other Rails 2.3.8 projects run fine on your machine?
Now, I think it should be fine to remove vendor/rails with the exception being that if the previous developer monkeypatched something in Rails, but directly in the vendor/rails directory. Then, you might have a problem.
This approach might be a bit tedious, but I might go as follows:
Clone 2.3.8 somewhere else on my machine.
Check it in to some form of version control.
Copy your version of 2.3.8 from the project into the newly cloned directory.
Diff it.
This should show you if the previous developer made any changes, both significant and insignificant, to Rails.
Good luck, because this doesn't sound very fun :(

What is your version control and deployment workflow with Rails?

Especially when considering a fresh Rails project, what does your version control and deployment workflow look like? What tools do you use?
I'm interested in answers for Mac, *nix and Windows work machines. Assume a *nix server.
I'll edit for clarity if need be.
Create a copy of my personal Rails 2.1.1 template with preinstalled plugins and frozen gems.
Change DB passwords, session secret/name and deploy.rb.
Create a private or public repository on GitHub as needed.
Push the empty rails project to GitHub.
SSH to Server and configure apache (copy Virtual Host file and mongrel config files from old project)
Create empty database on MySQL server
cap deploy:setup && cap deploy:cold
If everything works so far: Start developing and committing to GitHub. cap deploy as needed.
Update: Don't forget to write tests for everything you do!
Using Windows Vista and a fresh Ubuntu install at Slicehost.
Create a new empty project in
NetBeans.
Fire deprec (http://www.deprec.org) to install
the Rails stack, including version
control, on the target slice.
Commit the empty project to Subversion.
Using Capistrano, test deploy.
Begin actual development after I've verified that I can access the
Rails start page and, possibly,
scaffolding. (This is really not
necessary because I've done this several times and the software works like it says it does.)
Deprec is seriously magic -- it takes the time it takes to clean-start a Rails project (including server configuration and all that jazz) from about a working day down to about an hour -- and that is an hour where you can be doing coding while everything installs.
this guy documents every workflow he's ever experienced
http://subtlegradient.com/articles/2007/03/30/web-development-environment-and-workflow

Resources