Creating new rails project throws exception when installing json - ruby-on-rails

I'm kind of newbie in ruby and I'm trying to create a new project in my Win8.1 pc.
I'm using the latest rails installer. The installations ends successfully but when I run rails new my_project I got this error when it is Installing json.
Installing json (1.8.1) creating Makefile
0 [main] make 5852 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
439 [main] make 5852 open_stackdumpfile: Dumping stack trace to make.exe.stackdump
MSYS-1.0.17 Build:2011-04-24 23:39
Exception: STATUS_ACCESS_VIOLATION at eip=10002840
eax=00000000 ebx=00000000 ecx=75BE6DB4 edx=00000003 esi=00000024 edi=00000001
ebp=0028D638 esp=0028D4A0 program=C:\RailsInstaller\DevKit\bin\make.exe
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
I've try installing as administrator, compatibility mode (win7) and replacing DevKit but nothing works.
Thanks

If you are using rails on windows its obvious that you will have to face so many issues with gems installation, etc. I suggest you to switch to Unix-based system as suggested by Serge Vinogradoff.
If you still wants to continue with windows then you need to check if c compiler is installed on your machine properly or not. If not then RubyInstaller Development Kit may help you: http://rubyinstaller.org/add-ons/devkit/
The devkit installs a C-compiler (and some other stuff) to compile C-written parts.
Install it and try again to install the gem - perhaps with option --platform=ruby.
Also you can try to use json_pure written on pure Ruby

I would suggest to switch to Unix-based system if you want to work with Rails.

Related

Yaws is not loading yaws_dynopts module

I am running Yaws server version 2.0.2 with Erlang/OTP 18 [erts-7.3] on ubuntu 16.04 and installed it using apt. Now when i try to run this example i get
undef yaws_dynopts random_seed. I have verified that module yaws_dynopts is not loaded OR compiled.
error is:
{undef,[{yaws_dynopts,random_seed,[6885,441906,806568],[]},
{m1,'-out/1-fun-0-',1,
[{file,"/home/my_account/.yaws/yaws/default/m1.erl"},{line,16}]}]}
which corresponds to line in example:
yaws_dynopts:random_seed(erlang:phash(node(), 100000),
erlang:phash(A2, A3),
A3),
Do anyone have solution to this? And is it a bug?
Does l(yaws_dynopts). also cause an error? I'm starting to believe whoever packaged your version of Yaws didn't do it correctly, leaving out this critical module. You should look to see if version 2.0.3 is available, or alternatively consider building your own from source. We're currently at 2.0.4.

RubyMine + Vagrant : Error Copying Gems

I'm currently evaluating RubyMine 7.0.4 on Mac OS X 10.8.5, and I'm trying to get my Ruby on Rails project up and running in the editor but after I try to bundle, I get "Error Copying Gems". Locally I use rbenv but this project uses Vagrant with Ruby 2.1.
I've gone into RubyMine Preferences -> Languages and Frameworks -> Ruby SDK and Gems and set up a "Remote Interpreter" which looks like it is correctly pulling in my Vagrant / SSH information.
After I click OK, it looks like it correctly pulls down the gems, and copies them to the vendor/bundle folder, but then the IDE pops up an error message saying :
"Error Copying Gems - Unknown message with code 'Could not determine the type of file sftp://127.0.0.0.1:2222/......'"
or sometimes I'll get a more detailed error:
"Error Copying Gems - Could not copy sftp://127.0.0.1:2222/usr/bin/sudoedit to file://Users/my.username/Library/Caches/RubyMine70/ruby_stubs/....."
It feels like it is trying to copy them to a local cache folder on my Mac but failing for some reason.
I was facing a similar albeit different problem, maybe you are making the same mistake:
When setting up RubyMine to work with Vagrant, I am assuming you are adding a remote interpreter using the Vagrant dialogue. There it asks you to input the path to ruby executible. This is misleading, what you need is the path to where the gems are installed.
I'm also assuming you using RVM on your VM, as you indicate that you are not using rbenv on your VM.
I solved this by following the symlink steps found http://randycoulman.com/blog/2013/11/05/rubymine-and-vagrant/
Basically, RubyMine isn't trying to save things on your host machine. Its trying to save things to that particular path on your guest OS. I worked around this issue by creating the /Users/user_name/... directory on my guest OS, and then symlinking the directory that has the projects to /vagrant (Again, on the guest OS)

Cannot create grails projects in STS but from command line

