I'm wondering if anyone has managed to integrate SASS into their RubyMine environment, and if so, how they managed to configure it? I'm a little confused, because although there is a SASS plugin by default in RubyMine, I don't seem to be able to use SCSS files in my project.
Presently what I do is open up a Terminal window in my SCSS directory and run the standard sass --watch source:destination command to monitor and rewrite my SCSS files to CSS. This works OK, but I'd feel a lot smarter if I could figure out how to configure the RubyMine IDE to add it as a run-able service.
My guess is that it has something to do with the Run / Edit Configurations menu, which would add it as a run-able service like Spork and Rspec, but I'm not certain what I would actually configure that to work properly (or if that's even the right way to do it).
Any thoughts?
OK, 45 minutes of experimentation later and it's all figured out. First, you need to know the EXACT command you intend on running in SASS, so if you plan to monitor multiple directories or something else using multiple arguments, test it in a command line for functionality first. Then:
Click menu Run / Edit Configurations
Click Ruby, then the little + button to create a new Ruby configuration
Fill in the dialog boxes using the following template:
Ruby Script: /Users/username/.rvm/gems/ruby-1.9.2-p180#global/bin/sass
Script Arguments: --watch sourcedir1:destinationdir1 --watch sourcedir2:destinationdir2
Working Directory: /my_rails_project/public/stylesheets
Ruby Arguments: -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)
Notes: I just used the default Ruby Arguments, and I didn't put any environmental variables in. Works like a champ.
Related
I tried to complete the first suggestion by typing
ruby
rails bin/dev
but I was not able to get an output (The terminal showed no output )
then I realized my code was wrong so I tried once again and typed:
rails create bin/dev
But it showed me an error and said "rails aborted!
Don't know how to build task 'create' (See the list of available tasks with rails --tasks)
Did you mean? db:create"
Then I tried the other command by typing rails in front of it but that didn't work either.
So even though my app works should I bother to solve this warning or skip past it?
TLDR: You need to build your CSS output on every Tailwind style addition so execute bin/dev in a terminal to start your rails server AND watch for tailwind changes.
Hey! Your screenshot is saying that you have successfully installed Tailwind via the tailwind-rails gem.
The end of the message provides instructions on how to build your Tailwind CSS during local development so that Tailwind styles are output to the CSS and applied to your app on localhost:3000 immediately.
Option 1: (documented in the installation output) In your terminal, execute bin/dev to start your rails server AND watch for tailwind changes. This command uses a library called foreman to run two processes, reading from the Procfile.dev that was created in your project's root directory during tailwind installation.
Option 2: (documented in this section of the README) In your terminal, execute rails s in one terminal window and rails tailwindcss:watch in a different window (separate commands)
Option 1 is simpler and probably recommended.
(Based on your screenshot, you are not on a Mac and your exact command may differ, but these work for me on a macbookpro.)
I am working on a project for which we run rspec tests on codeship, along with rubocop for ruby style consistency.
We use scss-lint in development and as an editor integration for sass styles.
We would like to integrate scss-lint into codeship, so the we would get similar reports to what we get for rspec and rubocop after running our test suite.
Can anyone help with a detailed way to do this? Is there anything to achieve this in a quick and easy way? (similar to how rubocop is integrated).
I read something in the codeship documentation about docker, but we are not currently using docker, so I was wondering if there would be another solution.
Thanks for your help!
You should be able to simply install scss-lint via RubyGems (or Bundler) and then just run it against your files.
Something like
gem install scss_lint
scss-lint app/assets/stylesheets/
To supply custom configuration options, simply include a .scss-lint.yml file in the same directory. See https://github.com/codeship/documentation/ for an example. (Even though that projects is run on our Docker platform, the basic steps for using it are the same.)
I'm trying to customize and modify Spree Commerce, but none of the standard asset files/images/views are available under either app/views, lib/assets, or anywhere else I can think to look. I'm trying to go through their tutorials, but I can't find anything to edit. Is there another command I need to decompress everything or something? Thank you so much for any help!
The way I over came this is to download the main spree gem, via github.com, look where the images are located then creating the images I wanted to override in my local app/assets directory with the same path run:
rake assets:precompile:nondigest
restart webrick/pow or any other web server you are running and voila!
I'm guessing you're not really familiar with how gems work. As people here have said, these are not going to automatically show up in your core app directory, but the gemfile and running bundle install knows how to reference them.
So you need to find those gems to figure out the file names, as you said. If you want to view the gemfiles run this command in the terminal:
$ bundle open spree_frontend
If you get this error:
To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR
then you haven't set up the editor, so do this:
export BUNDLER_EDITOR=sublime
Then redo the bundle open command. This should open the spree_frontend directory which will let you investigate the file names/paths and the assets. If you want to change an entire template, you need to create that file matching its name and path exactly as it is in the spree gem (spree/layouts/spree_application.html.erb for example) then when you edit it your rails app will render the code in your core app directory thus overriding the spree gem.
That make sense?
Is rails debugging supported on Aptana Studio 3. I have earlier debugged Rails applications on Aptana Studio2 with the embedded browser and embedded servers.
1)How to start rails application in Debug Mode?
2)How to enable remote debugging in firefox?
My work environment is as follows and I have been using RVM
Rails 3.1.x
Ruby 1.9.3
Ubuntu 10.10
I have already installed the debug related gems
ruby-debug-base19 (0.11.25)
ruby-debug-ide19 (0.4.12)
Try removing (commenting out) ruby-debug-base19 from Gemfile. "ruby-debug-ide" should be enough, judging from the comments from a post on different IDE - RubyMine.
For debugging, right click on the project and select "Server Debug", then open the site manually in firefox (you will see the address/port the server listening to in the console). I did not manage to set a breakpoint this way, but I only had a test project with no logic in it, so I am not sure how well it works on a real project.
Not sure about your question on "remote debugging with Firefox".
Answer for Q1: Aptana is just an IDE which provides you a not bad interface to input code. I don't think it a very good idea to 'DEBUG' in it.
For me, debugging rails depends on : command line, unit tets and log files. you should first of all, write an failed unit test, then run it in the command line, and write the implementation code, then run unit test, then write implementation code ... sometimes you need to check the output/log file, finally , the unit tests bar turns to green and your code is implemented.
hope this post useful to you:
How to configure aptana for instant running of my script
Answer for Q2: I don't know your "remote debugging in firefox". If you want to show detailed error message to someone else, just start your server as "development" mode. e.g.
rails s -p 3000 -e development
or just:
rails s
Netbeans ide has rails console? I use Netbeans for PHP for a long time, and now I want use to my Rails applications. I saw the generators, bundle has a fast gui menu, but can I use this commands myself in Netbeans, so I looking a built in console.
right-click on the project in ur Project window, u will see a selection called "Rails Console"
-edit-
if you want shell, terminal. you might have to launch it will cmd, ssh or whatever way to access it.
--edit 2--
you might can check this out:
http://wiki.netbeans.org/FaqRubyTerminalEmulator