Rubymine thinks (incorrectly) that project is already on GitHub - ruby-on-rails

Here is the setup: New project in RubyMine. Ran "Share Project on GitHub". It creates the repo. It attempts to send the project, but fails because my application firewall wanted confirmation of the new connection. I permitted it, but not before RubyMine got the error and cancelled.
Problem: Now I can not sync the project to GitHub from RubyMine. I've attempted to delete the repo from GitHub and re-run "Share Project on GitHub" but RubyMine always gives me the error "Project already exists on GitHub"...even when the repo is no longer there.
Is there a way to make RubyMine forget about this GitHub share and start fresh?

Go to your project physical location and find .git folder(hidden, right click open in new window, if you have problems on mac). You might need figure out how to show hidden folders/files on your OS.
Find file "config"
Delete section(s) [remote "name"]
Try to share again
Enjoy )

Related

Xcode CI and cocoapods private repo

I've been trying to setup OSX server to use Xcode CI. My project uses cocoapods and a private repo. I've been following this tutorial: http://papaanton.com/setting-up-xcode-6-and-apple-server-4-0-for-continues-integration-with-cocoapods/
But when I login as the _xcsbuildd user and run the command to add the private repo I get the following error message
fatal: could not create work tree dir '<repo name>': permission denied
I don't have much experience with users and command line tools. I've seen many comments online saying people need to change permissions to get it to work. But I have no idea what I need to change and where.
Can anyone tell me where / what / how I need to modify to give this user access to complete this process.
Just found the answer. Had no idea where cocoapods was storing these repos. I opened finder. Cmd + shift + g
typed in ~/.cocoapods/repos
right click on the repos folder and give "everyone" read & write access to the folder. All good now, CI working completely

RubyMine: Rails server launcher wasn't found in the project

After importing an existing project into RubyMine, I encountered "Rails server launcher wasn't found in the project" when I Run/Edit Configuration.
I've checked this Cannot start the debugger in Rubymine. Rails server launcher wasn't found in project, but deleting the .idea directory and re-open is not helpful.
I can rails server in the Terminal successfully and the rails server runs. So I guess it's likely a RubyMine related thing.
Thanks,
Allen
The easiest way to fix it:
Close project
Remove .idea folder from project folder
Open project
Bingo!
NOTE: this workaround seems to no longer work with 2017.2. See RUBY-20144
I upgraded from RubyMine to IntelliJ Ultimate IDE 2017.1.5 and I encountered the same error "Run Configuration Error: Rails server launcher wasn't found in project". I was using Ruby v2.4.0 with Rails 5.0.2.
It took me an entire day to solve the issue, so I've written a detailed explanation with screenshots to guide others.
It occurred when I tried to Run or Debug my Rails server from within IntelliJ.
Other solutions also didn't fix the error. I tried deleting my .idea/ folder, trying different Ruby or Rails versions (i.e. Ruby v2.3.0 or latest Rails 5.1.2), and even starting a brand new project from scratch. But I could run the Rails server fine using Terminal (outside the IDE) with rails s.
SOLUTION approach:
First I opened Run > Edit Configurations but "Choose SDK from module" didn't have any Project Modules available to select from the drop-down, so I had to create one as follows:
I went to File > Project Structure
Then I clicked Modules, and clicked the icon "+", and selected "Import Module".
Then I navigated to my Rails project's root directory "'/Users/my_username/code/apps/_murmur/skag_server_rails" and clicked Open, which displayed the following.
I then selected "Create module from existing sources" and clicked "Next", and it showed the following, with a blue checkbox shown next to my Rails project root directory that it found, so I clicked "Next" again:
It then showed the following window, and I clicked "Finish".
I'd now finished importing the Rails project I was working on as a Module, and it showed the following, so I clicked "Ok", as I was now ready to try and run my Rails server again:
So I went back to Run > Edit Configurations window and click on "Rails > skag" where I could now use "Choose SDK from module" since there was now my "skag_server_rails" Module available in the drop-down that I just created, and no errors were apparent, as shown below:
I was then able to click Ok to save the Run/Edit Config
I was then able to run the server Run > Run, which displayed:
I was then able to successfully open the Rails app in the browser open http://localhost:3000
But then when I tried to Run > Debug so I could debug using breakpoints, it gave me the following errors:
I solved this by running the following in the Terminal (outside the IDE):
gem install debase --pre
gem install ruby-debug-ide
Then finally I could run Run > Debug and it allowed me to trigger breakpoints as shown below:
Important Note:
The initial approach that I took that DID NOT end up fixing the error involved choosing to use "Use other SDK" within the Run > Edit Configurations window to load my Ruby Gemset into the debug configuration (instead of using a Module).
UPDATE: I encountered the same error again more recently on 2nd September 2017 and followed these steps to overcome it:
Go to Menu > File > Project Structure > Project Settings > Modules > Click "+" and select "New Module"
Select "Ruby on Rails" from the left hand side list
Choose for "Module SDK" label your "RVM: ruby-2.4.1 []"
Click for "Rails Version" label the "Install Rails Gem..." drop-down
Select a Rails version for it to download and wait (i.e. 5.0.0)
Do not select a Rails version that causes the tooltip "This version is not fully supported" to appear below (i.e. selecting a Rails version >5.1.2 causes this to occur)
Click for "Rails Version" label the version that finished downloading from the drop-down (i.e. 5.0.0)
Enter "Working Directory" label value of "../"
Enter a "Module Name" (i.e. videotube-5.0.0)
Click "Apply" and "Save"
Go to Menu > Run > Edit Configurations
Change any directories that do not point to root folder of app
Go to Menu > Run > Debug
My variant to solve same problem.
Create new run configuration, but use "Ruby" template instead of "Redmine":
Ruby script field set to path to your redmine rails bin path and Script arguments set to "server -b 127.0.0.1 -p 3000 -e development" for ex.
This worked for me
Remove the .idea file
Invalidate the cache and restart the ide
Ok, this RubyMine has some serious issues. My day started out peaceful and then ended as a nightmare, courtesy of RubyMine. All I did was git checkout to a certain version of my repo. Well, when I did that, suddenly the folders in RubyMine disappeared. Yes, that is the first bug. I git checkout 8d4fbd1b5dfce0a3daa16896a603903a And then I open RubyMine and folders are gone! I closed and reopened. Still no folders. I restarted computer and still no folders.
I had to go to Project > File Structure and delete the Module. And then create a new Module. Now the project folders appear. But then I get this obscure error Rails server launcher wasn't found in the project. I have no idea what it means. I go online and they say delete .idea directory in your project. So I do that. And now again I have to delete and recreate the module.
This time it says "overwrite directory" since I have an existing project. I select "Yes" and then I open project and my secrets.yml is gone! Now I had to use secrets.yml I had backed up. And then finally it works.
Seriously, all this just because I wanted to checkout out a specific git commit? Come on.
UPDATE
After further investigation, I understand what is going on. There are three critical Intellij Idea files with regards to the Ruby plugin:
/.idea/
MyProject.iml
/MyProjectGemset/
These three files should not be checked into git and should be consistent across the different branches of your project. You might have another *.iml in the project. Delete that and make sure you are using the same .iml throughout the branches.
These two files pertain to your SDK:
MyProject.iml
/MyProjectGemset/
This file pertains to general configuration:
/.idea/
I've came across this same problem, and a way I found to solve it was to properly defining the root folder of the project when opening it in the first time with RubyMine.
As far as I can understand, ideally you should open the project by pointing the RubyMine to the project's root folder:
my-workplace/
|-- rails-project-name/ <-- point RubyMine here when openning
| |-- app/
| |-- bin/
| |-- config/
| |-- db/
| |-- lib/
| |-- log/
| |-- public/
| |-- test/
| ...
if you follow the solution from Artyom Blagoda on the Windows with ruby installed on the WSL (Ubuntu) you'll get into situation when wsl path (\wsl$\Ubuntu) of ruby script (rails) could not be found by remote (Ubuntu) ruby interpreter. to make it work you need to add path mapping on:
Settings -> Ruby SDK and Gems -> Your remote ruby or RVM -> then click the folder icon above, you'll find a new window where you put:
Local Path: //wsl$/Ubuntu/PATH_TO_YOUR_RAILS_BIN
Remote Path: PATH_TO_YOUR_RAILS_BIN
hope it helps ;)