I have recently started to work with grails. I was able to create applications and generate stuff. Yesterday I wanted to resume my work, after a little break and ran into the following error, when trying to create a new project:
Command terminated with an exception:
org.grails.ide.eclipse.longrunning.client.GrailsProcessDiedException: Grails process died
(see details for partial output)
Grails process died
------System.out:-----------
------System.err:-----------
This error only occurs when I use the SpringSourceTool, if I try using the command line it works fine. My first reaction was to change the java version from 1.8 to 1.7, but that didn't help. My environment variables look like this (I am running Fedora Linux 19)
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.0.x86_64
GRAILS_HOME=/home/peer/grails/grails-2.3.0
They are also included in the PATH variable.
Can anybody help? Thanks, Peer
This is a known issue in STS:
https://issuetracker.springsource.com/browse/STS-3277
A work-around is provided in the link.
For anyone pulling their hair out trying to create a grails project using the STS extension for Grails, here is my setup and following is what I did to get it working:
-- OSX 10.8.4 Build 12E3067 --
-- STS Version 3.4.0 --
-- Grails 2.3.3 (installed separately to STS) --
Fresh installed STS 3.4.0
I *de*selected the Preferences/Groovy/Compiler/Enable checking for mismatches between
project and workspace Groovy compiler levels
I ONLY selected the Grails Support option when installing the extensions (nothing else)
Restart STS 3.4.0 (i.e. restart eclipse)
I then pointed my Grails project to my existing Grails 2.3.3 installation
Make sure that the environment variable GRAILS_HOME is set and exported in the same
shell from which you invoke STS otherwise you will get a process termination error in
Eclipse (STS)
This worked.

Installing RubyMine on Windows 7 persistent error: "Could not find "README" in any of your source paths."

I installed ruby 1.9.3 w/ rubyinstaller-1.9.3-p194.exe, and then installed RubyMine right after, as per directions:
http://www.jetbrains.com/ruby/quickstart/index.html
and
http://rubyinstaller.org/
I have git hub for windows already installed which I don't know if that could cause the problem.
I have also installed ruby and rails several times but I looked through the PATH environment variable for any no longer existing installations and removed them (after having already had this error) which didn't help.
Here are the settings I select in RubyMine.
The error message:
"C:\Ruby193\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby193\bin/rails 3.2.6 new "D:/Program Files (x86)/Git/Rails App/asfasf" --skip-test-unit --javascript=jquery --skip --database=postgresql
exist D:/Program Files (x86)/Git/Rails App/asfasf
Could not find "README" in any of your source paths. Your current source paths are:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/generators/rails/app/templates
Process finished with exit code 1"
I apologize if I come across as angry / frustrated (I edited this several times to remove it) as I have been trying to get RubyMine to work on Windows 7 or Ubuntu 12.04 and neither have been successful.
Any advice would be greatly appreciated!
I continued searching through the web for information and remembered somewhere installing rails on windows previously that for some reasons files couldn't have spaces in them.
Long story short: make sure your path doesn't have spaces in the name because it breaks rubymine or rails or something along the way.
Changing my project folder to a destination with no spaces solved the problem.

Error installing Rails (after installing nearly 20 dlls one by one) rl_attempted_completion_over (readline.dll)

Each time I typed: gem install rails it asked me for a dll. SO I downloaded the following:
datasvcs.dll, icudt24l.dll, icuin24.dll, icuio24.dll, icuuc24.dll,
libeay32.dll, libmex.dll, libmwservices.dll, libmx.dll, libut.dll,
libz.dll, mpath.dll, msvcrt-ruby191.dll, mvalue.dll, m_dispatcher.dll,
nscrt.dll, readline.dll, ssleay32.dll, xerces-c_2_1_0.dll, zlib.dll.
In the end it said: can't find this location rl_attempted_completion_over (readline.dll)
(I already have readline.dll!)
I'm using Windows XP
I encountered the exact same "rl_attempted_completion_over" problem after installing Ruby 1.9.1p376 on a Windows 7 machine that was running Ruby 1.8.6 just fine. I manually downloaded all of the dlls from econsultant.com/dll-database/ Unfortunately, the readline.dll they have is not correct. Their dll was 5,632 bytes. The dll Ruby requires is 136,192 bytes in size. I found the correct dll at http://jarp.does.notwork.org/win32/readline-4.3-2-mswin32.zip. Copy this dll to a path in your environment. I placed my dlls in the Ruby's bin directory. After having done these steps and running a few tests with Sinatra and Rails, this appears to have resolved the problem.

Resources