NetBeans Ruby plugin install

I installed NetBeans 7.3.1 onto my mac and then proceeded to download the necessary Ruby plugin to allow for Ruby in the IDE. However when I go to add the plugin file I get this message:
Unable to connect to the ruby because of Unexpected closed connection to file:/Users/XXXXX/Desktop/updates
Check your proxy settings or try again later. The server may be unavailable at the moment. You may also want to make sure that your firewall is not blocking network traffic.
Help is appreciated! Thank you!
This post might help you. https://blogs.oracle.com/geertjan/entry/ruby_on_rails_in_netbeans
Go to "Tools > Plugins",
Select "Downloaded" tab
Click on "Add Plugins ..."
Navigate to your updates folder
Select only the *.nbm files
in addition to picking the .nbm files from the unzipped folder, the .jar file must also be added to the plugin selection for the plugin to install. You can use the 'show all files' drop down menu option in the selection dialog box to add the .jar file to the included file list.

Git clone error in Xcode

Up until now I've been using Xcode with Subversion for my code repositories with no problem. Now I'm working on a project that uses a Git repository stored at GitHub, so I figured I'd go clone that repository to my local machine and get started.
In Xcode, I add the repository then tell it to Clone -- The machine chews on this for a while, and if I use the Finder I can see the files being placed in the target directory (which is a newly-created, empty directory on my system). After a while though, I get an error message:
fatal: destination path '/Users/myname/Documents/ProjectName' already exists and is not an empty directory.
I have tried this three times now, each time starting with an empty target directory, and it gives the same error message each time, so I know it has to be something I am doing wrong, or have not set up properly.
Thinking that perhaps something was going wrong and the system was trying to do a second clone operation (to a now non-empty directory) I tried canceling and trying a build, but some files are missing from the project -- so not all of it made it down to my system.
My searches on this issue turn up several hits for people doing the clone via command line and showing this error message, but not through the Xcode interface.
Does anyone have any suggestions about what might be going wrong?

Cannot connect to valid github repository

I have read/write access to a private repository owned by someone else but RubyMine cannot connect to the Git URL. Workflow:
Open RubyMine
Click on "Check out from source control"
Select Git
Enter URL, click "Test", and Test fails
I'm using OSX Lion and my Github credentials have already been saved. I've tried connecting to a few other github URLs on the "Explore" tab at github.com and I haven't had any trouble. Suggestions?
I was able to fix this by following the tutorial on GitHub, Generating SSH Keys, exactly. I also deleted any existing keys in my account before adding a new one. In the RubyMine dialog, I pasted the ssh link to my repository instead of the HTTP one. Hope this helps someone else.
https://help.github.com/articles/generating-ssh-keys
I would recommend to create an issue in the RubyMine bugtracker and attach the log file there (Help -> Reveal Log in Finder). Maybe it is a bug in RubyMine support of Git over HTTP.
Meanwhile as a workaround you may use SSH, as adviced by user1836351.
Another workaround is specifying your credentials in the ~/.netrc file.
Example of the file content:
machine github.com
login yourname
password yourpassword

Resources